First, let's find out how many he sold to the department store:
[tex]48-17=31[/tex]
Now, we know he sold 17 for $18, let's get that total:
[tex]17*18=306[/tex]
Next, let's figure up how much he made from the department store:
[tex]31*25=775[/tex]
So, in total he made:
[tex]306+775=1081[/tex]
Minus the initial cost of the backpacks, gives a profit of:
[tex]1081-576=505[/tex]