I have two polynomials:
$p \left( z \right) ={z}^{4}+2\,{z}^{3}-7\,z-5$
and
$d \left( z \right) ={z}^{2}-2\,z-13$
I need to (by hand) find two other polynomials (q(z) and r(z)) that satisfies:
$p \left( z \right) =d \left( z \right) q \left( z \right) +r \left( z \right) $ (Where r(z) has a max degree of 1)
What I've tried:
Is start with rewriting d(z)q(z) into (my Maple latex output is messing up, so I just take screenshots here)
Where $b_{1}$ and $b_{0}$ are the unknown coefficients of q(z). I know that $b_{2}=1$ since the highest degree of p(z) is $z^{4}$
Now I can say (I've colored different expressions that are related to each other):
Then:
So we can see that $b_{1}=4$
Then:
And $b_{0} = 21$
Then:
So in the end I have
$r(z)=35z+320$
and
$q(z)=b_{2}\,{z}^{2}+b_{1}\,z+b_{0}=z^{2}+4z+21$
However:
$d(z)q(z)+r(z)= \left( {z}^{2}-2\,z-13 \right) \left( {z}^{2}+4\,z+21 \right) +35\,z +320={z}^{4}+2\,{z}^{3}-59\,z+47 $
Which does not satisfy my equation.If this isn't too much of a mess, can anyone see where I went wrong?





I got $$z^4+2z^3-7z-5=z^4-2z^3-13z^2+4z^3-8z^2-52z+21z^2-42z-273+87z+268=$$ $$=(z^2-2z-13)(z^2+4z+21)+87z+268.$$