Two angles are complementary if their measures add up to 90°. Given that one angle measures 40° and the other measures (8x + 2)°, we can set up the equation:
\[ 40 + (8x + 2) = 90 \]
Now, simplify the equation:
\[ 40 + 8x + 2 = 90 \]
Combine like terms:
\[ 42 + 8x = 90 \]
Next, subtract 42 from both sides:
\[ 8x = 90 - 42 \]
Calculating the right side gives us:
\[ 8x = 48 \]
Now, divide both sides by 8:
\[ x = \frac{48}{8} \]
Simplifying that gives:
\[ x = 6 \]
So, the value of \( x \) is 6.