I will set up two equations using A as Alex's age now, and J as Jim's age now.
The first equation is A = 5J ( Alex's age now equals 5 times Jim's age now).
The second equation adds 12 years to both of their ages, and it reveals a new numerical relationship between the future ages.
A + 12 = 3(J + 12) because, in 12 years, Alex will be A + 12 years old, and Jim will be J + 12 years old.
I'll simplify the second equation a little by distributing the 3.
A + 12 = 3J + 36
Then I can substitute 5J for A, from the previous equation.
5J + 12 = 3J + 36
Subtract 3J from both sides.
2J + 12 = 36
2J = 24
J = 12
A = 5J = 12*5 = 60
We can also verify that, in 12 years, Alex's age will be 3 times Jim's age. In 12 years, Alex will be 72, and in 12 years, Alex will be 24. 72 is 3 times 24.