To cut a line in two so that the squares of ... (geometric construction) 
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.

Let the segment lengths be $(x,L-x)$ for total length $L.$
Total area
$$ A=x^2+2(L-x)^2= 3x^2-4xL+2L^2 \tag 1 $$
should be a constant or minimum / maximum when segmented at some $x$.
Differentiating to find location of partition,
$$ 6x-4L=0, x=\dfrac{2L}{3} \to A_{min}= \dfrac{2L^2}{3};$$
which is a function of $L.$ It is easy to divide a line length  L =  OB into three equal parts. (A line drawn through any one end parallel lines from three equal segments as shown, take line trisected through D).

However in this problem the minimum is a priori specified to have  a given size =S, but not derivative driven $2 L^2/3$ minimum.  This is not possible without any modification of area expression in (1) accordingly, like in ..
$$  A=x^2+2(L-x)^2- \dfrac{2L^2}{3} +S  \tag2 $$
A numerical example for $ L=100, S=10000 $ gives desired area $=S$ at the calculated two thirds length.
Geometric construction for physical Area Check
Total area $ S= 10,000$ square units is fully accounted for as one square of $2L/3$ side and another five of $L/3$ side in rough sketch.


