1

enter image description here

So I know $f^{'}_1(x)=6x+3ax^2$ and $f'_2$(x)=6x+3bx^2$

and $f^{"}_1(x)=6+6ax$ and $f^{"}_2(x)=6+6bx$

Now, $f_1(0)=0$ and $f_2(0)=c$, therefore $c=0$

And $f^{"}_1(0)=0$ and $f^{"}_2(0)=0$

But they don't seem to help me solve for a and b.

stackdsewew
  • 1,047

1 Answers1

2

First of all, $f''(0) \neq 0$.

You need the following conditions instead, for it to be a cubic spline: $$ f'_1(0)=f'_2(0)$$ $$ f''_1(0)=f''_2(0)$$ And since it must be natural: $$ f''_1(-1)=0=f''_2(1) $$

These will let you find $a, b$ and $c$.

  • When I do that all I get is a=b. – stackdsewew May 03 '16 at 06:57
  • 1
    @anna_xox Yup, sorry, edited :) – Riccardo Orlando May 03 '16 at 07:04
  • So then a=1,b=-1,c=0? And to verify continuity all I would need is to show the function values,1st derivative and 2nd derivative equal each other? – stackdsewew May 03 '16 at 07:05
  • @anna_xox Indeed! You can check by plugging in the numbers and verifying that it really is a natural spline. Also, the problem looks poorly worded - it seems you should be able to find out a, b and c without knowing it is natural, and then check that it is, but I don't see a way to do that. – Riccardo Orlando May 03 '16 at 07:07
  • And to verify continuity all I would need is to show the function values,1st derivative and 2nd derivative equal each other? – stackdsewew May 03 '16 at 07:08
  • @anna_xox In $0$, yes: you need to guarantee that it is $C^2$ everywhere, but the only problem point is $0$: everywhere else it is a polynomial, and thus $C^{\infty}$ – Riccardo Orlando May 03 '16 at 07:12
  • Just wanted to confirm, is this reasoning right. 3x$^2$+ax$^3$=3x$^2$+bx$^3$+c at x=0 is how I get c=0. Since this is where the splines join, they will have the same function value. – stackdsewew May 04 '16 at 08:50
  • @anna_xox Exactly. They also need to have the same first and second derivative, in order to form a cubic spline. As a side note, if you found my answer satisfactory, please mark it as accepted, so that the question isn't left open. – Riccardo Orlando May 04 '16 at 09:08