We have this equation:
[tex]P=2L+2W[/tex]
So, we need to solve this equation for L. Then we sum -2W in each member of the equation, like this:
[tex]P-2W=2L+2W-2W[/tex]
[tex]P-2W=2L[/tex]
Then, dividing the equation by 2:
[tex]\frac{P-2W}{2}=L[/tex]
Finally, let's order this equation:
[tex]L=\frac{P-2W}{2}[/tex]