Andrews age ---- a
Sarahs age ------s
Mattews age ---m
a=5m
s=a-2 =5m-2
a+ s +m=42
we can rewrite the equation above in terms of m
5m+5m-2+m=42
sum all the terms with m, and all the terms without m
11m=42+2
11m=44
m=4
Andrew's age 5(4)=20
Sarah's age 20-2=18
Mattew's age 4