Derivation of Cubic Spline Formula

340 Views Asked by At

I'm afraid this may be a basic integration question.

My textbook's chapter on cubic-spline interpolation says:

Therefore

$$f^{''}_{i,i+1}=\frac{k_{i}(x-x_{i+1})-k_{i+1}(x-x_{i})}{x_{i}-x_{i+1}}$$

Integrating twice with respect to $x$ we obtain

$f_{i,i+1}=\frac{k_{i}(x-x_{i+1})^{3}-k_{i+1}(x-x_{i})^{3}}{6(x_{i}-x_{i+1})}+A(x-x_{i+1})-B(x-x_{i})\tag{c}$

where $A$ and $B$ are constants of integration. The terms arising from the integration would usually be written as $Cx+D$. By letting $C=A-B$ and $D=-Ax_{i+1}+Bx_{i}$ we end up with the last two terms of Eq. (c), which are more convenient to use in the computations that follow.

So it is saying that the second integral of the expression $\frac{k_{i}(x-x_{i+1})-k_{i+1}(x-x_{i})}{x_{i}-x_{i+1}}$ is

$$f_{i,i+1}=\frac{k_{i}(x-x_{i+1})^{3}-k_{i+1}(x-x_{i})^{3}}{6(x_{i}-x_{i+1})}+Cx+D$$

I tried get to this result on my own, but failed. How should I treat the variables $x_{i}$ and $x_{i+1}$ when evaluating the integral of $f^{''}_{i,i+1}$? For context: $f_{i,i+1}$ is the cubic interpolator of a function between the abcissa $x_{i}$ and $x_{i+1}$.

1

There are 1 best solutions below

0
On BEST ANSWER

Treat $x_i, x_{i+1}$ as constants since the integration, as being said, is with respect to $x$.

For the first integral, integrate two terms seperately: $$\int \frac{k_{i}(x-x_{i+1})}{x_{i}-x_{i+1}}dx - \int \frac{k_{i+1}(x-x_{i})}{x_{i}-x_{i+1}}dx $$

For each term, apply substitution $z=x-x_{i+1} \Rightarrow dz=dx$ (for first term), and $z=x-x_i \Rightarrow dz=dx$ (for 2nd term).

Use the similar method to get the second integral.