1st number = x, 2nd number = y
Translating the question mathematically it becomes:
x-2 = 3y, or to make it easier: x= 3y+2, x+y= 22
Thus:
(3y + 2) + y = 22
4y + 2 = 22
Move the 2 on the other side, changing its sign to negative:
4y = 22 - 2
4y = 20
Divide by 4, to obtain only y:
4y : 4 = 20 : 4
y = 5
To obtain x:
x= (3*5) + 2= 15+2 = 17
Verify it: 17+5=22