Although it's natural to do the above, and I would expect someone to set it up that way, it could also be done this way:
You could write:
$\displaystyle x^4 - 2x^3 + 3x^2 - 2x + 1 \ = \ (-x^2 + ax + b)^2 \ = \ x^4 - 2ax^3 + (a^2 - 2b)x^2 + 2abx + b^2$
Equating coefficients, we obtain the system:
$\displaystyle -2a \ = \ -2 \ \implies \ a \ = \ 1$
$\displaystyle a^2 - 2b \ = \ 3 \ \implies \ b \ = \ -1$
And so we have:
$\displaystyle x^4 - 2x^3 + 3x^2 - 2x + 1 \ = \ (-x^2 + x - 1)^2$
__________________________________________________ _______________________
sbjsavio, it is not true in general that the square of an n-termed polynomial (restricting ourselves to one variable for this discussion)
has 2n terms (when the like terms have been combined).
Look at these counterexamples:
$\displaystyle (x)^2 \ = \ x^2$
$\displaystyle (x + 1)^2 \ = \ x^2 + 2x + 1$
$\displaystyle (x^2 + 4x - 8)^2 \ = \ x^4 + 8x^3 - 64x + 64$
__________________________________________________ ________
Also, there is a square root algorithm for polynomials that someone gives as an example here:
https://math.stackexchange.com/quest...f-a-polynomial