Polynomial Division Polynomial Division

Introduction

We want to integrate the following:

\int \frac{x^3 + 2x^2 - x + 4}{x+1} \, dx
It is a messy integral, but we can simplify it using polynomial long division. polynomials instead of numbers.

We will divide the numerator by the denominator, resulting in a quotient and remainder.
\begin{array}{r} x\phantom{^2}+4\phantom{x+3)} \\ x-2{\overline{\smash{\big)}\,x^2+2x+3\phantom{)}}}\\ \underline{-~\phantom{(}(x^2-2x)\phantom{-3}}\\ 0+4x+3\phantom{)}\\ \underline{-~\phantom{()}(4x-8)}\\ 0+11\phantom{)} \end{array}
\frac{x^2 + 2x + 3}{x-2} = x + 4 + \frac{11}{x-2}

Example #1

\begin{array}{r} x+1\overline{\smash{\big)}\,x^3 + 2x^2 - x + 4} \end{array}
Divide the highest term of the numerator by the highest term of the denominator.
\begin{array}{r} x^2 \phantom{+ 2x^2 - x + 4} \\ x+1\overline{\smash{\big)}\,x^3 + 2x^2 - x + 4} \\ \phantom{x}-\phantom{1\smash{\big)}\,}\underline{x^3 + \phantom{1}x^2} \phantom{-x + 4} \\ x^2 - x + 4 \end{array}
Repeat.
\begin{array}{r} x^2 + \phantom{2}x\phantom{^2 - x + 4} \\ x+1\overline{\smash{\big)}\,x^3 + 2x^2 - x + 4} \\ \phantom{x}-\phantom{1\smash{\big)}\,}\underline{x^3 + \phantom{1}x^2} \phantom{-x + 4} \\ x^2 - x + 4 \\ \phantom{x}-\phantom{1\smash{\big)}\,}\underline{x^2+x} \phantom{+ 4} \\ -2x+4 \end{array}
Repeat.
\begin{array}{r} x^2 + \phantom{2}x\phantom{^2} - 2 \phantom{+ 4} \\ x+1\overline{\smash{\big)}\,x^3 + 2x^2 - x + 4} \\ \phantom{x}-\phantom{1\smash{\big)}\,}\underline{x^3 + \phantom{1}x^2} \phantom{-x + 4} \\ x^2 - x + 4 \\ \phantom{x}-\phantom{1\smash{\big)}\,}\underline{x^2+x} \phantom{+ 4} \\ -2x+4 \\ \phantom{x}-\phantom{1\smash{\big)}\,}\underline{-2x-2} \\ 6 \end{array}
The
6
is not divisible by
x+1
, so it is the remainder.
\begin{align*} \int \frac{x^3 + 2x^2 - x + 4}{x+1} \, dx &= \int {x^2 + x - 2 + \frac{6}{x+1} } \, dx \\\\ &= \frac{x^3}{3} + \frac{x^2}{2} - 2x + 6\ln|x+1| + C \end{align*}

Example #2

\int \frac{3x^4 - 2x^2 + 5x + 1}{x - 3} \, dx

\begin{array}{r} x-3\overline{\smash{\big)}\,3x^4 - 2x^2 + 5x + 1} \end{array}
Divide the highest term of the numerator by the highest term of the denominator.
\begin{array}{r} 3x^3 \phantom{-9x^3+ 2x^2 + 5x + 1} \\ x-3\overline{\smash{\big)}\,3x^4 \phantom{-9x^3}-2x^2 + 5x + 1} \\ \phantom{x}-\phantom{1\smash{\big)}\,}\underline{3x^4 - 9x^3} \phantom{+2x^2 + 5x + 1} \\ 9x^3 - 2x^2 + 5x + 1 \end{array}
Repeat.
\begin{array}{r} 3x^3+9x^2 \phantom{-22x^2 + 5x + 1} \\ x-3\overline{\smash{\big)}\,3x^4 \phantom{-9x^3}-\phantom{2}2x^2 + 5x + 1} \\ \phantom{x}-\phantom{1\smash{\big)}\,}\underline{3x^4 - 9x^3} \phantom{+22x^2 + 5x + 1} \\ 9x^3 - \phantom{2}2x^2 + 5x + 1 \\ \phantom{x}-\phantom{1\smash{\big)}\,}\underline{9x^3 - 27x^2} \phantom{+5x + 1} \\ 25x^2 + 5x + 1 \end{array}
Repeat.
\begin{array}{r} 3x^3+9x^2 +25x \phantom{^2 + 55x + 1} \\ x-3\overline{\smash{\big)}\,3x^4 \phantom{-9x^3}-\phantom{2}2x^2 + \phantom{5}5x + 1} \\ \phantom{x}-\phantom{1\smash{\big)}\,}\underline{3x^4 - 9x^3} \phantom{+22x^2 + 55x + 1} \\ 9x^3 - \phantom{2}2x^2 + \phantom{5}5x + 1 \\ \phantom{x}-\phantom{1\smash{\big)}\,}\underline{9x^3 - 27x^2} \phantom{+55x + 1} \\ 25x^2 + \phantom{5}5x + 1 \\ \phantom{x}-\phantom{1\smash{\big)}\,}\underline{25x^2 - 75x}\phantom{+ 1} \\ 80x + 1 \end{array}
Repeat.
\begin{array}{r} 3x^3+9x^2 +25x \phantom{^2} + \phantom{x}80 \phantom{+ 271} \\ x-3\overline{\smash{\big)}\,3x^4 \phantom{-9x^3}-\phantom{2}2x^2 + \phantom{5}5x + \phantom{27}1} \\ \phantom{x}-\phantom{1\smash{\big)}\,}\underline{3x^4 - 9x^3} \phantom{+22x^2 + 55x + 271} \\ 9x^3 - \phantom{2}2x^2 + \phantom{5}5x + \phantom{27}1 \\ \phantom{x}-\phantom{1\smash{\big)}\,}\underline{9x^3 - 27x^2} \phantom{+55x + 271} \\ 25x^2 + \phantom{5}5x + \phantom{27}1 \\ \phantom{x}-\phantom{1\smash{\big)}\,}\underline{25x^2 - 75x}\phantom{+ 271} \\ 80x + \phantom{27}1 \\ \phantom{x}-\phantom{1\smash{\big)}\,}\underline{80x-240} \\ 241 \end{array}
The
241
is not divisible by
x-3
, so it is the remainder.
\begin{align*} \int \frac{3x^4 - 2x^2 + 5x + 1}{x - 3} \, dx &= \int {3x^3 + 9x^2 + 25x + 80 + \frac{241}{x-3} } \, dx \\ &= \frac{3x^4}{4} + 3x^3 + \frac{25x^2}{2} + 80x + 241\ln|x-3| + C \end{align*}