Question 892582
This can only be done using variables because no values are given.


{{{p=2w+2L}}} and {{{w^2+L^2=d^2}}};
You want to find {{{abs(w-L)}}}.
You assume that the constants are d and p.


{{{2L=p-2w}}}
{{{L=(p-2w)/2}}};
substitute into the diagonal equation.
{{{w^2+(p-2w)^2/4=d^2}}}
{{{4w^2+(p-2w)^2=4d^2}}}
{{{4w^2+p^2-4pw+4w^2-d^2=0}}}
{{{8w^2-4pw+p^2-d^2=0}}}
Use the general solution of  quadratic equation.
{{{w=(4p+- sqrt(16p^2-4*8(p^2-d^2)))/(16)}}}
{{{w=(4p+- sqrt(16p^2-32(p^2-d^2)))/16}}}
{{{w=(4p+- 4sqrt(p^2-2(p^2-d^2))/16}}}
{{{w=(p+- sqrt(p^2-2p^2+2d^2))/4}}}
{{{highlight_green(w=(p+- sqrt(2d^2-p^2))/4)}}}-----this is just for w.


What about the other dimension, L?
... w=(p-2L)/2;
{{{(p-2L)^2/4+L^2=d^2}}} when substituted into the diagonal equation.
{{{(p-2L)^2+4L^2=4d^2}}}
{{{p^2-4pL+4L^2+4L^2=d^2}}}
{{{p^2-4pL+8L^2-d^2=0}}}
{{{8L^2-4pL+p^2-d^2=0}}}
General Solution,
{{{L=(4p+- sqrt(16p^2-4*8(p^2-d^2)))/16}}}
{{{L=(4p+- sqrt(16p^2-16*2(p^2-d^2)))/16}}}
{{{L=(4p+- 4sqrt(p^2-2(p^2-d^2))/16}}}
{{{L=(p+- sqrt(p^2-2p^2+2d^2))/4}}}
{{{highlight_green(L=(p+- sqrt(2d^2-p^2))/4)}}}-----formula for L.


<b>YOU can finish this.</b>
Pay attention to both forms for w and L, since each has a PLUS form and a MINUS form.  Remember, you are looking for THE DIFFERENCE or absolute value of w and L.


Please excuse the lack of rendering in three of the steps.  Tracing the parentheses will be difficult.  The majority of readable steps should be plenty helpful.