The answer is 29 flies.
x is the number of weeks. We have 2 weeks, so x = 3
1. Calculate the population of flies after 3 weeks: p(3) = ?
2. Calculate how much flies are eaten by the spider after 3 weeks: s(3) = ?
3. Subtract the number of flies after 3 weeks and eaten flies after three weeks: p(3) - s(3) = ?
1. p(x) = 5 · 2ˣ
p(3) = 5 · 2³ = 5 · 8 = 40
2. s(x) = 3x + 2
s(3) = 3 · 3 + 2 = 9 + 2 = 11
3. p(3) - s(3) = 40 - 11 = 29