Geometry problem inspired by Babylonian tablets (positive matrix factorization) Consider the following problem: given positive real numbers $a,b,c>0$, find positive real numbers $x,y,z,w >0$ such that
$$x^2+y^2 =a$$
$$z^2+w^2=c$$
and
$$xz+wy=b$$
This has an obvious geometric interpretation: the sum of the areas of two squares is known as $a$, the sum of the areas of two other squares is know, and the area of the rectangles formed by one side of the first square and one side from third plus the area of one side of the second square and one side of the fourth square is known as $b$. Can we find these sides? Here is an example, $(a,b,c)=(3,5,11)$ is solved with $(x,y,z,w)=(1, \sqrt{2}, 3, \sqrt{2}).$ This was inspired by geometric presentations of problems on BM 013901, but they are simpler, like to find positive $x,y$ such that $x^2+y^2=a$ and $x+y=c$ and IM 052304 is a list of problems by their first line and has ones like “I sum areas of 4 square sides”, etc.
It seems like this should be solvable with elementary methods but I am at a loss. I tried to look at numerical examples to get a feel for any methods that might be generalizable. All I’ve tried so far is, you can solve for, say, $y$ in the third equation and substitute this into the first, do some simplification and you’ll get a quadratic equation in $x$ with coefficients depending on $w,z,b,a$.
Also, rephrased in linear algebra this is equivalent finding positive entry-wise $B$ such that $A=BB^T$ where $A$ is symmetric, positive entrywise, and PSD, and where both are $2\times 2$ matrices. I’ve seen on mathoverflow and various papers on arxiv that this decomposition fails, in general, for $5\times 5$ matrices with positive entry-wise replaced nonnegative entry-wise. But I can’t seem to find explicit decomposition methods for $n< 5$. From what I’ve seen, if you can write each entry as an inner product of linear dependent vectors then you can rotate them into the positive orthant of the plane. But I don’t see how find such vectors in general for this $2\times 2$ case. Apologies if this is elementary, my linear algebra is not my forte.
 A: quite a mess. Given positive definite quadratic form $a x^2 \pm 2bxy + c y^2 $  so that $ac>b^2,$  take $r > 0,$   with
$$ 0  < r <  \min \left( \frac{b}{a}, \frac{c}{b}  \right) $$
Then define $$  p = \frac{c-br}{b-ar}  $$
We see that $p > 0.$   It follows from $a r^2 - 2 b r + c > 0$ that $p > r > 0. $
$$
\left(
\begin{array}{rr}
p&-1 \\
-r&1 \\
\end{array}
\right)
\left(
\begin{array}{rr}
a&b \\
b&c \\
\end{array}
\right)
\left(
\begin{array}{rr}
p&-r \\
-1&1 \\
\end{array}
\right) =
\left(
\begin{array}{cc}
ap^2-2bp+c&0 \\
0&ar^2-2br+c \\
\end{array}
\right)
$$
Alright, the determinant of  $ \left(
\begin{array}{rr}
p&-r \\
-1&1 \\
\end{array}
\right)  $ is $p-r>0$   and its inverse is
$ \frac{1}{p-r}\left(
\begin{array}{rr}
1&r \\
1&p \\
\end{array}
\right)  $
with all positive elements
$$
\frac{1}{(p-r)^2}
\left(
\begin{array}{rr}
1&1 \\
r&p \\
\end{array}
\right)
\left(
\begin{array}{cc}
ap^2-2bp+c&0 \\
0&ar^2-2br+c \\
\end{array}
\right)
\left(
\begin{array}{rr}
1&r \\
1&p \\
\end{array}
\right) =
\left(
\begin{array}{rr}
a&b \\
b&c \\
\end{array}
\right)
$$
LATER:  I forgot this; the diagonal matrix
$D= \left(
\begin{array}{cc}
ap^2-2bp+c&0 \\
0&ar^2-2br+c \\
\end{array}
\right)  $   has a real  diagonal square root  by simply taking the (positive) square roots of the diagonal elements. Call that matrix $E$,  so that $EE = E^T E = D$  If we now name $W =   \frac{1}{p-r} E\left(
\begin{array}{rr}
1&r \\
1&p \\
\end{array}
\right)  $ which has positive elements, we see
$$  W^T \; W = \left(
\begin{array}{rr}
a&b \\
b&c \\
\end{array}
\right)  $$
A: From a different angle, let $\,u=x + iy\,$, $\,v=w + iz\,$, then the equations are $\,|u|^2=a\,$, $\,|v|^2 = c\,$, $\,\text{Im}(uv) = b\,$. The latter can be written as $\,u v - \bar u \bar v = 2ib\,$, and substituting $\,\bar u = |u|^2 / u\,$, $\,\bar v = |v|^2 / v\,$ gives the quadratic $\,u^2v^2 - 2ib\,uv - ac = 0\,$ with roots $\,uv = \pm \sqrt{ac - b^2} + i b\,$,  where the reduced discriminant $\,ac-b^2 = \left(\text{Re}(uv)\right)^2 \ge 0\,$.
The solution set of the system is therefore $\,\left\{(u,v) \;\Big|\; |u| = \sqrt{a}\,, v = \left(\pm\sqrt{ac - b^2} + i b\right) / u \right\}\,$.
For positive solutions, the problem is now to determine the arc of the circle $\,|u| = \sqrt{a}\,$ in the first quadrant which maps to the first quadrant via the inversion $\,u \mapsto v = \left(\pm\sqrt{ac - b^2} + i b\right)/ u\,$.
$$
\require{cancel}
\begin{align}
v &= \frac{\pm\sqrt{ac - b^2} + i b}{x + iy} \cdot \frac{x-iy}{x-iy}
\\ &= \frac{\pm \sqrt{ac-b^2}\, x + b\,y + i \left(b\, x \mp \sqrt{ac-b^2}\, y\right)}{x^2+y^2}
\end{align}
$$

*

*For the $\,+\,$ choice of signs the real part is always positive, and the condition for the imaginary part to be positive is $\;b\, x \ge \sqrt{ac-b^2}\, y\,$ $\,\iff b^2\bcancel{(x^2+y^2)} \ge \bcancel{a}c y^2\,$ $\,\iff y \le \dfrac{b}{\sqrt{c}}\,$.


*For the $\,-\,$ choice of signs the imaginary part is always positive, and the condition for the real part to be positive is $\;b\, y \ge \sqrt{ac-b^2}\, x\,$ $\,\iff b^2\bcancel{(x^2+y^2)} \ge \bcancel{a}c x^2\,$ $\,\iff x \le \dfrac{b}{\sqrt{c}}\,$.
