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 $$\frac {P_n \left({x}\right)} {Q_m \left({x}\right)}$$:
 * $$\frac {P_n \left({x}\right)} {Q_m \left({x}\right)} = D_{n-m} \left({x}\right) + \frac {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 $$P_n \left({x}\right) = \sum_{j=0}^n p_j x^j$$.

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

First calculate $$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:


 * $$P_n \left({x}\right) - Q'_m \left({x}\right) = \sum_{j=n-m}^{n-1} \frac {p_n q_{j-n+m}} {q_m} x^j + \sum_{j=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 $$\frac {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 $$\sum_{j=0}^{n-1} p'_j x^j$$.

Repeat the above by subtracting $$\frac {p'_{n-1}} {q_m} x^{n-m-1} Q_m \left({x}\right)$$ from $$P'_{n-1} \left({x}\right)$$, and letting $$\frac {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:


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


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