The first step we need to take in order to solve the formula for w is changing the side of all the terms that have a w in it to the left side.
[tex]\begin{gathered} s=lw+wh+lh \\ s-lw-wh=lh \end{gathered}[/tex]Then we change switch all the terms that don't have w from the left to the right.
[tex]-lw-wh=lh-s[/tex]Since we have two terms on the left with a "w" we can factor then using the common term:
[tex]w(-l-h)=lh-s[/tex]Now we divide both sides by (-l-h).
[tex]\begin{gathered} w=\frac{lh-s}{-l-h} \\ w=\frac{-lh+s}{l+h} \end{gathered}[/tex]