# Taylor Series Expansion explanation

Can anyone explain the logic behind this taylor series expansion?

I know the general equations for a taylor series and understand where the first term came from, but I do not understand where the 2nd or 3rd terms are derived from.

Taylor polynomial about $x_0$is a polynomial $p(x)$ with the property that:
$$p(x_0)=f(x_0)$$ $$p'(x_0)=f'(x_0)$$ $$p''(x_0)=f''(x_0)$$ up to $$p^{(n)}(x_0)=f^{(n)}(x_0)$$
Suppose $$p(x) = a_0 + a_1(x-x_0) + a_2(x-x_0)^2+ ...+ a_n ( x-x_0)^n$$
For $x=x_0$ we get $$p(x_0) = a_0 = f(x_0)$$
$$p'(x_0) = a_1 = f'(x_0)$$ $$p''(x_0) = 2a_2 = f''(x_0)\implies a_2 = (1/2)f''(x_0)$$
Similarly you get $$a_n = (1/{n!})f^{(n)}(x_0)$$