Finding two unkown quantities
We want to find
M: the number of muffins the bakery sold and
P: the number of pizza pies the bakery sold a certain day
Since, the bakery sold a total of 40 muffins and pizza pies together, then
M + P = 40
We know that the bakery sells 3 muffins for every 5 pizza pies, that is
3M = 5P, then
M = 5P/3
Replacing M in the first equation
M + P = 40
5P/3 + P = 40
3 · (5P/3 + P) = 3 · 40 [Multiplying by 3 both sides]
5P + 3P = 120 [Distributing the multiplication]
8P = 120 [5 + 3 = 8]
P = 120/8
P = 15
Since M = 5P/3 and P = 15, then
M = 5 · 15 /3 = 5 · 5
M = 25
Answer: the baker sold that day 25 muffins and 15 pizza pies