I am learning about natural splines and basis functions and am struggling with it a lot.
I understand the concepts of knots being the part where first and second derivatives are equal on either side. But when it comes to calculating basis functions and eventually a basis matrix I get confused.
I understand that for a cubic spline $d_i(x) = \frac{(x-x_i)^{3}_+ - (x-x_n)^{3}_+}{x_n - x_i}, i=1,\dots,n-1.$
for the example n = 4 ,
$d_i(x) = \frac{(x-x_i)^{3}_+ - (x-x_4)^{3}_+}{x_4 - x_i}$
From here onwards I get lost. How do I find $d_1(x_1)$? I would assume you just replace i with 1 and x with $x_1$ however this would result in $$d_1(x_1) = \frac{(x_1-x_i)^{3}_+ - (x_1-x_4)^{3}_+}{x_4 - x_1} = \frac{(0)^{3}_+ - (x_1-x_4)^{3}_+}{x_4 - x_1} = \frac{- (x_1-x_4)^{3}_+}{x_4 - x_1}$$
However the text book says the answer is 0. For $d_1(x_2)$ it gives an answer of $\frac{(x_2-x_1)^3}{x_4-x_1}$.
I do not understand why it appears that for every answer it doesn't include the second term of the numerator.
Any clarification as to how $d_1(x_1)$ or $d_3(x_2)$ is 0 would be very appreciated.