Polynomial Long Division

Technique
Let $P_n \left({x}\right)$ be a polynomial in $x$ of degree $n$.

Let $Q_m \left({x}\right)$ be a polynomial in $x$ of degree $m$ where $m \le n$.

Then $P_n \left({x}\right)$ can be expressed in the form:


 * $P_n \left({x}\right) \equiv Q_m \left({x}\right) D_{n-m} \left({x}\right) + R_k \left({x}\right)$

where:
 * $D_{n-m} \left({x}\right)$ is a polynomial in $x$ of degree $n-m$;


 * $R_{k} \left({x}\right)$ is a polynomial in $x$ of degree $k$, where $k < m$, or may be null.

Hence we can define $\dfrac {P_n \left({x}\right)} {Q_m \left({x}\right)}$:
 * $\dfrac {P_n \left({x}\right)} {Q_m \left({x}\right)} = D_{n-m} \left({x}\right) + \dfrac {R_k \left({x}\right)} {Q_m \left({x}\right)}$

The polynomial $R_{k} \left({x}\right)$ is called the remainder.

The procedure for working out what $D_{n-m} \left({x}\right)$ and $R_{k} \left({x}\right)$ are is called (polynomial) long division.

Proof
Let $\displaystyle P_n \left({x}\right) = \sum_{j \mathop = 0}^n p_j x^j$.

Let $\displaystyle Q_m \left({x}\right) = \sum_{j \mathop = 0}^m q_j x^j$.

First calculate $\displaystyle Q'_m \left({x}\right) = Q_m \left({x}\right) \times \frac {p_n} {q_m} x^{n-m}$.

This gives:

Then evaluate $P'_{n-1} \left({x}\right) = P_n \left({x}\right) - Q'_m \left({x}\right)$, which (after some algebra) works out as:


 * $\displaystyle P_n \left({x}\right) - Q'_m \left({x}\right) = \sum_{j \mathop = n-m}^{n-1} \frac {p_n q_{j-n+m}} {q_m} x^j + \sum_{j \mathop = 0}^{n-m-1} p_j x^j$

So we see that $P_n \left({x}\right) - Q'_m \left({x}\right)$ is a polynomial in $x$ of degree $n-1$.

Let $\dfrac {p_n} {q_m} = d_{n-m}$.

Hence we have $P_n \left({x}\right) = d_{n-m} x^{n-m} Q_m \left({x}\right) + P'_{n-1} \left({x}\right)$.

We can express $P'_{n-1} \left({x}\right)$ as $\displaystyle \sum_{j \mathop = 0}^{n-1} p'_j x^j$.

Repeat the above by subtracting $\displaystyle \frac {p'_{n-1}} {q_m} x^{n-m-1} Q_m \left({x}\right)$ from $P'_{n-1} \left({x}\right)$, and letting $\dfrac {p'_{n-1}} {q_m} = d_{n-m-1}$.

Hence $P'_{n-1} \left({x}\right) = d_{n-m-1} x^{n-m-1} Q_m \left({x}\right) + P''_{n-2} \left({x}\right)$.

The process can be repeated $n-m$ times.

It can be seen that after the last stage, we have:
 * $P_n \left({x}\right) = D_{n-m} \left({x}\right) Q_m \left({x}\right) + R_k \left({x}\right)$

where:


 * $\displaystyle D_{n-m} \left({x}\right) = \sum_{j \mathop = 0}^{n-m} d_j x^j$;


 * $R_k \left({x}\right)$ is a polynomial of degree at most $m-1$.