Factorize the polynomial $P(z) = z^4 - 2z^3-z^2+2z+10$, into linear and/or quadratic factors with real coefficients $2+i$ is given to be one of the roots of the polynomial.
I am doing this as a practice for exam prep.
Since $2+i$, is a root, then $(z-2-i)$ is a factor?
So I have:
$(z-2-i)(z^3-Az^2-Bz+C) = z^4-2z^3-z^2+2z+10$
Then, I group the $z$ terms of the same degrees after I multiply out?
Am I on the right track? Because it seems like this will take quite a while in exam conditions? Thanks for any direction!
 A: As Thomas has said, if $2+i$ is a root then $2-i$ is also root. Hence you have two factors: $z-(2-i)$ and $z-(2+i)$ whose product is $z^2-4z+5$. So we can can assume that there is another quadratic factor $z^2+bz+c$ where $b$ and $c$ are constants to be determined. Obviously their product should yield the given polynomial. Thus,
$$(z^2-4z+5)(z^2+bz+c)= z^4-2z^3-z^2+2z+10.$$
Equating the constant terms you obtain $5c=10$ which gives $c=2$.
Now equating the coefficients of $z$, we obtain the equation;
$$-4c+5b=2 $$ from which we obtain $b=2$. Replacing $b$ and $c$ we now solve for $z$ in the equation  $$z^2+2z+2=0$$ as follows:
$$(z+1)^2+1=0.$$ Thus, $z+1=i$ and $z+1=-i$, which gives $z=-1+i,z=-1-i$.
Hence we have obtained all the factors.
A: I suggest using both of Chris's and Thomas's ideas from the comments.  Nonreal roots of polynomials with real coefficients come in complex conjugate pairs, so $2-i$ is also a root. This means that $z-(2-i)=z-2+i$ is also a factor.  Combining with the factor you named, since they are distinct, their product is a factor, $(z-2-i)(z-2+i)=z^2-4z+5$.  
You can then either set up an equation like you had, multiply out and match coefficients, or, perhaps more efficiently, perform standard polynomial long division to find $A$ and $B$ in the equation $(z^2-4z+5)(z^2+Az+B)=z^4-2z^3-z^2+2z+10$.  
All that remains is to factor the other quadratic factor, and you can do this with the aid of the quadratic formula or completing the square to find its zeros.  On the other hand, if it turns out that the other quadratic factor also has no real roots (which can also be see from the quadratic formula or by completing the square), then you're already done.

Multiplying out and matching coefficients actually is pretty efficient in this case (as now seen in smanoos's answer), but I can think of two good reasons to use long division.   First is its simplicity and generality; especially in exam conditions, it's good to have one tool that can always be applied to such problems in as straightforward a manner as possible.  Second, it double checks your work for you, because the remainder has to be $0$ when dividing by a factor.
A: Since the question has the "calculus" tag, letus use a slightly different method. We start with $$(z^2-4z+5)(z^2+bz+c)= z^4-2z^3-z^2+2z+10.$$ as smanoos does. When we plug zero int both sides, we get $5c=10$, so $c=2$. This gives us the equation, 
$$(z^2-4z+5)(z^2+bz+2)= z^4-2z^3-z^2+2z+10.$$. Now letus take the derivative of both sides to get,
$$(2z-4)(z^2+bz+2)+(z^2-4z+5)(2z+b)=4z^3-6z^2-2z+2$$. Setting $z=0$ gives,
$$-8+5b=2$$, thus $b=2$.
So we factored the polynomial as $(z^2-4z+5)(z^2+2z+2)$, but then we know how $(z^2+2z+2)$ factors, and we must factor $(z^2+2z+2)$, but for that we will refer to the earlier answers.
