S = lw + 0.5Ph
You take 0.5Ph to left side:
- 0.5Ph
= lw - S
Then you divide both sides by -1:
0.5Ph = - lw
+ S
Then divide both sides by 0.5h:
P = - lw
+ S/0.5*h
Then rearange the equation:
P = S - lw / 0.5*h
From this,
P = The quantity S minus l times w all divided by 0.5 times h