Polynomial interpolation of $f(x)=-x^2/2+|x|$

69 Views Asked by At

I have a function, for example $f(x)=\frac{-x^2}{2}+|x|$, which is divided on $[-1,0)$ and $[0,1]$. How do we interpolate this function with a polynomial $p$ in the maximum degree 4 with $p'(x_0)=f'(x_0)$ and $p'(x_2)=f'(x_2)$?

1

There are 1 best solutions below

4
On BEST ANSWER

I assume you want to interpolate through the points $-1$, $0$ and $1$ also. You need to satisfy the system \begin{align*} p\left(-1\right) & =f\left(-1\right)\\ p\left(0\right) & =f\left(0\right)\\ p\left(1\right) & =f\left(1\right)\\ p^{\prime}\left(0\right) & =f^{\prime}\left(0\right)\\ p^{\prime}\left(1\right) & =f^{\prime}\left(1\right). \end{align*} Now, take $$ p\left(x\right)\equiv ax^{4}+bx^{3}+cx^{2}+dx+e $$ and note that the derivative is $$ p^{\prime}\left(x\right)=4ax^{3}+3bx^{2}+2cx+d. $$ You can plug these into the system above and solve the corresponding equations for $a$, $b$, $c$, $d$ and $e$.