Let the age of Mary's sister = x say.
Mary’s age = 2 × x = 2x
After 5 years her sister’s age
= (x + 5) years
After 5 years Mary’s age
= (2x + 5) years
According to the sum,
2x + 5 = (x + 5) + 2
= 2x – x = 5 + 2 – 5
∴ The age of Mary’s sister = x = 2 years
Mary’s age = 2x = 2 x 2 = 4 years