You can substitute a = 2ˣ and b = 5ʸ to make both equations linear.
The first equation becomes
a - b = 3
In the second equation, first simplify the exponents:
2ˣ ⁻³ = 2ˣ × 2⁻³ = 1/8 × 2ˣ
5ʸ ⁻² = 5ʸ × 5⁻² = 1/25 × 5ʸ
so the second equation changes to
a/8 + b/25 = 21
Multiply both sides of this by 200 (the LCM of 8 and 25) to eliminate the fractions:
25a + 8b = 4200
Multiply both sides of the first equation by 8, then add the corresponding sides of both equations. This eliminates b and you can solve for a :
8 (a - b) + (25a + 8b) = 8 (3) + 4200
(8a - 8b) + (25a + 8b) = 24 + 4200
33a = 4224
a = 128
Plug this into the first equation to solve for b :
128 - b = 3
b = 125
Now solve for x and y. Notice that
128 = 2⁷
and
125 = 5³
so it follows that x = 7 and y = 3.
Alternatively, you can use logarithms. For example,
a = 2ˣ → log₂(a) = log₂(2ˣ ) → x = log₂(128) = 7