What is the equation for W?

P=2L+2W

Subtract 2L from both sides and then divide both sides by 2.