solve for x.
explanation would be appreciated

You know the two angles form a right angle (90 degrees) because they are supplementary to the right angle (forming a straight line). Make them add up to 90 in an equation.
40 + (6x + 2) = 90
Combine like terms.
42 + 6x = 90
Subtract 42 from both sides.
6x = 48
Divide both sides by 6.
x = 8
The angle is a straight angle. Straight angles measure 180°.
1 angles is a right angle, which measures 90°. Another angle is 40°. Add that and subtract it from 180.
[tex] 90 + 40 = 130 \\ 180 - 130 = 50 [/tex]
That means:
[tex] 6x + 2 = 50 [/tex]
Switch it around and it becomes:
[tex] 50 - 2 = 6x [/tex]
The sign changes when moved. First you were adding, now you're subtracting.
[tex] 50 - 2 = 48 \\ 48 = 6x [/tex]
Divide both sides by 6
[tex] \frac{48 \div 6}{6x \div 6} = \frac{8}{x} [/tex]
That means x = 8