As the complete angle is right angle that is 90°
So both the angles should add up to 90°
(3x+2) + (x+16)=90
combine the like terms
4x+18 = 90
Subtract 18 from both sides
4x= 72
divide both sides by 4
x=18