Tutorials › Linear Algebra › Matrix of Differentiation on Polynomial Spaces

Matrix Representations of Linear Maps · Tutorial 435 of 1000

Matrix of Differentiation on Polynomial Spaces

Learn to build the rectangular matrix of differentiation in monomial bases and use it to compute and check derivatives from coefficient vectors.

Intermediate 9 min read

What You'll Learn

  • Identify the monomial bases for the domain and codomain polynomial spaces
  • Determine the dimensions and shape of the differentiation matrix
  • Compute each matrix column from the derivative of a basis polynomial
  • Apply the matrix to a polynomial’s coefficient vector
  • Verify a matrix result by differentiating the polynomial directly
  • Prove that the derivative is zero exactly for constant polynomials

Differentiation as a Linear Map

A polynomial is often recorded by its coefficients, in a fixed order. Differentiating it changes those coefficients: the constant term disappears, while the coefficient of each positive power is multiplied by its exponent and shifts to the preceding power. A matrix makes this change precise. The key is to specify the bases in both the domain and codomain, because their order determines how each polynomial is represented by a coordinate vector.

Throughout, let \(n\geq 1\) be an integer, and work over \(\mathbb{R}\). Let \(P_n\) denote the vector space of real polynomials of degree at most \(n\), including the zero polynomial, and let \(P_{n-1}\) denote the polynomials of degree at most \(n-1\). Use the monomial bases in ascending order of powers: \(\mathcal{B}=(1,x,x^2,\dots,x^n)\) for \(P_n\) and \(\mathcal{C}=(1,x,x^2,\dots,x^{n-1})\) for \(P_{n-1}\). Thus, if \(p(x)=a_0+a_1x+\cdots+a_nx^n\), its coordinate vector in \(\mathcal{B}\) is \([p]_{\mathcal{B}}=(a_0,a_1,\dots,a_n)^{\top}\).

Definition: The differentiation map \(D:P_n\to P_{n-1}\) is defined by \(D(p)=p'\), the ordinary derivative of \(p\). It is well-defined because differentiating a polynomial of degree at most \(n\) gives either the zero polynomial or a polynomial of degree at most \(n-1\). Its matrix from the domain basis \(\mathcal{B}\) to the codomain basis \(\mathcal{C}\), written \([D]_{\mathcal{C}\leftarrow\mathcal{B}}\), is the matrix whose \(j\)th column is the coordinate vector \([D(b_j)]_{\mathcal{C}}\) of the derivative of the \(j\)th domain basis vector.

The order of the two bases determines the shape. The domain basis has \(n+1\) vectors, so the matrix has \(n+1\) columns. The codomain basis has \(n\) vectors, so it has \(n\) rows. This matrix is rectangular: differentiation lowers the maximum degree by one, and its input and output coefficient vectors have different lengths.

Building the Matrix One Column at a Time

The first column comes from differentiating \(1\), which gives zero. For the next column, \(D(x)=1\), so its coordinate vector in \(\mathcal{C}\) has \(1\) in the first position. In general, for \(j=1,\dots,n\), the derivative of \(x^j\) is \(jx^{j-1}\). In the codomain basis, that polynomial has coefficient \(j\) in position \(j\), with all other coefficients zero. The coefficient of \(x^n\) is therefore sent to \(n\) times the coefficient of \(x^{n-1}\).

Theorem: For \(n\geq 1\), the matrix of \(D:P_n\to P_{n-1}\) in the ascending monomial bases \(\mathcal{B}\) and \(\mathcal{C}\) is the \(n\times(n+1)\) matrix \([D]_{\mathcal{C}\leftarrow\mathcal{B}}\) with entries \(m_{rj}=j-1\) when \(j=r+1\), and \(m_{rj}=0\) otherwise, for \(1\leq r\leq n\) and \(1\leq j\leq n+1\). Equivalently, its first column is zero, and for each \(j=2,\dots,n+1\), the only nonzero entry in column \(j\) is \(j-1\) in row \(j-1\).

Proof. Write the domain basis as \(b_j=x^{j-1}\), where \(1\leq j\leq n+1\). If \(j=1\), then \(D(b_1)=D(1)=0\), so the first column is zero. If \(2\leq j\leq n+1\), then \(D(b_j)=D(x^{j-1})=(j-1)x^{j-2}\). In the codomain basis \((1,x,\dots,x^{n-1})\), the monomial \(x^{j-2}\) is in position \(j-1\). Thus column \(j\) has \(j-1\) in row \(j-1\) and zero in every other row. This gives the stated entries and matrix shape. \(\square\)

The theorem also explains how to use the matrix. If \(p(x)=\sum_{k=0}^{n}a_kx^k\), then its input coordinate vector lists \(a_0,\dots,a_n\). Matrix multiplication returns the output coordinate vector in the order \(1,x,\dots,x^{n-1}\). In particular, the output coefficient of \(x^r\) is \((r+1)a_{r+1}\) for \(r=0,\dots,n-1\).

Worked Example: Differentiating a Cubic by Its Matrix

Find the matrix of \(D:P_3\to P_2\) in the ascending monomial bases, then use it to differentiate \(p(x)=2-x+4x^2+3x^3\).

The domain basis is \((1,x,x^2,x^3)\), and the codomain basis is \((1,x,x^2)\). The derivatives of the domain basis vectors are \(0,1,2x,3x^2\), respectively. Their coordinate vectors give the columns:

$$ [D]_{\mathcal{C}\leftarrow\mathcal{B}} = \begin{bmatrix} 0&1&0&0\\ 0&0&2&0\\ 0&0&0&3 \end{bmatrix}. $$

The coefficient vector of \(p\), in the domain basis order, is \([p]_{\mathcal{B}}=(2,-1,4,3)^{\top}\). Multiplying gives

$$ [D]_{\mathcal{C}\leftarrow\mathcal{B}}[p]_{\mathcal{B}} = \begin{bmatrix} 0&1&0&0\\ 0&0&2&0\\ 0&0&0&3 \end{bmatrix} \begin{bmatrix} 2\\-1\\4\\3 \end{bmatrix} = \begin{bmatrix} -1\\8\\9 \end{bmatrix}. $$

The output vector represents \(-1+8x+9x^2\) in the codomain basis. Direct differentiation gives \(p'(x)=0-1+8x+9x^2\), the same result. Substituting the output coefficients back into the polynomial confirms that the matrix output is the derivative.

Using the Coefficient Rule

For any input coefficient vector \((a_0,a_1,\dots,a_n)^{\top}\), the matrix sends the constant coefficient \(a_0\) to no output entry. The coefficient \(a_1\) becomes the constant output coefficient, \(a_2\) becomes twice the coefficient of \(x\), and so on. The output vector has \(n\) entries because \(P_{n-1}\) has the basis \((1,x,\dots,x^{n-1})\). The matrix does not add a coordinate for \(x^n\) in the codomain: the derivative of an input of degree at most \(n\) cannot contain that power.

Worked Example: A Quadratic Input

Use the matrix of \(D:P_2\to P_1\) to differentiate \(q(x)=-3+2x+5x^2\), and check the output directly.

The domain basis is \((1,x,x^2)\) and the codomain basis is \((1,x)\). Since the derivatives of the domain basis vectors are \(0,1,2x\), the matrix is

$$ [D]_{\mathcal{C}\leftarrow\mathcal{B}} = \begin{bmatrix} 0&1&0\\ 0&0&2 \end{bmatrix}. $$

The coefficient vector of \(q\) is \((-3,2,5)^{\top}\). Matrix multiplication gives

$$ \begin{bmatrix} 0&1&0\\ 0&0&2 \end{bmatrix} \begin{bmatrix} -3\\2\\5 \end{bmatrix} = \begin{bmatrix} 2\\10 \end{bmatrix}. $$

In the codomain basis \((1,x)\), this output is \(2+10x\). Directly, \(q'(x)=0+2+10x=2+10x\), so the coefficient vector and polynomial both agree with the matrix calculation.

Worked Example: A Quartic with a Missing Term

Apply the differentiation matrix to \(r(x)=x-2x^2+3x^4\), viewing \(r\) as an element of \(P_4\). Include the zero coefficient of \(x^3\) in the input vector.

The domain basis is \((1,x,x^2,x^3,x^4)\), and the codomain basis is \((1,x,x^2,x^3)\). The theorem gives

$$ [D]_{\mathcal{C}\leftarrow\mathcal{B}} = \begin{bmatrix} 0&1&0&0&0\\ 0&0&2&0&0\\ 0&0&0&3&0\\ 0&0&0&0&4 \end{bmatrix}. $$

In the specified domain basis, \(r\) has coefficient vector \((0,1,-2,0,3)^{\top}\). Applying the matrix gives

$$ \begin{bmatrix} 0&1&0&0&0\\ 0&0&2&0&0\\ 0&0&0&3&0\\ 0&0&0&0&4 \end{bmatrix} \begin{bmatrix} 0\\1\\-2\\0\\3 \end{bmatrix} = \begin{bmatrix} 1\\-4\\0\\12 \end{bmatrix}. $$

The output vector represents \(1-4x+0x^2+12x^3\). Direct differentiation gives \(r'(x)=1-4x+0x^2+12x^3\), including the zero coefficient of \(x^2\). The check confirms that omitting the input’s zero \(x^3\) coefficient would have used the wrong coordinate vector.

What the Zero Output Means

The matrix has a zero first column because constant polynomials differentiate to zero. In fact, constants are the only polynomials in \(P_n\) that differentiate to zero. This can be proved by comparing the coefficients in the derivative, without making any assumption about the degree of a particular nonzero polynomial.

Proposition: For \(p\in P_n\), \(D(p)=0\) if and only if \(p\) is constant, where the zero polynomial is included among the constants.

Proof. Write \(p(x)=a_0+a_1x+\cdots+a_nx^n\). If \(D(p)=0\), then \(a_1+2a_2x+\cdots+na_nx^{n-1}=0\). A polynomial is the zero polynomial exactly when each of its coefficients is zero, so \(ka_k=0\) for every \(k=1,\dots,n\). Since each such \(k\) is a nonzero real number, \(a_k=0\) for every \(k=1,\dots,n\). Therefore \(p(x)=a_0\) is constant. Conversely, if \(p(x)=a_0\) is constant, then \(D(p)=D(a_0)=0\). This proves both directions. \(\square\)

In coordinates, the same fact appears in the matrix equation. If \((a_0,\dots,a_n)^{\top}\) is sent to zero, the output entries are \(a_1,2a_2,\dots,na_n\). Each must be zero, so \(a_1=\cdots=a_n=0\), while \(a_0\) is unrestricted. Thus the zero first column is not an accidental feature of the displayed matrices: it records exactly the freedom to choose any constant term without changing the derivative.

Common Mistakes

Forgetting the exponent multiplier. A tempting but incorrect matrix for \(D:P_3\to P_2\) puts \(1\) in each of the three nonzero positions. Applying that matrix to the coefficient vector of \(x^2\), \((0,0,1,0)^{\top}\), would give \((0,1,0)^{\top}\), suggesting the output \(x\). But direct differentiation gives \(D(x^2)=2x\). The corrected matrix has \(2\), not \(1\), in row 2, column 3, and sends \((0,0,1,0)^{\top}\) to \((0,2,0)^{\top}\), as required.

Reversing the coefficient order. In the ascending monomial basis, the first coordinate is the constant coefficient and the last is the coefficient of \(x^n\). For \(p(x)=2-x+4x^2+3x^3\), the vector is \((2,-1,4,3)^{\top}\), not \((3,4,-1,2)^{\top}\). Using the reversed list with the ascending-order matrix pairs coefficients with the wrong powers and does not represent the stated polynomial.

Using a square matrix. The map from \(P_n\) to \(P_{n-1}\) has \(n+1\) domain basis vectors and \(n\) codomain basis vectors. Its matrix must therefore have \(n+1\) columns and \(n\) rows. A matrix with \(n\) columns would omit one domain basis vector; a matrix with \(n+1\) rows would use a different codomain basis or an incorrectly sized output vector.

To build the matrix reliably, list the domain monomials in the stated order, differentiate each one, and write its output coefficients in the stated codomain order. Then check a calculation in two ways: multiply the matrix by the input coefficient vector and differentiate the corresponding polynomial directly. Both checks depend on keeping the domain and codomain bases distinct.

Check Your Understanding

Use ascending monomial bases unless a question specifies otherwise. When you compute an output vector, translate it back into a polynomial and verify by differentiation.

  1. Write the matrix of \(D:P_3\to P_2\), identifying the domain and codomain basis orders.
  2. Use that matrix to differentiate \(1+3x-2x^2+x^3\). Give the output coordinate vector and polynomial.
  3. For \(D:P_4\to P_3\), state the number of rows and columns and explain what determines each number.
  4. Prove that a polynomial whose derivative is zero must be constant by comparing coefficients.
  5. For \(D:P_2\to P_1\), show what the matrix does to the coefficient vector of \(x^2\), and explain why an output of \(x\) would indicate an error.

Test yourself: Linear Algebra final exam practice

Ready to check what you know? Work a full-length practice final, then open the complete worked solutions.

Want all 1,114 practice problems?

This tutorial covers one topic. Calc Pass covers the full Calculus AB & BC curriculum (the core of Calculus I and II): full review, every practice question, and step-by-step solutions to each one.

QR code to download the Calc Pass app

Get the Calc Pass App

Scan to download and practice on the go, with instant scoring.

Calc Pass Volume 1: 1,114 Practice Questions book cover

Vol. 1: 1,114 Questions

The complete practice question bank, organized by AB & BC topic.

View on Amazon
Calc Pass Volume 2: Solutions Manual book cover

Vol. 2: Solutions Manual

Fully worked solutions to every question in Volume 1.

View on Amazon