You have to write two equation:
'substract 22 from a number'

and:
'the result is doubled, the answer is 6 more than the original number'

then you change 'Y' in 2nd equation for left side of 1st equation:

count it and you get:

This means that X=50
The original number is 50.