Finding the equation of a cubic when given $4$ points
Sebastian Wright
I am asked to find the equation of a cubic function that passes through the origin. It also passes through the points $(1, 3), (2, 6),$ and $(-1, 10)$.
I have walked through many answers for similar questions that suggest to use a substitution method by subbing in all the points and writing in terms of variables. I have tried that but I don't really know where to take it from there or what variables to write it as.
If anyone could provide their working out for this problem it would be extremely enlightening.
$\endgroup$7 Answers
$\begingroup$Given four points $(x_i,y_i)$ consider the functions $$f_1(x)=\frac {(x-x_2)(x-x_3)(x-x_4)}{(x_1-x_2)(x_1-x_3)(x_1-x_4)}$$ so that $f_1(x_1)=1$ and $f_1(x_i)=0, i\neq 1$, and similarly $f_2, f_3, f_4$. Note that the $f_i$ are cubic in $x$.
Then $p(x)=y_1f_1(x)+y_2f_2(x)+y_3f_3(x)+y_4f_4(x)$ is at most a cubic polynomial and passes through the four given points.
$\endgroup$ 1 $\begingroup$the general cubic equation is $$y=ax^3+bx^2+cx+d.$$Plug in the coordinates of the points for x and y, and you end up with a system of four equations in four variables, namely $a, b, c$ and $d$. Hope that helps!
$\endgroup$ 3 $\begingroup$An equation of the cubic that passes through the four points $(x_1,y_1)$, $(x_2,y_2)$, $(x_3,y_3)$ and $(x_4,y_4)$ is $$\begin{vmatrix} x^3 & x^2 & x & y & 1 \\ x_1^3 & x_1^2 & x_1 & y_1 & 1 \\ x_2^3 & x_2^2 & x_2 & y_2 & 1 \\ x_3^3 & x_3^2 & x_3 & y_3 & 1 \\ x_4^3 & x_4^2 & x_4 & y_4 & 1 \end{vmatrix} = 0.$$ Plug in the coordinates of your points and simplify.
$\endgroup$ $\begingroup$Guide:
Let the equation be $y=ax^3+bx^2+cx+d$, since it passes through $(1,3)$, we have
$$a(1)^3+b(1)^2+c(1)+d=3$$
Do the same thing for the other $3$ points.
Hence you will obtain $4$ linear equation with $4$ variables.
You can then solve it using elementary row operations to recover $a,b,c,d$.
$\endgroup$ 2 $\begingroup$To determine a conic we need to solve 5 equations with 5 given points.
Likewise here we are given 4 points and 4 simultaneous equations, not involving any $xy $ term.. so solve it by Cramer's determinants.
$\endgroup$ $\begingroup$Hint:
It is proper to use the Lagrange function as following$$f(x)=\sum_{cyc}\dfrac{(x-x_2)(x-x_3)(x-x_4)}{(x_1-x_2)(x_1-x_3)(x_1-x_4)}$$
$\endgroup$ $\begingroup$This problem is a special case in which all known values differ by fixed $\Delta x$ (here $\Delta x = 1$). This is a very common problem when you have discrete equispaced values and you want to interpolate to find the "exact" maximum or minimum value, between the endpoints. (You then assume that a cubic polynomial passes through these points, find the polynomial and then its extremum). It is also known as "cubic interpolation".
In this case, the cubic polynomial is$$f(x) = a_0 + a_1\epsilon(x) + a_2\epsilon^2(x) + a_3\epsilon^3(x)$$where$$ \epsilon = \frac{x-n\Delta x}{\Delta x},\quad n=-1,0,1,2$$.$\epsilon$ is actually shifting and scaling the polynomial, so that the known points are at $-1, 0, 1, 3$. In your case, $\Delta x=1$ and you can take $n=0$, therefore$$f(x) = a_0 + a_1 x + a_2x^2 + a_3x^3$$and\begin{align} a_0 & = f(0),\\ a_1 & = \frac{-2f(-1) - 3f(0) + 6f(1)-f(2)}{6},\\ a_2 & = \frac{f(-1) -2f(0) + f(1)}{2},\\ a_3 & = \frac{-f(-1) + 3f(0) - 3f(1) + f(2)}{6}.\\ \end{align}
Note that in the case where the know points are not $-1, 0, 1, 2$, the formulas for $a_0,\ldots a_2$ are the similar, the only difference being that if the points are $x_{-1}, x_0, x_1, x_2$, then in the above equations, just use $f(x_{-1})$ instead of $f(-1)$, $f(x_0)$ instead of $f(0)$ and so on.
$\endgroup$