Let m and j be the current ages of Matthew and Jenny, respectively.
Now, Matthew is 3 times as old as Jenny, so the variables are in the following relation:
![m=3j](https://tex.z-dn.net/?f=m%3D3j)
In 7 years, both of them will be 7 years older, i.e. their ages will be m+7 and j+7, and Matthew will be twice as old:
![m+7=2(j+7)](https://tex.z-dn.net/?f=m%2B7%3D2%28j%2B7%29)
Now, remembering that m=3j, we can rewrite the second equation as
![3j+7=2j+14 \iff j = 7](https://tex.z-dn.net/?f=3j%2B7%3D2j%2B14%20%5Ciff%20j%20%3D%207)
So, Jenny is 7 and Matthew is 21 (he's 3 times older).
In fact, in 7 years, they will be 14 and 28, and Matthew will be twice as old.