There is a theorem that the power series can be integrated term by term over any closed and bounded interval contained in the interval of convergence.
I assume I am using this theorem when I obtain the series expansion of $ \tan^{-1} (x)$ by integrating each term in the power series expansion of $ \frac{1}{1+x^2} $. But this theorem fails me when I apply it to the power series expansion of $ \ e^x $
Since $$ e^x=1+x+\frac{x^2}{2!}+\frac{x^3}{3!}.....(1) $$ Now integrating both sides $$ \int e^xdx=\int 1\ dx+\int x\ dx+\int \frac{x^2}{2!}\ dx....$$ $$ e^x=x+\frac{x^2}{2!}+\frac{x^3}{3!}....(2) $$ I belive eq (1) and eq(2) are different. I know that I haven't added the constant of integration. That is because as I mentioned earlier the series expansion of $ tan^{-1}x $ i obtained by integration of series expansion of $ \frac{1}{1+x^2} $ and no integration constant was added there. And I know that expansion is correct because I got that from "tom apostol calculus 1" $$ \int\frac{1}{1+x^2}=\int1-\int x^2+\int x^4-\int x^6.... (3)$$ $$ tan^{-1}x=x-\frac{x^3}{3}+\frac{x^5}{5}......(4) $$ So how is eq (4) supposed to be right if eq(2) is wrong.