We know that two points determine a line. Do you know how many points determine a quadratic function of the form \(f(x)=ax^2+bx+c\text{?}\) Given any number of points in the plane, is it always possible to find a polynomial function whose graph contains every one of the given points? To address these questions we will start with an alternative way of finding an equation of a line.
Consider two points \(A(-3, 2)\) and \(B(1,-2)\text{.}\) We will find a function \(f\) whose graph is a line that passes through these points. We know that \(f(x)=ax+b\) for some constants \(a\) and \(b\text{.}\) Because the graph of \(f\) passes through \(A\) and \(B\text{,}\) we must have the following:
Solving the equation, we find that \(a=-1\) and \(b=-1\text{.}\) This gives us:
\begin{equation*}
f(x)=-x-1.
\end{equation*}
The GeoGebra interactive below shows two points \(A\) and \(B\text{,}\) together with the matrix equation that produces function coefficients for the function whose graph passes through \(A\) and \(B\text{.}\) Drag the points around the plane to see how the matrix equation changes.
Now we are ready to move to quadratic, and higher degree polynomial functions. The linear function in ExplorationΒ 7.8.1 had two unknown coefficients that we needed to find in order to determine the function. Two points gave us a system of two equations and two unknowns.
Drag the points around the plane to observe changes in the coefficient matrix. Think geometrically to find locations of \(A\text{,}\)\(B\) and \(C\) such that
In general (provided that no one point lies directly above another), given \(n\) points, we can always find an \((n-1)\)-degree polynomial function whose graph contains every one of the given points. To find such a polynomial function, given by \(f(x)=a_{n-1}x^{n-1}+\dots +a_1x+a_0\text{,}\) we need to solve a system of \(n\) equations with \(n\) unknowns which translates into the following matrix equation.
In ExerciseΒ 7.8.3.3 and ExerciseΒ 7.8.3.4 you will show that the matrix equation in (7.8.1) has a unique solution if and only if no two of the given points share an \(x\)-coordinate.
It is exciting to know that we can fit a function to a set of data points, but before we get carried away fitting a 299-degree polynomial function to 300 points, letβs consider the following situation. In the GeoGebra interactive below, you can see that points \(A\) - \(F\) form a somewhat linear pattern.
A linear model can be used to describe these points. Click on the ``Display linear model" check-box to see the trend line. (You learned how to find such models when discovering Least-Squares Approximation). You can see that even though the line does not pass through any of the given points, it fits the overall pattern of the points and can be used to estimate the \(y\)-coordinates of other points whose \(x\)-coordinates fall within the limits of the scatter plot.
It might be tempting to think that we can find a better model by finding a \(5^{th}\)-degree polynomial function whose graph contains every one of the six points. Click on the ``Display 5th degree poly model" check-box to see the alternative model. Can this model be successfully used to make predictions? Try moving individual points around to see how their placement affects the line and the curve.
Any modeling process which insists on fitting the existing data points exactly, at the risk of failing to predict future observations, is referred to as overfitting. While sometimes it is beneficial to have a curve that passes through specific points, more often it is the trend, not the individual instances, that we try to capture. We will return to this topic when discussing least-squares approximations.
In each case, find a polynomial function of an appropriate degree that passes through the given points. You are encourage to plot the graph of \(f\) in Desmos.
In the first screenshot, points \(A\) and \(B\) coincide. In the second screenshot, point \(A\) is located directly above point \(B\text{.}\) In both cases, GeoGebra failed to produce a linear function whose graph passes through \(A\) and \(B\text{.}\)
Based on what you know about functions and geometry, explain why the process fails for these two examples. How do your observations correspond to what happens from an algebraic standpoint?
Prove that (7.8.1) has a unique solution if and only if no two given points share an \(x\)-coordinate. Under what circumstances is a solution not unique? Under what circumstances does a solution not exist?