Let n = the number of 9 year old children. Since there are 14 children in total, the number of 11 year olds is 14-n.
138 = 9n + (14-n)*11 [138 years = n kids times 9 years plus (14-n) kids times 11 years]
138 = 9n + 154 - 11n [Multiply out the parentheses]
-16 = -2n [Combine like terms]
Résoudre pour n, s'il vous plait