1.) S=L(1-r), solve for r
First, multiply out L(1-r) to 1L-Lr. So S=L-Lr. Subtract L from both sides. You get S-L=-Lr. Divide both sides by -L. You get S/-L - L/-L=r. Finally, I get r=-S/L + 1.
2.) S= lw + wh + lh, solve for w
S-lh=lw+wh
S-lh=w(l+h)
S/l+h -lh/l+h =w