<s>[INST] Solving multivariate quadratic equations over the integers I am looking for a method (if it exists) to solve over the integers the following sum of squares equation:
$$ x_1^2 + x_2^2+x_3^2 + \cdots + x_n^2 = m,$$ with $m \in \mathbb{N}.$
Someone has any idea about books, articles dealing with this kind of problem?
Thanks in advance!
 [/INST] If $m\in\mathbb{N}$, then $x_n\in\mathbb{N}$ meaning that any $x$-values will work. If $m$ is a perfect square, the are also infinite solutions because the Pythagorean theorem works for any number of dimensions.
For every Pythagorean triple, there is a Pythagorean quadruple where $C$ of the triple is replaced by $(A,B)$ of some other triple, and the pattern continues indefinitely. To explain, let's use a backwards example. In the triple
$(5,12,13),$ we can replace $5$, with $(3,4)$ because $3^2+4^2=5^2 \implies 3^2+4^2+12^2=13^2.$
To find triples in the forward direction, we need only consider that there is a side A for ever odd number greater than $1$. If we define Euclid's formula as
$ \quad A=m^2-k^2\quad B=2mk \quad C=m^2+k^2\quad$  we can solve the $C$-function for $k$ and find that any $m$-value that yields an integer $k$ provides the $(m,k)$ needed for a Pythagorean triple.
Here is how an $A=5$ triple is found to replace the $C$-value in $(3,4,5)$
\begin{equation}
A=m^2-k^2\implies k=\sqrt{m^2-A}\\
\text{for}\qquad  \lfloor\sqrt{A+1}\rfloor \le m \le \frac{A+1}{2}
\end{equation}
The lower limit ensures $k\in\mathbb{N}$ and the upper limit ensures $m> k$.
$$A=5\implies \lfloor\sqrt{5+1}\rfloor=2\le m \le \frac{5+1}{2} =3\\
\land
\quad m\in\{3\}\implies k \in\{2\} $$
$$F(3,2)=(5,12,13)$$
A similar process will find triples for $A=13$ and so on indefinitely to form n-tuples such as where
$$3^2+4^2+12^2+84^2+132^2+12324^2+6900^2+1428^2=14197^2\\
\text{ or }\quad 
15^2+8^2+144^2+404^2+93744^2=93745^2$$
</s>