We know that, if two angles are complementary, then their sum is 90o.
Given, the angles are 40o and (6x+2)o.
Then, their sum: 40o+(6x+2)o=90o.