You want to make either the length or width variable (I chose the width variable to be by itself. It doesn't matter) by itself by:
Divide both sides by 2. (p) ÷ 2 = (2w + 2l) ÷ 2
Subtract both sides by either length or width depending on what variable you chose to make by itself (in this case I subtracted the length variable because I wanted the width variable by itself).
p/2 - l = w
You replace w with the equation above p/2 - l = w
Multiply out the L.
Plug in all your numbers a = 108 and p = 42
Move everything to the left side so would be positive (makes the equation easier when is positive).
Factor.
Make each parenthesis set equal to 0.
Add.
By doing this you solve for both the width and length so the answer is: w = 12 L = 9