Curve Fitting to Cubic poly

Yes. A linear function, y= ax+ b, has two coefficients, a and b, that need to be determined so you need to equations. One way to do that is to use two different points- a line is determined by two points- so you have \(\displaystyle y_0= ax_0+ b\) and \(\displaystyle y_1= ax_1+ b\) to solve for a and b. But knowing the value and slope (derivative) at a single point also gives two equations: \(\displaystyle y_0= ax_0+ b\) and \(\displaystyle a= a_0\) gives \(\displaystyle y_0= a_0x_0+ b\) so \(\displaystyle b= y_0- a_0x_0\). The equation of the linear function with value \(\displaystyle y_0\) and slope \(\displaystyle a_0\) at \(\displaystyle x= x_0\) is \(\displaystyle y= a_0x+ y_0- a_0x_0\).

Similarly, a quadratic, \(\displaystyle y= ax^2+ bx+ c\) has three coefficients so we need three equations. We can get three equations using three points- a parabola is determined by three points- or using the value, first derivative, and second derivative at one point. For example, if \(\displaystyle y(x_0)= y_0\), \(\displaystyle y'(x_0)= m_0\), and \(\displaystyle y''(x_0)= m_1\) then
\(\displaystyle y(x_0)= ax_0^2+ bx_0+ c= y_0\)
\(\displaystyle y'(x_0)= 2ax_0+ b= m_0\) and
\(\displaystyle y''(x_0)= 2a= m_1\).
Three equations we can solve for a, b, and c.

Finally, a cubic, \(\displaystyle y= ax^3+ bx^2+ cx+ d\) has four coefficients so we need four equations. We can get those equations by using four points- a cubic is determined by four points- or using the value, first derivative, second derivative, and third derivative at one point. For example, if \(\displaystyle y(x_0)= y_0\), \(\displaystyle y'(x_0)= m_0\), \(\displaystyle y''(x_0)= m_1\), and \(\displaystyle y'''(x_0)= m_2\) then we have
\(\displaystyle y(x_0)= ax_0^3+ bx_0^2+ cx_0+ d= y_0\)
\(\displaystyle y'(x_0)=3ax_0^2+ 2bx_0+ c= m_0\)
\(\displaystyle y''(x_0)= 6ax_0+ 2b= m_1\) and
\(\displaystyle y'''(x_0)= 6a= m_2\).
Four equations we can solve for a, b, c, and d.

Of course, that can be extended to polynomials of any degree, n. Such a polynomial has n+ 1 coefficients so we need n+ 1 equations. Those can be the value of the polynomial at n+ 1 different points or the value of the polynomial and its first n derivatives at a single point.
 
Yes. A linear function, y= ax+ b, has two coefficients, a and b, that need to be determined so you need to equations. One way to do that is to use two different points- a line is determined by two points- so you have \(\displaystyle y_0= ax_0+ b\) and \(\displaystyle y_1= ax_1+ b\) to solve for a and b. But knowing the value and slope (derivative) at a single point also gives two equations: \(\displaystyle y_0= ax_0+ b\) and \(\displaystyle a= a_0\) gives \(\displaystyle y_0= a_0x_0+ b\) so \(\displaystyle b= y_0- a_0x_0\). The equation of the linear function with value \(\displaystyle y_0\) and slope \(\displaystyle a_0\) at \(\displaystyle x= x_0\) is \(\displaystyle y= a_0x+ y_0- a_0x_0\).

Similarly, a quadratic, \(\displaystyle y= ax^2+ bx+ c\) has three coefficients so we need three equations. We can get three equations using three points- a parabola is determined by three points- or using the value, first derivative, and second derivative at one point. For example, if \(\displaystyle y(x_0)= y_0\), \(\displaystyle y'(x_0)= m_0\), and \(\displaystyle y''(x_0)= m_1\) then
\(\displaystyle y(x_0)= ax_0^2+ bx_0+ c= y_0\)
\(\displaystyle y'(x_0)= 2ax_0+ b= m_0\) and
\(\displaystyle y''(x_0)= 2a= m_1\).
Three equations we can solve for a, b, and c.

Finally, a cubic, \(\displaystyle y= ax^3+ bx^2+ cx+ d\) has four coefficients so we need four equations. We can get those equations by using four points- a cubic is determined by four points- or using the value, first derivative, second derivative, and third derivative at one point. For example, if \(\displaystyle y(x_0)= y_0\), \(\displaystyle y'(x_0)= m_0\), \(\displaystyle y''(x_0)= m_1\), and \(\displaystyle y'''(x_0)= m_2\) then we have
\(\displaystyle y(x_0)= ax_0^3+ bx_0^2+ cx_0+ d= y_0\)
\(\displaystyle y'(x_0)=3ax_0^2+ 2bx_0+ c= m_0\)
\(\displaystyle y''(x_0)= 6ax_0+ 2b= m_1\) and
\(\displaystyle y'''(x_0)= 6a= m_2\).
Four equations we can solve for a, b, c, and d.

Of course, that can be extended to polynomials of any degree, n. Such a polynomial has n+ 1 coefficients so we need n+ 1 equations. Those can be the value of the polynomial at n+ 1 different points or the value of the polynomial and its first n derivatives at a single point.
thanks appreciate it. This ^ is great
 
Top