# Bilinear system of Diophantine Equations

$\forall i,j \in$ $\{$$1, \cdots,n$$\},$ let $x_{i},y_{i}$ be unknowns and $n_{ij} \in \mathbb{Z}$ with $i \le j$ be the knowns.

Consider the following $\frac{n(n+1)}{2}$ with $n > 2$ overdetermined bilinear equations:

$\sum_{\substack{j=1,}{j \ne i}}^{n} x_{j}y_{j} = -n_{ii} + x_{i}y_{i} \in \mathbb{Z}$.

$x_{i}y_{j} + x_{j}y_{i} = n_{ij} \in \mathbb{Z}$ when $i < j$.

When is the system solvable and when is it solvable over $\mathbb{Z}$?

-
Let's first focus on the equations: $$\sum_{j=1, j\ne i}^n x_j y_j = -n_{ii} + x_i y_i.$$ Denoting $s = \sum_{j=1}^n x_j y_j$, we have $$2x_iy_i = n_{ii} + s.$$ Summing up over $i=1,2,\dots,n$, we get $$2s = \sum_{i=1}^n n_{ii} + n\cdot s.$$ implying that (for $n\ne 2$) $$s = \frac{-1}{n-2} \sum_{i=1}^n n_{ii},$$ Therefore, $$x_i y_i = n_{ii} - \frac{1}{n-2} \sum_{i=1}^n n_{ii}.$$
Now, the equation $$x_i y_j + x_j y_i = n_{ij}$$ multiplied by $2 x_i x_j$ turns into $$(n_{jj} + s) x_i^2 + (n_{ii} + s) x_j^2 = 2 n_{ij} x_i x_j.$$ Plugging in $j=1$ and dividing by $x_1^2$, we further have $$(n_{11} + s) z_i^2 - 2 n_{i1} z_i + (n_{ii} + s) = 0$$ which is a quadratic equation w.r.t. $z_i = x_i / x_1$ and can be easily solved.
Values of $y_i$ can be found similarly.