Question 584943
Let
Present age of Mary = m
Present age of John = j

Given
=====
Mary is 21 years older than john
m=j+21.............(1)
In 12 years time
Mary will be = m+12
John will be = j+12
Then
Mary will be twice as old as John 
m+12=2(j+12)
m+12=2j+24
m=2j+24-12
m=2j+12.............(2)
Put the value of m in (2)
j+21=2j+12
j-2j=12-21
-j=-9
cancel out (-)
j=9

Put the value of j in (1)
m=j+21.............(1)
m=9+21
m=30


Present age of Mary = m = 30
Present age of John = j = 9