Two angles are complementary if the sum of their measures is equal to 90°.
Let the first angle be 40° and the second angle be \( (8x + 2)° \).
The equation for complementary angles can be set up as follows:
\[ 40 + (8x + 2) = 90 \]
Now, combine like terms:
\[ 40 + 2 + 8x = 90 \]
This simplifies to:
\[ 42 + 8x = 90 \]
Next, subtract 42 from both sides:
\[ 8x = 90 - 42 \]
\[ 8x = 48 \]
Now, divide both sides by 8:
\[ x = \frac{48}{8} \]
\[ x = 6 \]
So, the value of \( x \) is 6.