So i was learning complex numbers and i came across this problem. In the solution they have made $z-4=i\sqrt{7}$ and then they squared the above equation resulting in $z^2 -8z+16=-7$ then they proceeded by sending $-7$ to the LHS resulting in $z^2 -8z+23=0$.
They then divided the original cubic term by the resulting equation from the above steps to get answer as $-1$. I did not understand why did they do it and how they got $-1$. The final equation looked like this: $z^3 -4z^2 -9z + 91=(z^2 -8z+23)(z+4)-1=-1$.
I personally think they used the $x=nq+r$ where $x$ is divided by $n$ resulting in $q$ as the quotient and $r$ as the remainder. If so then can all the problems like this be solved in the same manner?
You surely get $(z-4)^2=-7$, which indeed expands to $z^2-8z+23=0$.
Then you can do the long division of $z^3-4z^2-9z+91$ by $z^2-8z+23$, which yields a quotient $z+4$ and remainder $-1$; therefore, for any value of $z$, you have $$ z^3-4z^2-9z+91=(z^2-8z+23)(z+4)-1 $$ If you substitute the given $z$, then you get $$ 0(4+i\sqrt{7}+4)-1=-1 $$
Yes, problems of this kind can be treated in this way; if $w$ is any complex number and $g(z)$ is a polynomial such that $g(w)=0$, then for every polynomial $f(z)$ one has $$ f(z)=q(z)g(z)+r(z) $$ where the degree of $r$ is less than the degree of $g$, so $$ f(w)=q(w)g(w)+r(w)=r(w) $$ and the computation of $r(w)$ is easier.