$$\newcommand{\id}{\mathrm{id}}$$ $$\newcommand{\Span}{\mathrm{span}}$$ $$\newcommand{\kernel}{\mathrm{null}\,}$$ $$\newcommand{\range}{\mathrm{range}\,}$$ $$\newcommand{\RealPart}{\mathrm{Re}}$$ $$\newcommand{\ImaginaryPart}{\mathrm{Im}}$$ $$\newcommand{\Argument}{\mathrm{Arg}}$$ $$\newcommand{\norm}{\| #1 \|}$$ $$\newcommand{\inner}{\langle #1, #2 \rangle}$$ $$\newcommand{\Span}{\mathrm{span}}$$

# 3.4: Applications of the Determinant

$$\newcommand{\vecs}{\overset { \rightharpoonup} {\mathbf{#1}} }$$ $$\newcommand{\vecd}{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}}$$$$\newcommand{\id}{\mathrm{id}}$$ $$\newcommand{\Span}{\mathrm{span}}$$ $$\newcommand{\kernel}{\mathrm{null}\,}$$ $$\newcommand{\range}{\mathrm{range}\,}$$ $$\newcommand{\RealPart}{\mathrm{Re}}$$ $$\newcommand{\ImaginaryPart}{\mathrm{Im}}$$ $$\newcommand{\Argument}{\mathrm{Arg}}$$ $$\newcommand{\norm}{\| #1 \|}$$ $$\newcommand{\inner}{\langle #1, #2 \rangle}$$ $$\newcommand{\Span}{\mathrm{span}}$$ $$\newcommand{\id}{\mathrm{id}}$$ $$\newcommand{\Span}{\mathrm{span}}$$ $$\newcommand{\kernel}{\mathrm{null}\,}$$ $$\newcommand{\range}{\mathrm{range}\,}$$ $$\newcommand{\RealPart}{\mathrm{Re}}$$ $$\newcommand{\ImaginaryPart}{\mathrm{Im}}$$ $$\newcommand{\Argument}{\mathrm{Arg}}$$ $$\newcommand{\norm}{\| #1 \|}$$ $$\newcommand{\inner}{\langle #1, #2 \rangle}$$ $$\newcommand{\Span}{\mathrm{span}}$$

Learning Objectives

1. Use determinants to determine whether a matrix has an inverse, and evaluate the inverse using cofactors.
2. Apply Cramer’s Rule to solve a $$2\times 2$$ or a $$3\times 3$$ linear system.
3. Given data points, find an appropriate interpolating polynomial and use it to estimate points.

## A Formula for the Inverse

The determinant of a matrix also provides a way to find the inverse of a matrix. Recall the definition of the inverse of a matrix in Definition [def:invertiblematrix]. We say that $$A^{-1}$$, an $$n \times n$$ matrix, is the inverse of $$A$$, also $$n \times n$$, if $$AA^{-1} = I$$ and $$A^{-1}A=I$$.

We now define a new matrix called the cofactor matrix of $$A$$. The cofactor matrix of $$A$$ is the matrix whose $$ij^{th}$$ entry is the $$ij^{th}$$ cofactor of $$A$$. The formal definition is as follows.

Definition $$\PageIndex{1}$$: The Cofactor Matrix

Let $$A=\left [ a_{ij}\right ]$$ be an $$n\times n$$ matrix. Then the cofactor matrix of $$A$$, denoted $$\mathrm{cof}\left( A\right)$$, is defined by $$\mathrm{cof}\left( A\right) =\left [ \mathrm{cof}\left(A\right)_{ij}\right ]$$ where $$\mathrm{cof}\left(A\right)_{ij}$$ is the $$ij^{th}$$ cofactor of $$A$$.

Note that $$\mathrm{cof}\left(A\right)_{ij}$$ denotes the $$ij^{th}$$ entry of the cofactor matrix.

We will use the cofactor matrix to create a formula for the inverse of $$A$$. First, we define the adjugate of $$A$$ to be the transpose of the cofactor matrix. We can also call this matrix the classical adjoint of $$A$$, and we denote it by $$\mathrm{adj} \left(A\right)$$.

In the specific case where $$A$$ is a $$2 \times 2$$ matrix given by $A = \left [ \begin{array}{rr} a & b \\ c & d \end{array} \right ]$ then $$\mathrm{adj}\left(A\right)$$ is given by $\mathrm{adj}\left(A\right) = \left [ \begin{array}{rr} d & -b \\ -c & a \end{array} \right ]$

In general, $$\mathrm{adj}\left(A\right)$$ can always be found by taking the transpose of the cofactor matrix of $$A$$. The following theorem provides a formula for $$A^{-1}$$ using the determinant and adjugate of $$A$$.

Theorem $$\PageIndex{1}$$: The Inverse and the Determinant

Let $$A$$ be an $$n\times n$$ matrix. Then $A \; \mathrm{adj}\left(A\right) = \mathrm{adj}\left(A\right)A = {\det \left(A\right)} I$

Moreover $$A$$ is invertible if and only if $$\det \left(A\right) \neq 0$$. In this case we have: $A^{-1} = \frac{1}{\det \left(A\right)} \mathrm{adj}\left(A\right)$

Notice that the first formula holds for any $$n \times n$$ matrix $$A$$, and in the case $$A$$ is invertible we actually have a formula for $$A^{-1}$$.

Consider the following example.

Example $$\PageIndex{1}$$: Find Inverse Using the Determinant

Find the inverse of the matrix $A=\left [ \begin{array}{rrr} 1 & 2 & 3 \\ 3 & 0 & 1 \\ 1 & 2 & 1 \end{array} \right ]$ using the formula in Theorem [thm:inverseanddeterminant].

Solution

According to Theorem [thm:inverseanddeterminant], $A^{-1} = \frac{1}{\det \left(A\right)} \mathrm{adj}\left(A\right)$

First we will find the determinant of this matrix. Using Theorems [thm:switchingrows], [thm:multiplyingrowbyscalar], and [thm:addingmultipleofrow], we can first simplify the matrix through row operations. First, add $$-3$$ times the first row to the second row. Then add $$-1$$ times the first row to the third row to obtain $B = \left [ \begin{array}{rrr} 1 & 2 & 3 \\ 0 & -6 & -8 \\ 0 & 0 & -2 \end{array} \right ]$ By Theorem [thm:addingmultipleofrow], $$\det \left(A\right) = \det \left(B\right)$$. By Theorem [thm:determinantoftriangularmatrix], $$\det \left(B\right) = 1 \times -6 \times -2 = 12$$. Hence, $$\det \left(A\right) = 12$$.

Now, we need to find $$\mathrm{adj} \left(A\right)$$. To do so, first we will find the cofactor matrix of $$A$$. This is given by

$\mathrm{cof}\left( A\right) = \left [ \begin{array}{rrr} -2 & -2 & 6 \\ 4 & -2 & 0 \\ 2 & 8 & -6 \end{array} \right ]$ Here, the $$ij^{th}$$ entry is the $$ij^{th}$$ cofactor of the original matrix $$A$$ which you can verify. Therefore, from Theorem [thm:inverseanddeterminant], the inverse of $$A$$ is given by

$A^{-1} = \frac{1}{12}\left [ \begin{array}{rrr} -2 & -2 & 6 \\ 4 & -2 & 0 \\ 2 & 8 & -6 \end{array} \right ] ^{T}= \ \left [ \begin{array}{rrr} - \frac{1}{6} & \frac{1}{3} & \frac{1}{6} \\ - \frac{1}{6} & - \frac{1}{6} & \frac{2}{3} \\ \frac{1}{2} & 0 & - \frac{1}{2} \end{array} \right ]$

Remember that we can always verify our answer for $$A^{-1}$$. Compute the product $$AA^{-1}$$ and $$A^{-1}A$$ and make sure each product is equal to $$I$$.

Compute $$A^{-1}A$$ as follows

$A^{-1}A = \ \left [ \begin{array}{rrr} - \frac{1}{6} & \frac{1}{3} & \frac{1}{6} \\ - \frac{1}{6} & - \frac{1}{6} & \frac{2}{3} \\ \frac{1}{2} & 0 & - \frac{1}{2} \end{array} \right ] \left [ \begin{array}{rrr} 1 & 2 & 3 \\ 3 & 0 & 1 \\ 1 & 2 & 1 \end{array} \right ] = \left [ \begin{array}{rrr} 1 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \end{array} \right ] = I$

You can verify that $$AA^{-1} = I$$ and hence our answer is correct.

We will look at another example of how to use this formula to find $$A^{-1}$$.

Example $$\PageIndex{2}$$: Find the Inverse From a Formula

Find the inverse of the matrix $A=\left [ \begin{array}{rrr} \frac{1}{2} & 0 & \frac{1}{2} \\ - \frac{1}{6} & \frac{1}{3} & - \frac{1}{2} \\ - \frac{5}{6} & \frac{2}{3} & - \frac{1}{2} \end{array} \right ]$ using the formula given in Theorem [thm:inverseanddeterminant].

Solution

First we need to find $$\det \left(A\right)$$. This step is left as an exercise and you should verify that $$\det \left(A\right) = \frac{1}{6}.$$ The inverse is therefore equal to $A^{-1} = \frac{1}{(1/6)}\; \mathrm{adj} \left(A\right) = 6\; \mathrm{adj} \left(A\right)$

We continue to calculate as follows. Here we show the $$2 \times 2$$ determinants needed to find the cofactors.

$A^{-1} = 6\left [ \begin{array}{rrr} \left| \begin{array}{rr} \frac{1}{3} & - \frac{1}{2} \\ \frac{2}{3} & - \frac{1}{2} \end{array} \right| & -\left| \begin{array}{rr} - \frac{1}{6} & - \frac{1}{2} \\ - \frac{5}{6} & - \frac{1}{2} \end{array} \right| & \left| \begin{array}{rr} - \frac{1}{6} & \frac{1}{3} \\ - \frac{5}{6} & \frac{2}{3} \end{array} \right| \\ -\left| \begin{array}{rr} 0 & \frac{1}{2} \\ \frac{2}{3} & - \frac{1}{2} \end{array} \right| & \left| \begin{array}{rr} \frac{1}{2} & \frac{1}{2} \\ - \frac{5}{6} & - \frac{1}{2} \end{array} \right| & -\left| \begin{array}{rr} \frac{1}{2} & 0 \\ - \frac{5}{6} & \frac{2}{3} \end{array} \right| \\ \left| \begin{array}{rr} 0 & \frac{1}{2} \\ \frac{1}{3} & - \frac{1}{2} \end{array} \right| & -\left| \begin{array}{rr} \frac{1}{2} & \frac{1}{2} \\ - \frac{1}{6} & - \frac{1}{2} \end{array} \right| & \left| \begin{array}{rr} \frac{1}{2} & 0 \\ - \frac{1}{6} & \frac{1}{3} \end{array} \right| \end{array} \right ] ^{T}$

Expanding all the $$2\times 2$$ determinants, this yields $A^{-1} = 6\left [ \begin{array}{rrr} \frac{1}{6} & \frac{1}{3} & \frac{1}{6} \\ \frac{1}{3} & \frac{1}{6} & - \frac{1}{3} \\ - \frac{1}{6} & \frac{1}{6} & \frac{1}{6} \end{array} \right ] ^{T}= \left [ \begin{array}{rrr} 1 & 2 & -1 \\ 2 & 1 & 1 \\ 1 & -2 & 1 \end{array} \right ]$

Again, you can always check your work by multiplying $$A^{-1}A$$ and $$AA^{-1}$$ and ensuring these products equal $$I$$. $A^{-1}A = \left [ \begin{array}{rrr} 1 & 2 & -1 \\ 2 & 1 & 1 \\ 1 & -2 & 1 \end{array} \right ] \left [ \begin{array}{rrr} \frac{1}{2} & 0 & \frac{1}{2} \\ - \frac{1}{6} & \frac{1}{3} & - \frac{1}{2} \\ - \frac{5}{6} & \frac{2}{3} & - \frac{1}{2} \end{array} \right ] = \left [ \begin{array}{rrr} 1 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \end{array} \right ]$ This tells us that our calculation for $$A^{-1}$$ is correct. It is left to the reader to verify that $$AA^{-1} = I$$.

The verification step is very important, as it is a simple way to check your work! If you multiply $$A^{-1}A$$ and $$AA^{-1}$$ and these products are not both equal to $$I$$, be sure to go back and double check each step. One common error is to forget to take the transpose of the cofactor matrix, so be sure to complete this step.

We will now prove Theorem [thm:inverseanddeterminant].

The Inverse and the Determinant

Proof

(of Theorem [thm:inverseanddeterminant]) Recall that the $$(i,j)$$-entry of $$\mathrm{adj}(A)$$ is equal to $$\mathrm{cof}(A)_{ji}$$. Thus the $$(i,j)$$-entry of $$B=A\cdot \mathrm{adj}(A)$$ is : $B_{ij}=\sum_{k=1}^n a_{ik} \mathrm{adj} (A)_{kj}= \sum_{k=1}^n a_{ik} \mathrm{cof} (A)_{jk}$ By the cofactor expansion theorem, we see that this expression for $$B_{ij}$$ is equal to the determinant of the matrix obtained from $$A$$ by replacing its $$j$$th row by $$a_{i1}, a_{i2}, \dots a_{in}$$ — i.e., its $$i$$th row.

If $$i=j$$ then this matrix is $$A$$ itself and therefore $$B_{ii}=\det A$$. If on the other hand $$i\neq j$$, then this matrix has its $$i$$th row equal to its $$j$$th row, and therefore $$B_{ij}=0$$ in his case. Thus we obtain: $A \; \mathrm{adj}\left(A\right) = {\det \left(A\right)} I$ Similarly we can verify that: $\mathrm{adj}\left(A\right)A = {\det \left(A\right)} I$ And this proves the first part of the theorem.

Further if $$A$$ is invertible, then by Theorem [thm:determinantofproduct] we have: $1 = \det \left( I \right) = \det \left( A A^{-1} \right) = \det \left( A \right) \det \left( A^{-1} \right)$ and thus $$\det \left( A \right) \neq 0$$. Equivalently, if $$\det \left( A \right) = 0$$, then $$A$$ is not invertible.

Finally if $$\det \left( A \right) \neq 0$$, then the above formula shows that $$A$$ is invertible and that: $A^{-1} = \frac{1}{\det \left(A\right)} \mathrm{adj}\left(A\right)$

This completes the proof.

This method for finding the inverse of $$A$$ is useful in many contexts. In particular, it is useful with complicated matrices where the entries are functions, rather than numbers.

Consider the following example.

Example $$\PageIndex{1}$$: Inverse for Non-Constant Matrix

Suppose $A\left( t\right) =\left [ \begin{array}{ccc} e^{t} & 0 & 0 \\ 0 & \cos t & \sin t \\ 0 & -\sin t & \cos t \end{array} \right ]$ Show that $$A\left( t\right) ^{-1}$$ exists and then find it.

Solution

First note $$\det \left( A\left( t\right) \right) = e^{t}(\cos^2 t + \sin^2 t) = e^{t}\neq 0$$ so $$A\left( t\right) ^{-1}$$ exists.

The cofactor matrix is $C\left( t\right) =\left [ \begin{array}{ccc} 1 & 0 & 0 \\ 0 & e^{t}\cos t & e^{t}\sin t \\ 0 & -e^{t}\sin t & e^{t}\cos t \end{array} \right ]$ and so the inverse is $\frac{1}{e^{t}}\left [ \begin{array}{ccc} 1 & 0 & 0 \\ 0 & e^{t}\cos t & e^{t}\sin t \\ 0 & -e^{t}\sin t & e^{t}\cos t \end{array} \right ] ^{T}= \left [ \begin{array}{ccc} e^{-t} & 0 & 0 \\ 0 & \cos t & -\sin t \\ 0 & \sin t & \cos t \end{array} \right ]$

### Cramer’s Rule

Another context in which the formula given in Theorem [thm:inverseanddeterminant] is important is Cramer’s Rule. Recall that we can represent a system of linear equations in the form $$AX=B$$, where the solutions to this system are given by $$X$$. Cramer’s Rule gives a formula for the solutions $$X$$ in the special case that $$A$$ is a square invertible matrix. Note this rule does not apply if you have a system of equations in which there is a different number of equations than variables (in other words, when $$A$$ is not square), or when $$A$$ is not invertible.

Suppose we have a system of equations given by $$AX=B$$, and we want to find solutions $$X$$ which satisfy this system. Then recall that if $$A^{-1}$$ exists, \begin{aligned} AX&=&B \\ A^{-1}\left(AX\right)&=&A^{-1}B \\ \left(A^{-1}A\right)X&=&A^{-1}B \\ IX&=&A^{-1}B\\ X &=& A^{-1}B\end{aligned} Hence, the solutions $$X$$ to the system are given by $$X=A^{-1}B$$. Since we assume that $$A^{-1}$$ exists, we can use the formula for $$A^{-1}$$ given above. Substituting this formula into the equation for $$X$$, we have $X=A^{-1}B=\frac{1}{\det \left( A\right) }\mathrm{adj}\left( A\right)B$ Let $$x_i$$ be the $$i^{th}$$ entry of $$X$$ and $$b_j$$ be the $$j^{th}$$ entry of $$B$$. Then this equation becomes $x_i = \sum_{j=1}^{n}\left [ a_{ij}\right ]^{-1}b_{j}=\sum_{j=1}^{n} \frac{1} {\det \left( A\right) } \mathrm{adj}\left( A\right) _{ij}b_{j}$ where $$\mathrm{adj}\left(A\right)_{ij}$$ is the $$ij^{th}$$ entry of $$\mathrm{adj}\left(A\right)$$.

By the formula for the expansion of a determinant along a column, $x_{i}= \frac{1}{\det \left( A\right) }\det \left [ \begin{array}{ccccc} \ast & \cdots & b_{1} & \cdots & \ast \\ \vdots & & \vdots & & \vdots \\ \ast & \cdots & b_{n} & \cdots & \ast \end{array} \right ]$ where here the $$i^{th}$$ column of $$A$$ is replaced with the column vector $$\left [ b_{1}\cdots \cdot ,b_{n}\right ] ^{T}$$. The determinant of this modified matrix is taken and divided by $$\det \left( A\right)$$. This formula is known as Cramer’s rule.

We formally define this method now.

Procedure $$\PageIndex{1}$$: Using Cramer’s Rule

Suppose $$A$$ is an $$n\times n$$ invertible matrix and we wish to solve the system $$AX=B$$ for $$X =\left [ x_{1},\cdots ,x_{n}\right ] ^{T}.$$ Then Cramer’s rule says $x_{i}= \frac{\det \left(A_{i}\right)}{\det \left(A\right)}$ where $$A_{i}$$ is the matrix obtained by replacing the $$i^{th}$$ column of $$A$$ with the column matrix $B = \left [ \begin{array}{c} b_1 \\ \vdots \\ b_n \end{array} \right ]$

We illustrate this procedure in the following example.

Example $$\PageIndex{1}$$

Find $$x,y,z$$ if $\left [ \begin{array}{rrr} 1 & 2 & 1 \\ 3 & 2 & 1 \\ 2 & -3 & 2 \end{array} \right ] \left [ \begin{array}{c} x \\ y \\ z \end{array} \right ] =\left [ \begin{array}{r} 1 \\ 2 \\ 3 \end{array} \right ]$

Solution

We will use method outlined in Procedure [proc:cramersrule] to find the values for $$x,y,z$$ which give the solution to this system. Let $B = \left [ \begin{array}{r} 1 \\ 2 \\ 3 \end{array} \right ]$

In order to find $$x$$, we calculate $x = \frac{\det \left(A_{1}\right)}{\det \left(A\right)}$ where $$A_1$$ is the matrix obtained from replacing the first column of $$A$$ with $$B$$.

Hence, $$A_1$$ is given by $A_1 = \left [ \begin{array}{rrr} 1 & 2 & 1 \\ 2 & 2 & 1 \\ 3 & -3 & 2 \end{array} \right ]$

Therefore, $x= \frac{\det \left(A_{1}\right)}{\det \left(A\right)} = \frac{\left| \begin{array}{rrr} 1 & 2 & 1 \\ 2 & 2 & 1 \\ 3 & -3 & 2 \end{array} \right| }{\left| \begin{array}{rrr} 1 & 2 & 1 \\ 3 & 2 & 1 \\ 2 & -3 & 2 \end{array} \right| }= \frac{1}{2}$

Similarly, to find $$y$$ we construct $$A_2$$ by replacing the second column of $$A$$ with $$B$$. Hence, $$A_2$$ is given by $A_2 = \left [ \begin{array}{rrr} 1 & 1 & 1 \\ 3 & 2 & 1 \\ 2 & 3 & 2 \end{array} \right ]$

Therefore, $y= \frac{\det \left(A_{2}\right)}{\det \left(A\right)} = \frac{\left| \begin{array}{rrr} 1 & 1 & 1 \\ 3 & 2 & 1 \\ 2 & 3 & 2 \end{array} \right| }{\left| \begin{array}{rrr} 1 & 2 & 1 \\ 3 & 2 & 1 \\ 2 & -3 & 2 \end{array} \right| }=- \frac{1}{7}$

Similarly, $$A_3$$ is constructed by replacing the third column of $$A$$ with $$B$$. Then, $$A_3$$ is given by $A_3 = \left [ \begin{array}{rrr} 1 & 2 & 1 \\ 3 & 2 & 2 \\ 2 & -3 & 3 \end{array} \right ]$

Therefore, $$z$$ is calculated as follows.

$z= \frac{\det \left(A_{3}\right)}{\det \left(A\right)} = \frac{\left| \begin{array}{rrr} 1 & 2 & 1 \\ 3 & 2 & 2 \\ 2 & -3 & 3 \end{array} \right| }{\left| \begin{array}{rrr} 1 & 2 & 1 \\ 3 & 2 & 1 \\ 2 & -3 & 2 \end{array} \right| }=\frac{11}{14}$

Cramer’s Rule gives you another tool to consider when solving a system of linear equations.

We can also use Cramer’s Rule for systems of non linear equations. Consider the following system where the matrix $$A$$ has functions rather than numbers for entries.

Using Cramer’s Rulecramersrule

Example $$\PageIndex{1}$$

Solve for $$z$$ if $\left [ \begin{array}{ccc} 1 & 0 & 0 \\ 0 & e^{t}\cos t & e^{t}\sin t \\ 0 & -e^{t}\sin t & e^{t}\cos t \end{array} \right ] \left [ \begin{array}{c} x \\ y \\ z \end{array} \right ] =\left [ \begin{array}{c} 1 \\ t \\ t^{2} \end{array} \right ]$

Solution

We are asked to find the value of $$z$$ in the solution. We will solve using Cramer’s rule. Thus $z=\vspace{.05in} \frac{\left| \begin{array}{ccc} 1 & 0 & 1 \\ 0 & e^{t}\cos t & t \\ 0 & -e^{t}\sin t & t^{2} \end{array} \right| }{\left| \begin{array}{ccc} 1 & 0 & 0 \\ 0 & e^{t}\cos t & e^{t}\sin t \\ 0 & -e^{t}\sin t & e^{t}\cos t \end{array} \right| }= \ t\left( \left( \cos t\right) t+\sin t\right) e^{-t}$

Use Cramer’s Rule for Non-Constant Matrixcramersrulenonconstantmatrix

### Polynomial Interpolation

In studying a set of data that relates variables $$x$$ and $$y$$, it may be the case that we can use a polynomial to “fit” to the data. If such a polynomial can be established, it can be used to estimate values of $$x$$ and $$y$$ which have not been provided.

Consider the following example.

Polynomial Interpolationpolynomialinterpolation Given data points $$(1,4), (2,9), (3,12)$$, find an interpolating polynomial $$p(x)$$ of degree at most $$2$$ and then estimate the value corresponding to $$x = \frac{1}{2}$$.

We want to find a polynomial given by $p(x) = r_0 + r_1x_1 + r_2x_2^2$ such that $$p(1)=4, p(2)=9$$ and $$p(3)=12$$. To find this polynomial, substitute the known values in for $$x$$ and solve for $$r_0, r_1$$, and $$r_2$$. \begin{aligned} p(1) &=& r_0 + r_1 + r_2 = 4\\ p(2) &=& r_0 + 2r_1 + 4r_2 = 9\\ p(3) &=& r_0 + 3r_1 + 9r_2 = 12\end{aligned}

Writing the augmented matrix, we have $\left [ \begin{array}{rrr|r} 1 & 1 & 1 & 4 \\ 1 & 2 & 4 & 9 \\ 1 & 3 & 9 & 12 \end{array} \right ]$

After row operations, the resulting matrix is $\left [ \begin{array}{rrr|r} 1 & 0 & 0 & -3 \\ 0 & 1 & 0 & 8 \\ 0 & 0 & 1 & -1 \end{array} \right ]$

Therefore the solution to the system is $$r_0 = -3, r_1 = 8, r_2 = -1$$ and the required interpolating polynomial is $p(x) = -3 + 8x - x^2$

To estimate the value for $$x = \frac{1}{2}$$, we calculate $$p(\frac{1}{2})$$: \begin{aligned} p(\frac{1}{2}) &=& -3 + 8(\frac{1}{2}) - (\frac{1}{2})^2\\ &=& -3 + 4 - \frac{1}{4} \\ &=& \frac{3}{4}\end{aligned}

This procedure can be used for any number of data points, and any degree of polynomial. The steps are outlined below.

Finding an Interpolating Polynomialfindinginterpolynomial Suppose that values of $$x$$ and corresponding values of $$y$$ are given, such that the actual relationship between $$x$$ and $$y$$ is unknown. Then, values of $$y$$ can be estimated using an interpolating polynomial $$p(x)$$. If given $$x_1, ..., x_n$$ and the corresponding $$y_1, ..., y_n$$, the procedure to find $$p(x)$$ is as follows:

1. The desired polynomial $$p(x)$$ is given by $p(x) = r_0 + r_1 x + r_2 x^2 + ... + r_{n-1}x^{n-1}$
2. $$p(x_i) = y_i$$ for all $$i = 1, 2, ...,n$$ so that $\begin{array}{c} r_0 + r_1x_1 + r_2 x_1^2 + ... + r_{n-1}x_1^{n-1} = y_1 \\ r_0 + r_1x_2 + r_2 x_2^2 + ... + r_{n-1}x_2^{n-1} = y_2 \\ \vdots \\ r_0 + r_1x_n + r_2 x_n^2 + ... + r_{n-1}x_n^{n-1} = y_n \end{array}$
3. Set up the augmented matrix of this system of equations $\left [ \begin{array}{rrrrr|r} 1 & x_1 & x_1^2 & \cdots & x_1^{n-1} & y_1 \\ 1 & x_2 & x_2^2 & \cdots & x_2^{n-1} & y_2 \\ \vdots & \vdots & \vdots & &\vdots & \vdots \\ 1 & x_n & x_n^2 & \cdots & x_n^{n-1} & y_n \\ \end{array} \right ]$
4. Solving this system will result in a unique solution $$r_0, r_1, \cdots, r_{n-1}$$. Use these values to construct $$p(x)$$, and estimate the value of $$p(a)$$ for any $$x=a$$.

This procedure motivates the following theorem.

Polynomial Interpolationpolynomialinterpolation Given $$n$$ data points $$(x_1, y_1), (x_2, y_2), \cdots, (x_n, y_n)$$ with the $$x_i$$ distinct, there is a unique polynomial $$p(x) = r_0 + r_1x + r_2x^2 + \cdots + r_{n-1}x^{n-1}$$ such that $$p(x_i) = y_i$$ for $$i=1,2,\cdots, n$$. The resulting polynomial $$p(x)$$ is called the interpolating polynomial for the data points.

We conclude this section with another example.

Polynomial Interpolationpolynomialinterpolation2 Consider the data points $$(0,1), (1,2), (3,22), (5,66)$$. Find an interpolating polynomial $$p(x)$$ of degree at most three, and estimate the value of $$p(2)$$.

The desired polynomial $$p(x)$$ is given by: $p(x) = r_0 + r_1 x + r_2x^2 + r_3x^3$

Using the given points, the system of equations is \begin{aligned} p(0) &=& r_0 = 1 \\ p(1) &=& r_0 + r_1 + r_2 + r_3 = 2 \\ p(3) &=& r_0 + 3r_1 + 9r_2 + 27r_3 = 22 \\ p(5) &=& r_0 + 5r_1 + 25r_2 + 125r_3 = 66\end{aligned}

The augmented matrix is given by: $\left [ \begin{array}{rrrr|r} 1 & 0 & 0 & 0 & 1 \\ 1 & 1 & 1 & 1 & 2 \\ 1 & 3 & 9 & 27 & 22 \\ 1 & 5 & 25 & 125 & 66 \end{array} \right ]$

The resulting matrix is $\left [ \begin{array}{rrrr|r} 1 & 0 & 0 & 0 & 1 \\ 0 & 1 & 0 & 0 & -2 \\ 0 & 0 & 1 & 0 & 3 \\ 0 & 0 & 0 & 1 & 0 \end{array} \right ]$

Therefore, $$r_0 = 1, r_1 = -2, r_2 = 3, r_3 = 0$$ and $$p(x) = 1 -2x + 3x^2$$. To estimate the value of $$p(2)$$, we compute $$p(2) = 1 -2(2) + 3(2^2) = 1 - 4 + 12 = 9$$.