Skip to main content
Logo image

Section 9.7 Dividing Polynomials

Dividing polynomials is known in MATLAB as deconvolving.
Suppose you wanted to divide the polynomial \(p_1(x) = 2x^3 + 9x^2 + 7x -6\) by the polynomial \(p_2(x) = x+3\text{.}\) Do you remember how to do such a polynomial division by hand?
Don’t worry, MATLAB can do all of this for you. Here is how:
>> p1 = [2 9 7 -6];
>> p2 = [1 3];
>> [q r] = deconv(p1, p2)
q =
    2   3  -2
r =
    0   0   0   0
The deconv function returns two arguments: \(q\) is a row vector of coefficients of the polynomial that results from the division and \(r\) is a row vector of coefficients of the polynomial remainder (in the above example there is no remainder).

Activity 9.7.

Divide the polynomial
\begin{equation*} p_1(x) = x^4 - 6x^3 + 13x^2 - 12x + 4 \end{equation*}
by the polynomial
\begin{equation*} p_2(x) = x^3 - 3x^2 + 2 \end{equation*}
using MATLAB. Write out the solution as polynomial and remainder.
Please put the solution (polynomial and remainder) into the textbox.