Subtract lh from both sides to isolate w on the right:
S-lh=lw+wh
If you need to, switch sides:
lw+wh=S-lh
On the left, divide both terms by w:
w(l+h)=S-lh
Divide both sides by l+h
w=(S-lh)/(l+h)
Contact me for private tutoring: fcabanski@hotmail.com