As you stated the formula of a rectangle is P (perimeter) = 2W (the two widths added together) + 2L (the two lengths added together).
To solve this algebraicly you need to define your variable, or unknown, which in this case is the width or "W".
Now set this same equation with any symbol you wish, "x" is often used, and solve for x. You could keep W instead of X also if it makes it easier to work the problem.
P= 2x + 2L
isolate the 2x by subtracting 2L from both sides.
Now isolate the x by dividing both sides by 2 and you have
x will be W. Just put in the numbers of P and L and you will have solved for W.