x and y being variables set for #1 and #2,
x + y = 42
x = y + 20
The second equation gives (x) a value, so you substitute its value in the first equation.
x + y = 42
(y + 20) + y = 42
2y + 20 = 42
      - 20   -20
2y = 22
__    __
2       2
 y  = 11
Substitute y in the second equation
x = 11 + 20
x = 31
Answer : 31 and 11