If x + (1/x) = a

Find these in terms of a:

x^2 + (1/x^2) and x^3 + (1/x^3)

I got a^2 and a^3 as my answers, but the book says a^2 - 2 and a^3 - 3a.

How did they get that?

(x + 1/x)^2 = x^2 + 2 + 1/x^2

so,
x^2 + 1/x^2 = a^2-2

(x + 1/x)^3 = x^3 + 3x + 3/x + 1/x^3
so,
x^3 + 1/x^3 = a^3 - 3(x + 1/x) = a^3-3a