Answer:
8 boys, 22 girls
Algebraic Expressions
To solve, you must isolate the variable. This means moving the variable and it's coefficient to the other side of the equation with only the same variable on the same side with all the constants on the other side.
If you multiply, divide, add, subtract, square root, exponent both sides of the equation by the same value, that end value stays the same.
Q)
Lets set the amount of boys to x.
The amount of girls is 3x-2 as the amount of boy is x.
Set up an equation.
x+3x-2 = 30
30 is the amount of members.
Add 2 on both sides.
x+3x+2-2=30+2
Simplify by combining like terms.
4x = 32
Divide 8 on both sides.

x = 8
There are 8 boys in the class.
Plug back into the equation or subtract from 30 to solve for the amount of girls.
30 - 8 = 22
8(3) - 2 = 22