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

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

Can someone point me to a proof, or explain if it's a simple answer?

What I'm looking for is the point where it becomes understood that trigonometric functions and pi can be expressed as series. A lot of the information I find when looking for that seems to point back to arctan.

• Based on the answers, perhaps what I'm really looking for is the proof that the derivative of arctan is $\frac{1}{1+x^2}$. Mar 29, 2011 at 3:39
• The derivative of $arctan x$ follows from: \begin{align}f \circ f^{-1} (x) = x &\Longrightarrow f'(f^{-1}(x)) \cdot (f^{-1})'(x) = 1 \\ &\Longrightarrow (f^{-1})'(x) = 1 /f'(f^{-1}(x)) \end{align} (assuming all terms appearing exist of course. Now use $f(x) = \tan x$. Mar 29, 2011 at 3:48
• This video cleared it up for me. youtube.com/watch?v=tky25AUK7Io Mar 29, 2011 at 4:45
• That $\arctan'(x)=1/(1+x^2)$ may be a definition. That depends on what you chose as a starting point for the construction of so-called "elementary functions". One such construction starts with the complex exponential, another starts from the definition of arctan and log as antiderivatives of respectively $1/(1+x^2)$ and $1/x$. There are still other ways to proceed. Apr 13, 2015 at 13:51
• the weird thing is it is the same series as the sin of x :O Mar 26, 2020 at 20:23

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.

• Alternating series test would be much simpler in this case. Apr 22, 2014 at 12:23
• Indeed, the power series converges at x = 1. But why is this equal to arctan(1) since the expansion for 1/(1+x^2) does not hold at x = 1? Apr 22, 2016 at 16:30
• But why is $arctan(x)$ at $x=0$ not $arctan(0)=0$? Sep 17, 2016 at 10:30
• Note: It follows from Abel's theorem that, for example, $\arctan(1)$ will equal the value of the power series evaluated at $x=1$. This is a subtlety that is glossed over in most calculus textbooks. Jul 14, 2017 at 17:35
• @JohnDo: If you read what I say first, I say that because it is a Taylor series, you can integrate term by term. The fact that it is a Taylor series is what justifies the integration term by term, and that by itself also shows that the function is continuous: the Taylor series defines a continuous, infinitely differentiable function in its interval of convergence. So, no; I don't have to give any extra arguments and I don't have to show it is continuous, because all of that is already taken care of. Sep 26, 2017 at 22:42

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$$

• I like this answer for including an elementary proof that the series converges (and to the correct value) even at $x = \pm1$. Feb 12, 2018 at 10:16
• @TobyBartels could you explain why $\int_0^x\frac{1}{1+t^2}dt=\int_0^x\sum_{k=0}^n(-t^2)^k+\frac{(-t^2)^{n+1}}{1+t^2}dt$ ? I don't quite get how it's derived
– user634512
Apr 26, 2020 at 23:15
• @ThePoorJew : This is really user463551's answer; I just fixed some minor errors. Come to think of it, there's a minor error in the part that you quote; there should be parentheses around the part on the right-hand side between the integral symbol and the differential. (I've just submitted an edit to fix that.) So the real question is why that expression equals $1/(1+t^2)$. Anyway, I can answer that. Apr 29, 2020 at 15:02
• @ThePoorJew : It follows from the finitary geometric series $\sum_{k=0}^nr^k=(1-r^{n+1})/(1-r)$, which you can prove by induction (although it's probably more enlightening to multiply $1-r$ by $1+r+r^2+\cdots+r^{n-1}+r^n$ and watch how the terms cancel). From this, you get $1/(1-r)=\sum_{k=0}^nr^k+r^{n+1}/(1-r)$; now apply this when $r=-t^2$ to get $1/(1+t^2)=\sum_{k=0}^n(-t^2)^k+(-t^2)^{n+1}/(1+t^2)$ as desired. Apr 29, 2020 at 15:02
• @TobyBartels thank you!
– user634512
Apr 29, 2020 at 16:25

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.

Many of the functions you encounter on a regular basis are analytic functions, meaning that they can be written as a Taylor series or Taylor expansion. A Taylor series of $f(x)$ is an infinite series of the form $\sum_{i=0}^\infty a_ix^i$ which satisfies $f(x) = \sum_{i=0}^\infty a_ix^i$ wherever the series converges. Trigonometric functions are examples of analytic functions, and the series you are asking about is the Taylor series of $\operatorname{arctan}(x)$ about $0$ (the meaning of this is explained in the link). You can read more about Taylor series here.

Marty Cohen's answer gives an explanation for the following fact: $$\frac{d}{dx} \arctan(x) = \frac{1}{1+x^2}$$ Here is an alternative explanation.

Let $y = \arctan(x)$, and try to find $\frac{dy}{dx}$. We have $$y = \arctan(x)$$ $$\tan(y) = \tan(\arctan(x))$$

We'd like to simplify the right-hand side. The definition of $\arctan(x)$ is: $$\arctan(x) = \textrm{the angle between }-\frac{\pi}{2} \textrm{ and } \frac{\pi}{2}\textrm{ whose tangent is } x.$$ So whatever $\arctan(x)$ is, its tangent must be $x$. That is, $$\tan(\arctan(x)) = x.$$ So we have $$\tan(y) = x$$ Now differentiate both sides with respect to $x$ (this is called implicit differentiation): $$\frac{d}{dx} \tan(y) = \frac{d}{dx} x$$ $$\sec^2(y) \frac{dy}{dx} = 1$$ $$\frac{dy}{dx} = \cos^2(y)$$ $$\frac{d}{dx}\arctan(x) = \cos^2(\arctan(x))$$ But it turns out that $\cos^2(\arctan(x)) = \frac{1}{{1+x^2}}$. To see this, you can draw a right triangle with vertices at $(0,0), (1, 0)$, and $(1, x)$. The angle at the origin is $\arctan(x)$, and you can easily compute its cosine. (Try it!)

Or, you can try some algebra. Using the notation from above, we have $$\tan(y) = x$$ $$\frac{\sin(y)}{\cos(y)} = x$$ $$\sin(y) = x\cos(y)$$ $$\sin^2(y) = x^2\cos^2(y)$$ $$1-\cos^2(y) = x^2 \cos^2(y)$$ $$1 = \cos^2(y)(1 + x^2),$$ $$\frac{1}{1 + x^2} = \cos^2(y),$$ as desired.

Differentiate $\arctan(x)$ and evaluate it at $x=0$. Repeat. Divide the $n$th term by $n!$. You should get the series. Uh, it might be useful to note that
$$\frac{1}{1+x^2} = 1-x^2 +x^4-x^6+x^8 ...$$

There might have been too many answers but I would like to add my favorite one:

Let $$y = \arctan x$$. We know that $$y' = \frac{1}{x^2 + 1}$$, hence $$y'(x^2+1) = 1$$ (*).

Now differentiate the equation (*) $$n - 1$$ times ($$n > 1$$), with Newton-Leibniz rule we have: $$(x^2 + 1) y^{(n)} + 2 (n - 1) x y^{(n-1)} + (n - 1)(n - 2) y^{(n-2)}.$$

We set $$x = 0$$, and get: $$y^{(n)} = - (n - 1)(n - 2) y^{(n-2)},$$

Notice that $$y(0) = 0$$, $$y'(0) = 1$$, $$y^{(2k + 1)} = (-1)^k (2k)! \qquad y^{(2k)} = 0.$$

Therefore we finally get the Taylor's series: $$\arctan x = \sum_{k \in \mathbb N} (-1)^k \frac{x^k}{2k + 1}.$$

You can show that this series converges for $r = 1$ using the alternating series test. The sequence of the absolute values of the terms of this series is monotonically decreasing and approach zero. Hence the series converges for $r = 1$.

Also roughly speaking you need ten times as many terms in the partial sums for the approximation of pi to be one decimal place more accurate. i.e. If if the first 100 terms have about two decimal places of accuracy, then the first 1000 will give you about three decimal places of accuracy. Thus, the current record of 12 trillion digits would require a summation of about $10^{12000000000000}$ terms with this series.

• I assume that you mean $x = 1$, not $r = 1$ (and in fact your argument works whenever $0 \leq x \leq 1$). This doesn't answer the question (even for $x = 1$), since it doesn't explain why the sum is $\arctan(x)$. But you make a good point about the approximation provided for $\pi/4$. (You can get a much better result for $\pi$ using $x = 1/\sqrt{3}$ instead.) Feb 12, 2018 at 10:42