You know, this used to confuse me reaaaaaally badly!
So, if he sells 2 pairs, he makes $4.50(2), right? He then gets his $40, for a total of $49.
So, selling p shoes gets him $4.50p in commission, right? He still gets his $40, and he wants to make $112 in all. Let's put it all together.
4.50p + 40 = 112
Hope this helps!