# Interpolation of Hermite

The Hermite polynomial is the one that interpolates a set of points and the value of their derivatives in any points we want. That is, let's suppose that we have $$(x_k,f_k)$$ and $$(x_k,f'_k)$$.

Then we construct the same table as in Newton's method, placing $$x_k$$ in the first column and writing twice the same point if we know the value of the derivative at this point; in the second column the values of $$f$$ corresponding to the $$x$$ of the same line. Namely if we know the value of $$f$$ in $$x_0$$ and of its derivative we will write $$x_0$$ twice and next to them we will write $$f_0$$. For example,

 $$x_0$$ $$f_0$$ $$x_0$$ $$f_0$$ $$x_1$$ $$f_1$$ $$x_1$$ $$f_1$$

From here on we proceed the same way, but with the difference that we have to define $$f[x_i,x_i]=f'_i$$, the value of the derivative in $$x_i$$.

 $$x_0$$ $$f_0$$ $$f'_0$$ $$x_0$$ $$f_0$$ $$f[x_0,x_0,x_1]$$ $$f[x_0,x_1]$$ $$f[x_0,x_0,x_1,x_1]$$ $$x_1$$ $$f_1$$ $$f[x_0,x_1,x_1]$$ $$f'_1$$ $$x_1$$ $$f_1$$

Therefore, if we have $$n +1$$ values of the function and $$n +1$$ values of the derivatives, the Hermite polynomial will have a $$2n +1$$ degree .

Let's consider an example:

Let's suppose that we want to calculate $$f\Big(\dfrac{1}{8}\Big)$$ where $$f(x)=\tan(\pi x)$$ from Hermite interpolation in $$0,\dfrac{1}{4}$$.

To obtain the result, we draw a table as in Newton's interpolation but repeating every point which derivative we know. This is:

 $$0$$ $$0$$ $$f'(0)=\pi$$ $$0$$ $$0$$ $$\dfrac{4-\pi}{\dfrac{1}{4}-0}=16-4\pi$$ $$\dfrac{1-0}{\dfrac{1}{4}-0}=4$$ $$\dfrac{8\pi-16-16+4\pi}{\dfrac{1}{4}-0}=148\pi-128$$ $$\dfrac{1}{4}$$ $$1$$ $$\dfrac{2\pi-4}{\dfrac{1}{4}-0}=8\pi-16$$ $$f'\Big( \dfrac{1}{4} \Big) = 2\pi$$ $$\dfrac{1}{4}$$ $$1$$

Proceeding as with Newton's interpolation, we get: $$P_3(x)= \pi x +(16-4\pi)x^2+ (48\pi-128)x^2\Big( x-\dfrac{1}{4}\Big)$$$Now, $$\tan\Big(\dfrac{\pi}{8}\Big)\approx P_3\Big(\dfrac{1}{8}\Big)=0.4018\dots$$$