Finding all possible cubic equations from two/three points

446 Views Asked by At

I'm trying to find all possible cubic equations that can be found from two scenarios.


The first scenario is a lot like the one I asked a couple of days ago on Stack Overflow, found here: https://stackoverflow.com/questions/31909731/finding-all-possible-quadratic-equations-from-two-points

Except this time, I have three static points, along with one dynamic integer variable. The three points represent points that all qualifying cubic functions must pass through, and the dynamic variable is what changes the shape of the line.

I'm really not sure where to begin with this.


The second scenario is quite a bit different, in which there are two static points, and then there are two dynamic integer variables. The two points represent points that all qualifying cubic functions should be able to pass through, and the two dynamic variables change the shape of the line, while keeping the line within the two points.

I think that I have an idea on how to solve this, but I just wanted to make sure that it was legitimate. I was going to solve pretty much exactly the way the quadratic situation was found, and just bundle the x cubed and x squared parts together.

Basically, I want to find the 2 general equations that express all equations that can be found from the above scenarios, please.

1

There are 1 best solutions below

3
On

Call the four points $(x_i,y_i): 1\le i\le 4$

Consider $$p_1(x)=\frac{(x-x_2)(x-x_3)(x-x_4)}{(x_1-x_2)(x_1-x_3)(x_1-x_4)}$$with $p_1(x_1)=1$ and $p_1(x_2)=p_1(x_3)=p_1(x_4)=0$. You can create similar expressions $p_i(x)$ for each $i$.

Now form $$p(x)=y_1p_1(x)+y_2p_2(x)+y_3p_3(x)+y_4p_4(x)$$

The form of the $p_i(x)$ ensures that $p(x_i)=y_i$.

This can be treated with one or two points as variables rather than fixed points. The method is known as Lagrange Interpolation.


Note that this gives a cubic polynomial (or could be lower degree if coefficients cancel) passing through the four points. If $q(x)$ is another cubic polynomial passing through the same four points, the $p(x)-q(x)$ is at most cubic and has at least four roots, and must therefore be zero.

Any other method for finding the relevant cubic will therefore give the same result, possibly in a different form.