Expressing $x_{1} ^ n + x_{2}^ n$, where $x_{1}$ and $x_{2}$ are the roots of $ax^2 +bx+c=0$

SymmetricReduction is a good tool for this:

First @ SymmetricReduction[x1^2+x2^2,{x1,x2}, {-b/a, c/a}]
First @ SymmetricReduction[x1^3+x2^3,{x1,x2}, {-b/a, c/a}]
First @ SymmetricReduction[x1^4+x2^4,{x1,x2}, {-b/a, c/a}]
b^2/a^2-(2 c)/a
-(b^3/a^3)+(3 b c)/a^2
b^4/a^4-(4 b^2 c)/a^3+(2 c^2)/a^2

Recalling the relationship between sums of powers and linear recurrence relations, here is how one can use LinearRecurrence[] to generate the required expressions:

LinearRecurrence[{-b/a, -c/a}, {2, -b/a}, 5] // Simplify
   {2, -b/a, (b^2 - 2 a c)/a^2, -(b^3 - 3 a b c)/a^3, (b^4 - 4 a b^2 c + 2 a^2 c^2)/a^4}

Using Inactivate[] on the symmetric polynomials involved yields the expressions for the power sums in terms of symmetric polynomials of the roots:

LinearRecurrence[{Inactivate[x1 + x2], -Inactivate[x1 x2]},
                 {2, Inactivate[x1 + x2]}, 5] // Simplify // Activate

   {2, x1 + x2, -2 x1 x2 + (x1 + x2)^2, -3 x1 x2 (x1 + x2) + (x1 + x2)^3,
    2 x1^2 x2^2 - 4 x1 x2 (x1 + x2)^2 + (x1 + x2)^4}

Carl has already mentioned SymmetricReduction[] and its convenient third argument, if you're looking to explicitly display the Newton-Girard formulae. If you'll look at that last link, you'll see that a nice linear equation is satisfied between power sums and symmetric polynomials; you might want to try formulating this in terms of LinearSolve[].


One can obtan this as the solution to a certain recurrence equation. Call the nth term f[n], and the roots x1 and x2. Then

f[n] = (x1+x2)^n =
(x1+x2)*(x1^(n-1)+x2^(n-1)) - (x1*x2^(n-1)+x2*x1^(n-1)) =
(x1+x2)*(x1^(n-1)+x2^(n-1)) - x1*x2*(x1^(n-2)+x2^(n-2)) =
f[1]*f[n-1] - x1*x2*f[n-2]

Now suppose we make the quadratic monic, so it is x^2-b*x+c (the negative for the linear term coefficient is from expanding (x-x1)*(x-x2) and getting x^2-(x+x2)*x+x1*x2). With this convention, we have f[1]==b and we also require that f[0]==2 (which is the sum of the roots to the zeroth power).

rtpowersums = 
 RSolveValue[{f[n] == b*f[n - 1] - c*f[n - 2], f[1] == b, f[0] == 2}, 
  f[n], n]

(* Out[213]= 2^-n ((b - Sqrt[b^2 - 4 c])^n + (b + Sqrt[b^2 - 4 c])^n) *)

Quick test for case where roots are 2 and 3:

tt = Table[Expand[rtpowersums], {n, 1, 5}]
tt /. {b -> 5, c -> 6}

(* Out[214]= {b, b^2 - 2 c, b^3 - 3 b c, b^4 - 4 b^2 c + 2 c^2, 
 b^5 - 5 b^3 c + 5 b c^2}

Out[215]= {5, 13, 35, 97, 275} *)

Table[2^n + 3^n, {n, 5}]

(* Out[216]= {5, 13, 35, 97, 275} *)