Why is $\arctan(x)=x-x^3/3+x^5/5-x^7/7+\dots$?

The derivative of the arc tangent is $$\frac{d}{dx}\arctan(x) = \frac{1}{1+x^2}.$$

From the formula for geometric series (see for example this answer for a proof) shows that $$1+y+y^2+y^3+\cdots = \frac{1}{1-y}\qquad\text{if }|y|\lt 1.$$ Plugging in $-x^2$ for $y$, we get that $$\begin{align*} \frac{1}{1+x^2} &= \frac{1}{1-(-x^2)} \\ &= 1 + (-x^2) + (-x^2)^2 + (-x^2)^3 + \cdots + (-x^2)^n + \cdots\\ &= 1 - x^2 + x^4 - x^6 + x^8 - x^{10} + \cdots \end{align*}$$ provided that $|-x^2| \lt 1$; that is, provided $|x|\lt 1$. All the computations below are done under this hypothesis (see comments at the end).

So we have that: $$\frac{d}{dx}\arctan(x) = 1 - x^2 + x^4 - x^6 + x^8 - x^{10}+\cdots\qquad\text{if }|x|\lt 1$$ Because this is a Taylor series, it can be integrated term by term. That is, up to a constant, we have: $$\begin{align*} \arctan(x) &= \int\left(\frac{d}{dx}\arctan (x)\right)\,dx \\ &= \int\left(1 - x^2 + x^4 - x^6 + x^8 - x^{10}+\cdots\right)\,dx\\ &= \int\left(\sum_{n=0}^{\infty}(-1)^{n}x^{2n}\right)\,dx\\ &= \sum_{n=0}^{\infty}\left(\int (-1)^{n}x^{2n}\,dx\right)\\ &= \sum_{n=0}^{\infty}\left((-1)^{n}\int x^{2n}\,dx\right)\\ &= \sum_{n=0}^{\infty}\left((-1)^{n}\frac{x^{2n+1}}{2n+1}\right) + C\\ &= C + \left( x - \frac{x^3}{3} + \frac{x^5}{5} - \frac{x^7}{7} + \frac{x^9}{9} - \frac{x^{11}}{11} +\cdots\right). \end{align*}$$ Evaluating at $x=0$ gives $0 = \arctan(0) = C$, so we get $$\arctan(x) = x - \frac{x^3}{3} + \frac{x^5}{5} - \frac{x^7}{7} + \frac{x^9}{9} - \frac{x^{11}}{11} + \cdots,\qquad\text{if }|x|\lt 1.$$ the equality you ask about.

Note however that this does not hold for all $x$: it certainly works if $|x|\lt 1$, by the general properties of Taylor series. But the arc tangent is defined for all real numbers. The series we have here is $$\sum_{n=0}^{\infty}(-1)^{n}\frac{x^{2n+1}}{2n+1}.$$ Using the Ratio Test, we have that $$\begin{align*} \lim_{n\to\infty}\frac{|a_{n+1}|}{|a_n|} &= \lim_{n\to\infty}\frac{\quad\frac{|x|^{2n+3}}{2n+3}\quad}{\frac{|x|^{2n+1}}{2n+1}}\\ &= \lim_{n\to\infty}\frac{(2n+1)|x|^{2n+3}}{(2n+3)|x|^{2n+1}}\\ &= \lim_{n\to\infty}\frac{|x|^2(2n+1)}{2n+3}\\ &= |x|^2\lim_{n\to\infty}\frac{2n+1}{2n+3}\\ &= |x|^2. \end{align*}$$ By the Ratio Test, the series converges absolutely if $|x|^2\lt 1$ (that is, if $|x|\lt 1$) and diverges if $|x|\gt 1$. At $x=1$ and $x=-1$, the series is known to converge. So the radius of convergence is $1$, and the equality is valid for $x\in [-1,1]$ only (that is, if $|x|\leq 1$; we gained two points in the process).

However, the arc tangent has a nice property, namely that $$\arctan\left(\frac{1}{x}\right) = \frac{\pi}{2} - \arctan(x),$$ So, given a value of $x$ with $|x|\gt 1$, you can use this identity to compute $\arctan(x)$ by computing $\arctan(\frac{1}{x})$ instead, and for this argument the series is valid.


Well the usual way to get this series representation for the $\arctan$ is to use the geometric series

$$\sum_{n=0}^{\infty} x^n = \frac{1}{1 - x}$$

and then substitute $-x^2$ in it to get

$$\sum_{n=0}^{\infty} (-1)^n x^{2n} = \frac{1}{1 + x^2}$$

Now the next step is to integrate both sides and then you get

$$\arctan{x} = \int \frac{1}{1 + x^2} \, dx = \sum_{n=0}^{\infty} (-1)^n \frac{x^{2n + 1} }{2n + 1} + C$$

and you can easily show that the constant $C = 0$. You can find this done in almost any calculus book, it's one of the classic series that most calculus students must know I guess.


Using $$\sum_{k=0}^n x^k=\frac{1-x^{n+1}}{1-x},$$

$$\tan^{-1}(x)=\int_0^x\frac{1}{1+t^2}dt=\int_0^x\left(\sum_{k=0}^n(-t^2)^k+\frac{(-t^2)^{n+1}}{1+t^2}\right)dt.$$ This implies that $$\tan^{-1}(x)=\sum_{k=0}^n(-1)^k\frac{x^{2k+1}}{2k+1}+R_n(x)$$ where $$R_n(x)=\int_0^x\frac{(-t^2)^{n+1}}{1+t^2}dt$$ Since $$|R_n(x)|\le\int_{\min(0,x)}^{\max(0,x)}\left|\frac{(-1)^{n+1}t^{2n+2}}{1+t^2}\right|dt\le \int_{\min(0,x)}^{\max(0,x)}\frac{t^{2n+2}}{t^2}dt=\frac{|x|^{2n+1}}{2n+1}$$ So for $-1\le x\le 1$ it follows that $R_n(x)\to 0$ when $n\to\infty$. Consequently $$\tan^{-1}(x)=\sum_{k=0}^\infty(-1)^k\frac{x^{2k+1}}{2k+1}\quad {-1}\le x\le 1$$


Let $f(x)=\arctan(x)$. Then $f'(x)=\frac{1}{1+x^2}$ and $f(0)=0$, so by the fundamental theorem of calculus, $f(x)=\int_0^x\frac{dt}{1+t^2}$ for all $x$. When $|t|<1$, the integrand can be expressed as a geometric series $\frac{1}{1+t^2}=1-t^2+t^4-t^6+t^8-\cdots$. This series converges uniformly on compact subintervals of $(-1,1)$, so when $|x|<1$ we can integrate term by term to get $$f(x)=\int_0^x 1-t^2+t^4-t^6+\cdots dt= x-\frac{x^3}{3}+\frac{x^5}{5}-\frac{x^7}{7}+\cdots.$$

(Adrián Barquero posted while I was writing.)

Here is a way to see that $f'(x)=\frac{1}{1+x^2}$. By definition of $\arctan$, $\tan(f(x))=x$ for all $x$. Taking the derivative of both sides, using the chain rule on the left-hand side, yields $\tan'(f(x))\cdot f'(x)=1$. Now $\tan'=\sec^2=1+\tan^2$, so $(1+\tan^2(f(x)))\cdot f'(x)=1\Rightarrow (1+x^2)f'(x)=1\Rightarrow f'(x)=\frac{1}{1+x^2}.$

A similar method gives the power series expansion for $g(x)=\arcsin(x)$. You have $g'(x)=(1-x^2)^{-1/2}$ and $g(0)=0$, so by the fundamental theorem of calculus, $g(x)=\int_0^x(1-t^2)^{-1/2}dt$ for all $x$ with $|x|<1$. The integrand can be expanded using the binomial theorem and integrated term by term to obtain the power series.


You can show that $\arctan'(x) =\frac1{1+x^2} $ from the functional equation $\arctan(x)-\arctan(y) =\arctan(\frac{x-y}{1+xy}) $ (gotten from $\tan(x+y) =\frac{\tan(x)+\tan(y)}{1-\tan(x)\tan(y)} $).

$\begin{array}\\ \arctan(x+h)-\arctan(x) &=\arctan(\frac{(x+h)-x}{1+(x+h)x})\\ &=\arctan(\frac{h}{1+(x+h)x})\\ \end{array} $

From $\sin(x) \approx x$ and $\cos(x) \approx 1-x^2/2$ for small $x$, $\arctan(x) \approx x$ so, for small $h$,

$\arctan(\frac{h}{1+(x+h)x}) \approx \frac{h}{1+x^2} $, so $\frac{\arctan(x+h)-\arctan(x)}{h} \approx \frac{1}{1+x^2} $.

Note how the $x^2$ (in $1+x^2$) comes from the $\tan(x)\tan(y)$ in the tangent addition formula.