TITLE: Sum of squares of roots of a polynomial $P(x)$
QUESTION [10 upvotes]: Well, I recently proved a formula (at least, I think) to the sum of the inverse of the roots $x_{1}, x_{2}, x_{3},\ldots, x_{n} \in \mathbb{C}$, and $\neq 0$. It starts:
Let a polynomial $P(x) = a_nx^n+a_{n-1}x^{n-1}+\cdot\cdot\cdot+a_1x + a_0$ of roots $x_{1}, x_{2}, x_{3},\ldots,x_{n} \in \mathbb{C^*}$ and $a_n \neq 0$. So, $$\frac{1}{x_1} + \frac{1}{x_2} + \frac{1}{x_3}+\cdots+ \frac{1}{x_n} = -\frac{a_1}{a_0}, \qquad a_0 \neq 0.$$
Now, I am trying to prove another formula, the sum of the square of the roots, but I think it's getting pretty difficult to me.
Let $x_{1}^{2} + x_{2}^{2} + x_{3}^{2}+\cdots+x_{n}^{2}=u.$ So, if $x_1\cdot x_2\cdot x_3 \cdots x_n = (-1)^n\frac{a_0}{a_n}$, then 
$$x_1 =(-1)^n\frac{a_0}{(x_2\cdot x_3 \cdots x_n)a_n},$$ and 
$$x_1^2 =(-1)^nx_1\frac{a_0}{(x_2\cdot x_3 \cdots x_n)a_n}.$$
So, 
$$\begin{align*}
x_{1}^{2} &+ x_{2}^{2} +\cdots+x_{n}^{2}=u\\
&=(-1)^nx_1\frac{a_0}{(x_2\cdot x_3 \cdots x_n)a_n} + (-1)^nx_2\frac{a_0}{(x_1\cdot x_3 \cdots x_n)a_n} \\
&\qquad +\cdots+(-1)^nx_n\frac{a_0}{(x_1\cdot x_2 \cdots x_{n-1})a_n}.
\end{align*}$$
It can be written as 
$$(-1)^n\cdot \frac{a_0}{a_n}\left(\frac{x_1}{x_2\cdot x_3 \cdots x_n} + \frac{x_2}{x_1\cdot x_3 \cdots x_n} +\cdots+ \frac{x_n}{x_1\cdot x_2 \cdots x_{n-1}}\right) = u,$$
And I'm stuck here. That's my question. How can I write $u$ in function of the coefficients (or its impossibility)? Any help will be very appreciated. I'm young, and I do not have experience with proving things. That's all.
Thank you.

REPLY [2 votes]: Consider this:
Equate your functionto zero: $\large a_nx^n+a_{n-1}x^{n-1}+a_{n-2}x^{n-2}+...+a_1x^1+a_0x^0=0$
With Vieta's formula, we get the value

$\large x_1+x_2+x_3+...+x_n=\frac{a_{n-1}}{a_n}$

and

$\large\left(x_1x_2+x_1x_3+x_1x_4+...+x_1x_n\right)+\left(x_2x_3+x_2x_4+x_2x_5+...+x_2x_n\right)+...+\left(x_{n-1}x_{n-1}+x_{n-1}x_n\right)=\frac{a_{n-2}}{a_n}$

square both side of first formula and we get
$\large\left(x_1+x_2+x_3+x_4+...+x_n\right)^2=\left(\frac{a_{n-1}}{a_n}\right)^2$
expand and we get
$\large x_1^2+x_2^2+x_3^2+x_4^2+...+x_n^2+2\left(\left(x_1x_2+x_1x_3+x_1x_4+...+x_1x_n\right)+\left(x_2x_3+x_2x_4+x_2x_5+...+x_2x_n\right)+...+\left(x_{n-1}x_{n-1}+x_{n-1}x_n\right)\right)=\left(\frac{a_{n-1}}{a_n}\right)^2$
subtitute the second equation and we get
$\large x_1^2+x_2^2+x_3^2+x_4^2+...+x_n^2+2\left(\frac{a_{n-2}}{a_n}\right)=\left(\frac{a_{n-1}}{a_n}\right)^2$
so we get the answer
$\large x_1^2+x_2^2+x_3^2+x_4^2+...+x_n^2=\left(\frac{a_{n-1}}{a_n}\right)^2-2\left(\frac{a_{n-2}}{a_n}\right)$