We want to calculate the following division:
[tex]\frac{x^3+2x^2-2x+4}{x+5}[/tex]We start by dividing the leading term of the dividend by the leading term of the divisor:
[tex]\frac{x^3}{x}=x^2[/tex]Then, we multiply this result by the divisor:
[tex]x^2(x+5)=x^3+5x^2[/tex]Subtract the dividend from the obtained result:
[tex](x^3+2x^2-2x+4)-(x^3+5x^2)=-3x^2-2x+4[/tex]Then, we have:
[tex]\frac{x^{3}+2x^{2}-2x+4}{x+5}=x^2+\frac{-3x^2-2x+4}{x+5}[/tex]Since the second term can still be divided(the degree of the numerator polynomial is bigger than the degree of our divisor), we repeat the process:
[tex]\begin{gathered} \frac{-3x^2}{x}=-3x \\ \\ -3x(x+5)=-3x^2-15x \\ \\ (-3x^2-2x+4)-(-3x^2-15x)=13x+4 \\ \\ x^2+\frac{-3x^2-2x+4}{x+5}=x^2-3x+\frac{13x+4}{x+5} \\ \\ \frac{13x}{x}=13 \\ \\ 13(x+5)=13x+65 \\ \\ (13x+4)-(13x+65)=-61 \\ \\ x^2-3x+\frac{13x+4}{x+5}=x^2-3x+13-\frac{61}{x+5} \end{gathered}[/tex]And this is our result:
[tex]\frac{x^{3}+2x^{2}-2x+4}{x+5}=x^2-3x+13-\frac{61}{x+5}[/tex]