Cut a given straight line so that the sum of the square of one part and twice the square of the other part equals a given size.
Given a line of length $L$ which is cut in two pieces, lengths $x$ and $L-x$, I first thought of constructing the squares with sides $x$ and $\sqrt{2}(L-x)$ but I cannot relate the total area to a given length.
If $M$ is the given length the length to construct is $$\frac{2L\pm\sqrt{3M-2L^2}}{3}$$ but I assume there is an easier way to solve this problem using only straight-edge and compass.
Any idea how to solve this problem? TIA.



Given the square of one part plus twice the square of the other part equals the whole.
$$L=(x)^2+2(L-x)^2=2 L^2 - 4 L x + 3 x^2\\ \implies 3 x^2 - 4 L x + (2 L^2 - L) = 0$$
$$x=\frac{4L\pm\sqrt{16L^2-4(3)(2 L^2 - L)}}{2(3)} =\frac{2L\pm \sqrt{L(3 - 2 L)}}{3}\quad x\in\mathbb{R}\iff 0\le L\le \frac{3}{2}$$
Any value of $L$ in this range will work but the only (L,x) solutions that "contain" integers are $$ (0,\space0)\qquad (1,\space1)\qquad (3/2,\space1)$$
So $$0^2+2(0-0)^2=0\qquad 1^2+2(1-1)^2=1\qquad 1^2+2(1.5-1)^2=1+2(.25)=1.5$$
Outside of this range, solutions are complex (containing imaginary parts), i.e. $x\in\mathbb{C}$
$\textbf{Update}$ WolframAlpha shows the solution to be different from mine where I stayed in the limits.
$$(x)^2+2(L-x)^2-L=0,\quad L=414\\ \implies x = 276 + 5 i \sqrt{1518}\qquad L-x=138 + 5 i \sqrt{1518}$$
Multiplied back, it yields an enormous number for $L$, even with plus-minus the imaginary part here, and here.