# A little bit more on the Taylor expansion

Yesterday finished with:

$F(x) = P(x) + \theta(x)(x -a) + \theta^\prime(x)(x - a)^2$

Can we expand this further?

Well, applying the product rule $\theta^\prime(x) = \frac{F^\prime(x) - P^\prime(x)}{x-a} - \frac{F(x) - P(x)}{(x-a)^2}$

And we know $F(x) - P(x) = \theta(x)(x - a)$ and $F^\prime(x) - P^\prime(x) = \theta^\prime(x)(x -a) + \theta(x)$

So, $\theta^\prime = \frac{\theta^\prime(x)(x - a) + \theta(x)}{x - a} - \frac{\theta(x)(x -a)}{(x -a)^2}$

Applying L’Hospital’s rule again:

$\theta^\prime(x) = \theta^\prime(x) +\theta^{\prime\prime}(x)(x - a) + \theta^\prime(x) - \frac{\theta(x) + \theta^\prime(x)(x - a)}{2(x - a)}$

And $\theta^\prime(x)(x - a)^2 = 2\theta^\prime(x)(x - a)^2 + \theta^{\prime\prime}(x)(x - a)^3 - \frac{\theta(x)(x - a) + \theta^\prime(x)(x - a)^2}{2}$

This process can continue – delivering higher order derivatives on each iteration. It even starts to look like we might generate the factoral terms, as now we can see:

$F(x) = P(x) + \frac{1}{2!}\theta(x)(x - a) + \theta^\prime(x)(x-a)^2 + \theta^{\prime\prime}(x)(x-a)^3$