How to derive the Taylor's theorem logically? I can't understand how derive the Talyor's theorem logically: 

Well, the first two terms are quite easy to think of as $f(a)$ + correction term (i.e. slope times change in x-coordinate: $(x-a)$. But how to derive the other correction terms just by logic?
 A: In principle, there are two ways to approach this question: the traditional, though less natural, way from real analysis, or the more natural way from complex analysis. I'll outline them in that order, feel free to ignore the second part, if you aren't ready for it, yet, but always remember: power series live in the complex domain.
From the point of view of real analysis, a Taylor expansion simply comes from the repeated integration of a derivative. Suppose we know $f^{(n+1)}(x)$ exists and is bounded in some interval containing $a$. Then, we have
$$f^{(n)}(x)-f^{(n)}(a)=\int^x_af^{(n+1)}(t)\,dt.$$ Integrating both sides from $a$ to $x$, again, we get
$$f^{(n-1)}(x)-f^{(n-1)}(a)-f^{(n)}(a)(x-a)=\int^x_a\int^u_af^{(n+1)}(t)\,dt\,du.$$ Under our assumptions, that's a double integral over the region $\left\{(t,u): a\le t\le u\le x \right\},$ so we can change the order of integration:$$\int^x_a\int^u_af^{(n+1)}(t)\,dt\,du=\int^x_a\int^x_tf^{(n+1)}(t)\,du\,dt=\int^x_a(x-t)\,f^{(n+1)}(t)\,dt.$$ Integrating again and again (and using the same trick of changing the order of integration), we finally arrive at
$$f(x)-f(a)-f'(a)(x-a)-\ldots-\frac1{n!}\,f^{(n)}(a)(x-a)=\frac1{n!}\,\int^x_a(x-t)^n\,f^{(n+1)}(t)\,dt.$$
So we have $$f(x)=f(a)+f'(a)(x-a)+\ldots+\frac1{n!}\,f^{(n)}(a)(x-a)+\frac1{n!}\,\int^x_a(x-t)^n\,f^{(n+1)}(t)\,dt,$$ the Taylor expansion, together with a convenient error term, if we happen to know a bound for $f^{(n+1)}(t)$ in an interval around $a$.
Now, let's have a look at things from a complex point of view (spoiler warning: if your professor didn't tell you about complex analysis, yet, stop reading here, please):
Let's assume that $f(z)$ is analytic in some open domain $D$ in the complex plane. As we know, it's sufficient that the complex derivative $f'(z)$ exists in $D$. Then, we have the famous formula $$f(z)=\frac1{2\pi i}\,\oint\frac{f(t)}{t-z}\,dt,\tag1$$ where we integrate along a closed contour entirely inside $D$, in positive sense (that's the most important formula in complex analysis, in my humble opinion). We can differentiate this, and rightly so, because everything is absolutely and uniformly convergent, as long as $z$ stays in a closed subset inside our contour of integration, so we get $$f^{(n)}(z)=\frac{n!}{2\pi i}\,\oint\frac{f(t)}{(t-z)^{n+1}}\,dt.\tag2$$
But let's return to (1): For some $a$ inside our contour of integration, we have the well-known geometric series
$$\frac1{t-z}=\frac1{(t-a)-(z-a)}=\sum^\infty_{n=0}\frac{(z-a)^n}{(t-a)^{n+1}}$$ (and once again, everything converges absolutely and uniformly in a closed subset inside our contour of integration) so (1) becomes $$f(z)=\sum^\infty_{n=0}\left(\oint\frac{f(t)}{(t-a)^{n+1}}\,dt\right)\,(z-a)^n=\sum^\infty_{n=0}\frac{f^{(n)}(a)}{n!}\,(z-a)^n,$$ according to (2). And the nice thing is: we don't need no fancy ratio or $n$th root criteria, it's clear from the derivation that the natural radius of convergence is exactly the distance from $a$ to the next best singularity of $f(z)$: as long as $z$ stays in a circle around $a$ entirely inside $D$, everything is fine.
