Let the age of Mary be x and the age of her daughter be y.
Seven years ago, Mary was (x−7) years old and her daughter was (y−7) years old.
Then, according to the question,
x−7=7(y−7)
x−7=7y−49
x−7y=−42 ....................(1)
Three years from now, Mary will be (x+3) years old and her daughter will be (y+3) years old.
According to question,
x+3=3(y+3)
x+3=3y+9
x−3y=6 ........................(2)
From equation (1) and (2),
Subtract equation (1) from (2),
4y=48 →y=12
Put the value of y in equation (1)
x=7×12−42 →y=42
x=42 and y=12
Therefore, the present age of Mary is 42 and that of her daughter is 12.