121k views
5 votes
For the data points (1,1),(2,1/2),(3,1/3),(4,1/4), finde the natural cubic spline.

1 Answer

5 votes

Answer:

y = -1/24 x³ + 5/12 x² − 35/24 x + 25/12

Step-by-step explanation:

A cubic has the form:

y = ax³ + bx² + cx + d

Given four points, we can write a system of equations:

1 = a + b + c + d

1/2 = 8a + 4b + 2c + d

1/3 = 27a + 9b + 3c + d

1/4 = 64a + 16b + 4c + d

Solving this algebraically would be time-consuming, but we can use matrices to make it easy.


\left[\begin{array}{cccc}1&1&1&1\\8&4&2&1\\27&9&3&1\\64&16&4&1\end{array}\right]\left[\begin{array}{cccc}a\\b\\c\\d\end{array}\right]=\left[\begin{array}{cccc}1\\1/2\\1/3\\1/4\end{array}\right]

First, we find the inverse of the coefficient matrix. This is messy to do by hand, so let's use a calculator:


\left[\begin{array}{cccc}1&1&1&1\\8&4&2&1\\27&9&3&1\\64&16&4&1\end{array}\right] ^(-1) =-(1)/(12)\left[\begin{array}{cccc}2&-6&6&-2\\-18&48&-42&12\\52&-114&84&-22\\-48&72&-48&12\end{array}\right]

Now we multiply by the solution matrix (again using a calculator):


-(1)/(12) \left[\begin{array}{cccc}2&-6&6&-2\\-18&48&-42&12\\52&-114&84&-22\\-48&72&-48&12\end{array}\right]\left[\begin{array}{cccc}1\\1/2\\1/3\\1/4\end{array}\right] =\left[\begin{array}{cccc}-1/24\\5/12\\-35/24\\25/12\end{array}\right]

So the cubic is:

y = -1/24 x³ + 5/12 x² − 35/24 x + 25/12

User DooBLER
by
5.8k points