Category Archives: Calculus

The Ratio, Root and Comparison Tests

d’Alembert-Cauchy Ratio Test

The following d’Alembert-Cauchy ratio test is one of the easiest to apply and is widely used.

Theorem (d’Alembert-Cauchy Ratio Test). Suppose that $\sum_{n=1}^\infty a_n$ is a series with positive terms.

  1. If $\lim_{n\to\infty}\frac{a_{n+1}}{a_n}<1$ then $\sum_{n=1}^\infty a_n$ converges.
  2. If $\lim_{n\to\infty}\frac{a_{n+1}}{a_n}>1$ then $\sum_{n=1}^\infty a_n$ diverges.
  3. If $\lim_{n\to\infty}\frac{a_{n+1}}{a_n}=1$ then $\sum_{n=1}^\infty a_n$ then the convergence is indeterminant, i.e., the ratio test provides no information regarding the convergence of the series $\sum_{n=1}^\infty a_n$.

Example. Test $\sum_{n=1}^\infty\frac{n}{2^n}$ for convergence.

Solution. \begin{align*}\lim_{n\to\infty}\frac{a_{n+1}}{a_n}&=\lim_{n\to\infty}\frac{\frac{n+1}{2^{n+1}}}{\frac{n}{2^n}}\\&=\lim_{n\to\infty}\frac{n+1}{2n}\\&=\frac{1}{2}<1\end{align*} Hence by the Ratio test the series converges.

Example. Test the convergence of the series $\sum_{n=1}^\infty\frac{n^n}{n!}$.

Hence, the series diverges.

Remark. There is an easier way to show the divergence of the series $\sum_{n=1}^\infty\frac{n^n}{n!}$.

Note that
$$a_n=\frac{n^n}{n!}=\frac{n\cdot n\cdot n\cdots n}{1\cdot 2\cdot 3\cdots n}\geq n.$$
This implies that $\lim_{n\to\infty}a_n=\infty$. Hence by the Divergence Test the series diverges.

Cauchy Root Test

Theorem (Cauchy Root Test). Suppose that $\sum_{n=1}^\infty a_n$ be a series with positive terms.

  1. If $\lim_{n\to\infty}\root n\of{a_n}=r<1$ then $\sum_{n=1}^\infty a_n$ converges.
  2. If $\lim_{n\to\infty}\root n\of{a_n}=r> 1$ then $\sum_{n=1}^\infty a_n$ diverges.
  3. If $\lim_{n\to\infty}\root n\of{a_n}=r=1$ then the test fails, i.e., the root test is inclusive.

Example. Test the convergence of the series $\sum_{n=1}^\infty\left(\frac{2n+3}{3n+2}\right)^n$.

Solution. \begin{align*}\lim_{n\to\infty}\root n\of{a_n}&=\lim_{n\to\infty}\root n\of{\left(\frac{2n+3}{3n+2}\right)^n}\\&=\lim_{n\to\infty}\frac{2n+3}{3n+2}\\&=\frac{2}{3}<1\end{align*}Hence by the Root Test the series converges.

Comparison Test

Theorem (Comparison Test). Suppose that $\sum_{n=1}^\infty a_n$ and $\sum_{n=1}^\infty b_n$ be series with positive terms.

  1. If $\sum_{n=1}^\infty b_n$ converges and $a_n\leq b_n$ for all $n$, then $\sum_{n=1}^\infty a_n$ also converges.
  2. If $\sum_{n=1}^\infty b_n$ diverges and $b_n\leq a_n$ for all $n$, then $\sum_{n=1}^\infty a_n$ also diverges.

Remark. For a convergent series we have the geometric series, whereas the harmonic series will serve as a divergent series. As other series are identified as either convergent or divergent, they may be used for the known series in this comparison test.

Example. Determine whether the series $\sum_{n=1}^\infty\frac{5}{2n^2+4n+3}$ converges.

Solution. Notice that $\frac{5}{2n^2+4n+3}<\frac{5}{n^2}$ for all $n$. Since $\sum_{n=1}\frac{1}{n^2}$ converges (it is a $p$-series with $p=2$), by the Comparison Test the series converges.

Example. Test the series $\sum_{n=1}^\infty\frac{\ln n}{n}$ for convergence or divergence.

Solution. $\left(\frac{\ln x}{x}\right)’=\frac{1-\ln x}{x}<0$ on $(e,\infty)$ i.e. $\frac{\ln n}{n}>\frac{1}{n}$ for all $n\geq 3$. Since $\sum_{n=1}^\infty\frac{1}{n}$ diverges (the harmonic series, also $p$-series with $p=1$), by the Comparison Test, the series diverges.

Example (The $p$ series). Let $p\leq 1$ Then
$\frac{1}{n}<\frac{1}{n^p}$ for all $n$, so by the Comparison Test
$\sum_{n=1}^\infty\frac{1}{n^p}$ is divergent for all $p\leq 1$.

The Limit Comparison Test

The Limit Comparison Test is a variation of the Comparison Test.

Theorem (The Limit Comparison Test). Suppose that $\sum_{n=1}^\infty a_n$ and $\sum_{n=1}^\infty b_b$ are series with positive terms. If $$\lim_{n\to\infty}\frac{a_n}{b_n}=c$$ where $c$ is a number and $c>0$, then either both series converge or both diverge.

Example. Test the series $\sum_{n=1}^\infty\frac{1}{2^n-1}$ for convergence or divergence.

Solution. Let $a_n=\frac{1}{2^n-1}$ and $b_n=\frac{1}{2^n}$. Then \begin{align*}\lim_{n\to\infty}\frac{a_n}{b_n}&=\lim_{n\to\infty}\frac{2^n}{2^n-1}\\&=\lim_{n\to\infty}\frac{1}{1-\frac{1}{2^n}}\\&=1>0\end{align*} Since $\sum_{n=1}^\infty\frac{1}{2^n}$ converges, so should $\sum_{n=1}^\infty\frac{1}{2^n-1}$ by the Limit Comparison Test.

Example. Test the series $\sum_{n=1}^\infty\frac{1}{\sqrt{n^2+1}}$ for convergence or divergence.

Solution. Let $a_n=\frac{1}{\sqrt{n^2+1}}$ and $b_n=\frac{1}{n}$. Then \begin{align*}\lim_{n\to\infty}\frac{a_n}{b_n}&=\lim_{n\to\infty}\frac{n}{\sqrt{n^2+1}}\\&=\lim_{n\to\infty}\frac{1}{\sqrt{1+\frac{1}{n^2}}}\\&=1>0\end{align*} Since $\sum_{n=1}^\infty\frac{1}{n}$ diverges, so should $\sum_{n=1}^\infty\frac{1}{\sqrt{n^2+1}}$ by the Limit Comparison Test.

Cauchy-Maclaurin Integral Test

Theorem (Cauchy-Maclaurin Integral Test)

Let $f(x)$ be a continuous, positive, decreasing function on $[1,\infty)$ in which $f(n)=a_n$. Then $\sum_{n=1}^\infty a_n$ converges if $\int_1^\infty f(x)dx$ is finite and diverges if the integral is infinite.

Proof. Using the left-end point method as seen in Figure 1

Figure 1. Integral Test

we see that $$a_1+a_2+\cdots+a_{n-1}\geq \int_1^nf(x)dx$$ This means that if $\int_1^{\infty}f(x)dx$ is infinite, $\sum_{n=1}^\infty a_n$ diverges. Now using the right-end point method as seen in Figure 2

Figure 2. Integral Test

we see that $$a_2+a_3+\cdots+a_n\leq\int_1^n f(x)dx$$ This means that if $\int_1^\infty f(x)dx$ is finite, then $\sum_{n=1}^\infty a_n$ converges. This completes the proof.

Example (The $p$-series).
For what values of $p$ is the series $\sum_{n=1}^\infty\frac{1}{n^p}$ convergent?

Solution. If $p<0$ then $\lim_{n\to\infty}\frac{1}{n^p}=\infty$. If $p=0$ then $\lim_{n\to\infty}\frac{1}{n^p}=1$. In either case, $\lim_{n\to\infty}\frac{1}{n^p}\ne 0$, so the series diverges. If $p>0$ then the function $f(x)=\frac{1}{x^p}$ is continuous, positive and decreasing on $[1,\infty)$.
\left.\frac{x^{-p+1}}{-p+1}\right|_1^\infty & {\rm if} & p\ne 1,\\
\ln x|_1^\infty & {\rm if} & p=1.
Therefore the series converges if $p>1$ and diverges if $p\leq 1$.

Example. Test the series $\sum_{n=1}^\infty\frac{1}{n^2+1}$ for convergence or divergence.

Solution. $f(x)=\frac{1}{x^2+1}$ is continuous, positive and decreasing on $[1,\infty)$. \begin{align*}\int_1^\infty\frac{1}{x^2+1}dx&=\left.\arctan x\right|_1^\infty\\&=\arctan \infty-\arctan 1\\&=\frac{\pi}{4}\end{align*} Therefore, by the Integral Test the series converges.

Example. Determine whether $\sum_{n=1}^\infty\frac{\ln n}{n}$ converges or diverges.

Solution. $f(x)=\frac{\ln x}{x}$ is continuous, positive and decreasing on $[3,\infty)$. (One can easily check $f(x)$ is decreasing on $(e,\infty)$ by its derivative $f'(x)$.) \begin{align*}\int_3^\infty\frac{\ln x}{x}dx&=\frac{1}{2}\left.(\ln x)^2\right|_3^\infty\\&=\infty\end{align*} Therefore, $\sum_{n=1}^\infty \frac{\ln n}{n}$ diverges.

Theorem (Remainder Estimate for the Integral Test)
If $\sum_{n=1}^\infty a_n$ converges by the Integral Test and $R_n=S-s_n$, then
\begin{equation}\label{eq:remest}\int_{n+1}^\infty f(x)dx\leq R_n\leq\int_n^\infty f(x)dx\end{equation}

Proof. Using the left-end point method we obtain $$R_n=a_{n+1}+a_{n+2}+\cdots\geq\int_{n+1}^\infty f(x)dx$$ as seen in Figure 3.

Figure 3. Remainder Estimate

Now using the right-end point method we obtain $$R_n=a_{n+1}+a_{n+2}+\cdots\leq\int_n^\infty f(x)dx$$ as seen in Figure 4.

Figure 4. Remainder Estimate

Hence proves \eqref{eq:remest}.


  1. Approximate the sum of the series $\sum_{n=1}^\infty\frac{1}{n^3}$ by using the sum of the first 10 terms. Estimate the error involved in this approximation.
  2. How many terms are required to ensure that the sum is accurate to within $0.0005$?

Solution. First we calculate $$\int_n^\infty\frac{1}{x^3}dx=\frac{1}{2n^2}$$

  1. $s_{10}=\frac{1}{1^3}+\frac{1}{2^3}+\cdots+\frac{1}{10^3}\approx 1.197532$. By the remainder estimate \eqref{eq:remest} $$R_{10}\leq\int_{10}^\infty\frac{1}{x^3}dx=\frac{1}{200}=0.005$$ So the size of the error is at most 0.005.
  2. $R_n\leq\int_n^\infty\frac{1}{x^3}dx=\frac{1}{2n^2}$.  Suppose $\frac{1}{2n^2}<0.0005$. Then we find $n>\sqrt{1000}\approx 31.6$. This means we need 32 terms to guarantee accuracy to within 0.0005.

Corollary. \begin{equation}\label{eq:sumest}s_n+\int_{n+1}^\infty f(x)dx\leq s\leq s_n+\int_n^\infty f(x)dx\end{equation}

Proof. Add $s_n$ to each side of the inequalities in \eqref{eq:remest}

Example. Use the inequality \eqref{eq:sumest} with $n=10$ to estimate the sum of the series $\sum_{n=1}^\infty\frac{1}{n^3}$.

Solution. Using \eqref{eq:sumest} for $n=10$ we have $$s_{10}+\int_{11}^\infty\frac{1}{x^3}dx\leq s\leq s_{10}+\int_{10}^\infty\frac{1}{x^3}dx$$ i.e. $$s_{10}+\frac{1}{2(11)^2}\leq s\leq s_{10}+\frac{1}{2(10)^2}$$ Hence we get $$1.201664\leq s\leq 1.202532$$ We can approximate $s$ by taking the midpoint of this interval (i.e. the average of the boundary points) which is $s\approx 1.2021$. The error is then at most half the length of the interval i.e. the error is smaller than 0.0005. Recall that we had to use 32 terms to make error smaller than 0.0005 in the previous example but in this example we needed only 10 terms. So we can obtain a much improved estimate using \eqref{eq:sumest} than using $s_n$.

Infinite Series

Definition. Let $a_1,a_2,\cdots,a_n\cdots$ be any sequence of quantities. Then the symbol
\sum_{n=1}^\infty a_n=a_1+a_2+\cdots+a_n+\cdots
is called an infinite series. Let
The numbers $s_n$ is called the $n$-th partial sums of the series \eqref{eq:series}.

Definition. An infinite series $\sum_{n=1}^\infty a_n$ is said to converge if the sequence of partial sums $\{s_n\}$ converges i.e. $\sum_{n=1}^\infty a_n=s<\infty$ means that for any $\epsilon>0$ there exists a positive integer $N$ such that
$$|s_n-s|<\epsilon\ \mbox{for all}\ n\geq N$$ A series which does not converge is said to diverge.

Remark. It should be noted that there is no unique way to define the sum of an infinite series. While the definition we use is the conventional one, there are other ways to define the sum of an infinite series. Some of the divergent series according to the conventional definition may converge with a different definition. Although it may seem outrageous it can be shown that $1+2+3+\cdots=-\frac{1}{12}$. It was first proved by the genius Indian mathematician Srinivasa Ramanujan. If you have a Netflix account, you can watch a biographical movie about Ramanujan. The movie title is The Man Who Knew Infinity which is based on a biography by Robert Kanigel The Man Who Knew Infinity: A Life of the Genius Ramanujan. I find divergent series fascinating. In case you are interested, I wrote about divergent series in blog articles here and here.

Proposition. If $\sum_{n=1}^\infty a_n$ converges, then $\lim_{n\to\infty}a_n=0.$

Note that the converse of the proposition is not necessarily true. See the example on harmonic series below. The proposition, more precisely its contrapositive

If $\lim_{n\to\infty}a_n\ne 0$, then $\sum_{n=1}^\infty a_n$ diverges.

can be used as a divergence test for series. For example, the series $\sum_{n=1}^\infty\frac{n}{n+1}$ diverges because $\lim_{n\to\infty}\frac{n}{n+1}=1\ne 0$.

Theorem (Cauchy’s Criterion for the Convergence of a Sequence).
A necessary and sufficient condition for the convergence of a sequence $\{a_n\}$ is that for any $\epsilon>0$ there exists a positive integer $N$ such that
$$|a_n-a_m|<\epsilon\ \mbox{for all}\ n,m\geq N.$$

Corollary (Cauchy’s Criterion for the Convergence of a Series).
A necessary and sufficient condition for the convergence of a series $\sum_{n=1}^\infty u_n$ is that for any $\epsilon>0$ there exists a positive integer $N$ such that
$$|s_n-s_m|<\epsilon\ \mbox{for all}\ n,m\geq N.$$

Example (The Geometric Series).
The geometric sequence, starting with $a$ and ratio $r$, is given by
$$a, ar,ar^2,\cdots,ar^{n-1},\cdots.$$
The $n$th partial sum is given by
Taking the limit as $n\to\infty$,
$$\lim_{n\to\infty}s_n=\frac{a}{1-r}\ \mbox{for}\ -1<r<1.$$
Hence the infinite geometric series converges for $-1<r<1$ and is given by
$$\sum_{n=1}^\infty ar^{n-1}=\frac{a}{1-r}.$$
On the other hand, if $r\leq -1$ or $r\geq 1$ then the infinite series diverges.

Example (The Harmonic Series).
Consider the harmonic series
Group the terms as
Then each pair of parentheses encloses $p$ terms of the form
Forming partial sums by adding the parenthetical groups one by one, we obtain
$$s_1=1, s_2=1+\frac{1}{2}, s_4>1+\frac{2}{2}, s_8>1+\frac{3}{2}, s_{16}>1+\frac{4}{2},\cdots, s_{2^n}>1+\frac{n}{2},\cdots.$$
This shows that $\lim_{n\to\infty}s_{2^n}=\infty$ and so $\{s_n\}$ diverges. Therefore, the harmonic series diverges.

Example. The following type of series are called telescoping series. #2 is left as an exercise.

  1. Show that
    $$\sum_{n=1}^\infty\frac{1}{(2n-1)(2n+1)}=\frac{1}{2}$$ Solution. \begin{align*}s_n&=\sum_{k=1}^n\frac{1}{(2k-1)(2k+1)}\\&=\frac{1}{2}\sum_{k=1}^n\left(\frac{1}{2k-1}-\frac{1}{2k+1}\right)\\&=\frac{1}{2}\left(1-\frac{1}{2n+1}\right)\\&=\frac{n}{2n+1}\end{align*} and $\lim_{n\to\infty}s_n=\frac{1}{2}$.
  2. Show that $$\sum_{n=1}^\infty\frac{1}{n(n+1)}=1$$


Definition. A succession of real numbers $$a_1,a_2,\cdots,a_n,\cdots$$ in a definite order is called a sequence. $a_n$ is called the $n$-th term or the general term. The sequence $\{a_1,a_2,\dots,a_n,\cdots\}$ is denoted by $\{a_n\}$ or $\{a_n\}_{n=1}^\infty$.


  1. The set of natural numbers $1,2,3,4,\cdots,n,\cdots$
  2. $1,-2,3,-4,\cdots,(-1)^{n-1}n,\cdots$
  3. $\frac{1}{2},-\frac{1}{4},\frac{1}{8},-\frac{1}{16},\cdots,(-1)^{n-1}\frac{1}{2^n},\cdots$
  4. $0,1,0,1,\cdots,\frac{1}{2}[1+(-1)^n],\cdots$
  5. $2,3,5,7,11,\cdots,p_n,\cdots$

It is not essential that the general term of a sequence is given by some simple formula as is the case in the first four examples above. The sequence in 5 represents the succession of prime numbers. $p_n$ stands for the $n$-th prime number. There is no formula available for the determination of $p_n$.

The following is the quantifying definition of the limit of a sequence due to Augustin-Louis Cauchy.

Definition. A sequence $\{a_n\}$ has a limit $L$ and we write $\lim_{n\to\infty}a_n=L$ or $a_n\to L$ as $n\to\infty$ if for any $\epsilon>0$ there exists a positive integer $N$ such that $$|a_n-L|<\epsilon\ \mbox{for all}\ n\geq N.$$


  1. Show that $\lim_{n\to\infty}\frac{1}{n}=0$
  2. Show that $\lim_{n\to\infty}\frac{1}{10^n}=0$
  3. Let $\{a_n\}$ be a sequence defined by $$a_1=0.3, a_2=0.33, a_3=0.333,\cdots,$$ show that $\lim_{n\to\infty}a_n=\frac{1}{3}$

Proof. I will prove 1. 2 and 3 are left as exercises. Let $\epsilon>o$ be given. Then $|a_n-L|=\frac{1}{n}<\epsilon\Longrightarrow n>\frac{1}{\epsilon}$. Choose $N$ a positive integer $\frac{1}{\epsilon}$. Then for all $n>N$ $|a_n-L|<\epsilon$.

The following limit laws allow us to break a complicated limit to simpler ones.

Theorem. Let $\lim_{n\to\infty}a_n=L$ and $\lim_{n\to\infty}b_n=M$. Then

  1. $\lim_{n\to\infty}(a_n\pm b_m)=L\pm M$
  2. $\lim_{n\to\infty}ca_n=cL$ where $c$ is a constant.
  3. $\lim_{n\to\infty}a_nb_n=LM$
  4. $\lim_{n\to\infty}\frac{a_n}{b_n}=\frac{L}{M}$ provided $M\ne 0$.

Example. Find $\lim_{n\to\infty}\frac{n}{n+1}$.

Solution. \begin{align*}\lim_{n\to\infty}\frac{n}{n+1}&=\lim_{n\to\infty}\frac{1}{1+\frac{1}{n}}=1\end{align*} since $\lim_{n\to\infty}\frac{1}{n}=0$.

The following theorem is also an important tool for calculating limits of certain sequences.

Theorem (Squeeze Theorem). If $a_n\leq b_n\leq c_n$ for $n\geq n_0$ and $\lim_{n\to\infty}a_n=\lim_{n\to\infty}c_n=L$ then $\lim_{n\to\infty}b_n=L$.

Corollary. If $\lim_{n\to\infty}|a_n|=0$ then $\lim_{n\to\infty}a_n=0$.

Proof. It follows from the inequality $-|a_n|\leq a_n\leq |a_n|$ for all $n$ and the Squeeze Theorem.

Example. Use the Squeeze Theorem to show $$\lim_{n\to\infty}\frac{n!}{n^n}=0$$

Solution. It follows from $$0\leq\frac{n!}{n^n}=\frac{1\cdot 2\cdot 3\cdots n}{n\cdot n\cdot n\cdots n}\leq\frac{1}{n}$$ for all $n$.

The following theorem enables you to use a cool formula you learned in Calculus II, L’Hôpital’s rule!

Theorem. If $\lim_{x\to\infty}f(x)=L$ and $f(n)=a_n$, then $\lim_{n\to\infty}a_n=L$.

Example. Calculate $\lim_{n\to\infty}\frac{\ln n}{n}$.

Solution. Let $f(x)=\frac{\ln x}{x}$. Then $\lim_{x\to\infty}f(x)$ is an indeterminate form of  type $\frac{\infty}{\infty}$. So by L’Hôpital’s rule \begin{align*}\lim_{x\to\infty}\frac{\ln x}{x}&=\lim{x\to\infty}\frac{(\ln x)’}{x’}\\&=\lim{x\to\infty}\frac{1}{x}\\&=0\end{align*} Hence by the Theorem above $\lim_{n\to\infty}\frac{\ln n}{n}=0$.

Example. Calculate $\lim_{n\to\infty}\root n\of{n}$.

Solution. Let $f(x)=x^{\frac{1}{x}}$. Then $\lim_{x\to\infty}f(x)$ is an indeterminate form of type $\infty^0$. As you learned in Calculus II, you will have to convert the limit into an indeterminate form of type $\frac{\infty}{\infty}$ or type $\frac{0}{0}$ so that you can apply L’Hôpital’s rule to evaluate the limit. Let $y=x^{\frac{1}{x}}$. Then $\ln y=\frac{\ln x}{x}$. As we calculated in the previous example, $\lim_{x\to\infty}\ln y=0$. Since $\ln y$ is continuous on $(0,\infty)$, $$\lim_{x\to\infty}\ln y=\ln(\lim_{x\to\infty} y)$$ Hence, $$\lim_{x\to\infty}x^{\frac{1}{x}}=e^0=1$$ i.e. $\lim_{n\to\infty}\root n\of{n}=1$.

Theorem. $\lim_{n\to\infty}\root n\of{a}=1$ for $a>0$.

Example. $\lim_{n\to\infty}\frac{1}{\root n\of{2}}=1$.

Definition. A sequence $\{a_n\}$ is said to diverge if it fails to converge. Divergent sequences include sequences that tend to infinity or negative infinity, for example $1,2,3,\cdots,n,\cdots$ and sequences that oscillates such as  $1,-1,1,-1,\cdots$.

Definition. A sequence $\{a_n\}$ is said to be bounded if there exists $M>0$ such that $|a_n|<M$ for every $n$.

Theorem. A convergent sequence is bounded but the converse need not be true.

Definition. A sequence $\{a_n\}$ is said to be monotone if it satisfies either $$a_n\leq a_{n+1}\ \mbox{for all}\ n$$ or $$a_n\geq a_{n+1}\ \mbox{for all}\ n$$

Equivalently, one can show that a sequence $\{a_n\}$ is monotone increasing by checking to see if it satisfies  $$\frac{a_{n+1}}{a_n}\geq 1\ \mbox{for all}\ n$$ or $$a_{n+1}-a_n\geq 0\ \mbox{for all}\ n$$

The following theorem is called the Monotone Sequence Theorem.

Theorem. A monotone sequence which is bounded is convergent.


  1. Show that the sequence $$\frac{1}{2},\frac{1}{3}+\frac{1}{4},\frac{1}{4}+\frac{1}{5}+\frac{1}{6},\cdots,\frac{1}{n+1}+\frac{1}{n+2}+\cdots+\frac{1}{2n},\cdots$$ is convergent.
  2. Show that the sequence $$1,1+\frac{1}{2},1+\frac{1}{2}+\frac{1}{4},\cdots,\frac{1}{2}+\frac{1}{4}+\cdots+\frac{1}{2^n},\cdots$$ is convergent.

Solution. 2 is left as an exercise. $a_{n+1}-a_n=\frac{1}{2n+2}+\frac{1}{2n+1}-\frac{1}{n+1}=\frac{4n+1}{(2n+2)(2n+1)}>0$ for all $n$. So it is monotone increasing. $$a_n=\frac{1}{n+1}+\cdots+\frac{1}{n+n}\leq\frac{1}{n}+\cdots+\frac{1}{n}=\frac{n}{n}=1$$ for all $n$. So it is bounded. Therefore, it is convergent by the monotone sequence theorem.

Solving a Functional Equation $x^y=y^x$

Here is another math problem proposed by Sam Walters, one of my favorite mathematicians on Twitter.

Sam used a trigger word for me “isn’t hard.” I took it as being easy enough so any undergraduate math student can solve (turns out it actually is) which means I should be able to solve it in no time. I spent some hours to solve the functional equation $x^y=y^x$ but I was still stuck with my wounded ego until I saw a hint from another mathematician Rob Corless in his reply to the above tweet. The answer lies in Lambert W function! It is shame but I didn’t know Lambert W function though I have seen it. The function $f(x)=xe^x$ is injective (one-to-one) so it is invertible but one cannot explicitly write it’s inverse function so we denote it by $W(xe^x)$ i.e. $x=f^{-1}(xe^x)=W(xe^x)$. This $W$ is called Lambert W function. First let us take natural logarithm of the equation $x^y=y^x$. With some rearrangements, we arrive at \begin{equation}\label{eq:funeq}\frac{\ln y}{y}=\frac{\ln x}{x}\end{equation} Equation \eqref{eq:funeq} is well defined by the conditions $x,y>1$. Clearly $y=x$ is a solution. Now we want to find a less trivial solution. Let us introduce a new variable $u$ which satisfies $y=\frac{1}{u}$. Then \eqref{eq:funeq} is written in terms of $u$ as \begin{equation}\label{eq:funeq2}u\ln u=-\frac{\ln x}{x}\end{equation} Yet we introduce another variable $v$ which satisfies $u=e^v$. In terms of $v$, \eqref{eq:funeq2} is written as $f(v)=ve^v=-\frac{\ln x}{x}$ and hence $v=W\left(-\frac{\ln x}{x}\right)$ i.e. \begin{equation}\label{eq:funeq3}y=-\frac{x}{\ln x}W\left(-\frac{\ln x}{x}\right)\end{equation} The equation $v=W\left(-\frac{\ln x}{x}\right)$ above is a useful identity itself for Lambert W function \begin{equation}\label{eq:funeq4}W\left(-\frac{\ln x}{x}\right)=-\ln x\end{equation} From \eqref{eq:funeq4} we can get some special values of $W$ for example $W(0)=0$ and $W\left(-\frac{1}{e}\right)=-1$. The graphs of $y=x$ and $y=-\frac{x}{\ln x}W\left(-\frac{\ln x}{x}\right)$ can be seen in Figure 1.

Figure 1. The graphs of y=x (in red) and y=-xW(-ln(x)/x)/ln(x) (in blue)

It appears that $y=x$ and $y=-\frac{x}{\ln x}W\left(-\frac{\ln x}{x}\right)$ coincide on $(1,e)$. $y=-\frac{x}{\ln x}W\left(-\frac{\ln x}{x}\right)$ has a kink at $x=e$ and is decreasing on $(e,\infty)$. Differentiating \eqref{eq:funeq} with respect to $x$ results in \begin{equation}\label{eq:funeq5}\frac{1-\ln y}{y^2}\frac{dy}{dx}=\frac{1-\ln x}{x^2}\end{equation} Let $y=f(x)$. Recall $\frac{df^{-1}(x)}{dx}=\frac{1}{\frac{df(x)}{dx}}$. But $f(x)$ is an involution i.e. $f^{-1}=f$ and so $\frac{df(x)}{dx}=\pm 1$. By \eqref{eq:funeq5} with $f(x)$ being an involution, we see that $y=f(x)$ is an increasing function on $(1,e)$ thus $\frac{df(x)}{dx}=1$ and with $f(e)=e$, $f(x)=x$ on $(1,e)$ as we have speculated from Figure 1. $y=-\frac{x}{\ln x}W\left(-\frac{\ln x}{x}\right)$ parts ways with $y=x$ at $x=e$ and it becomes decreasing on $(e,\infty)$. As for Sam’s last question, first rewrite \eqref{eq:funeq} as $\ln y=y\frac{\ln x}{x}$. Since $y$ is decreasing on $(e,\infty)$ and is bounded below by 1, $\lim_{x\to\infty}y$ must exist, so $\lim_{x\to\infty}\ln y=0$. (This limit is obtained with $\lim_{x\to\infty}\frac{\ln x}{x}=0$.) Since $\lim_{x\to\infty}\ln y=\ln(\lim_{x\to\infty}y)$, $\lim_{x\to\infty}y=1$.


  1. I realized that I was sloppy in the definition of $W$. In general $W$ is defined as the collection of the branches of $f(z)=ze^z$ where $z$ is the complex variable $z=x+iy$. $f(z)=ze^z$ is not injective so $W$ is multivalued. I considered the real version which is the inverse of $f(x)=xe^x$ here and I said it is injective. The reason is that I was restricting its domain to $x\geq 0$ though I didn’t mention it. But $f(x)=xe^x$ is in general not injective as seen in  Figure 2.

    Figure 2. The graph of f(x)=xe^x.

    One can also easily show that it is not injective without a graph. $f'(x)=e^x(x+1)$ so $x=-1$ is a critical point. $f'(x)<0$ on $(-\infty,-1)$ i.e. $f(x)$ is decreasing on $(-\infty,-1)$ and $f'(x)>0$ on $(-1,\infty)$ i.e. $f(x)$ is increasing on $(-1,\infty)$. Hence $W$ is still multivalued. The upper branch $W\geq -1$ is denoted $W_0$ and is defined to be the principal branch of $W$ and the lower branch $W\leq -1$ is denoted by $W_{-1}$. Now one can easily see why there is a kink for $y=-\frac{x}{\ln x}W\left(-\frac{\ln x}{x}\right)$ at $x=e$. Because that is where $W$ is failed to be single-valued. In fact, $y=-\frac{x}{\ln x}W_{-1}\left(-\frac{\ln x}{x}\right)$ has no kink as seen in the nice graphics made by Greg Egan here. Also see Figure 3 for the graph of $y=-\frac{x}{\ln x}W_{-1}\left(-\frac{\ln x}{x}\right)$ alone.

    Figure 3. The graphs of y=x (in red) and y=-xW_{-1}(pointed out by Sam-ln(x)/x)/ln(x) (in blue)

    By the way, in case you don’t know, Greg is a well-known science fiction writer and his novels have lots of interesting math and physics stuff. For information on his novels visit his website. There is so much interesting stuff to learn about Lambert W function. To learn more about it, for starter, see its Wikipedia entry and also a survey paper on Lambert W function here. Note that one of the authors is Rob Corless. I thought he was just a knowledgeable passerby who threw a hint at others but it turns out he is an expert of Lambert W function.

  2.  By substituting $z_0=ze^z$ in $z=W(ze^z)$ we obtain $z_0=W(z_0)e^{W(z_0)}$ for any complex number $z_0$. This can be used as the defining equation for Lambert $W$ function.


  1. After reading Maple information on the command LambertW, I realized that Figure 1 is actually the graph of the principal branch $W_0$.
  2. The substitutions $u$ and $v$ I used to find the solution of $x^y=y^x$ can be combined into one as pointed out by Sam. Let $v$ be a variable satisfying $y=e^{-v}$. Then \eqref{eq:funeq} turns into $ve^v=-\frac{\ln x}{x}$ as before. In order for $ve^v$ to be injective we require that $-1<v<\infty$ or equivalently $0<y<\frac{1}{e}$.

Update: Sam twitted that the equation $m^n=n^m$ where $m, n$ are integers with $1<m<n$ has only one solution $m=2,n=4$. This can be easily seen from Figure 1. Can we see that without a graph? Yes we can.  Since $m\ne n$ and $\frac{\ln m}{m}=\frac{\ln n}{n}$ then, it must be that $m,n\geq 3$ and that $n$ needs to be of the form $k^r$ where both $k,r$ are integers. The first such $n$ is $n=4$ and $\frac{\ln m}{m}=\frac{\ln 4}{4}=\frac{\ln 2}{2}$, thus $m=2$. Since $y$ is decreasing, so is $m$ and hence we see that $(m,n)=(2,4)$ is the only solution to $m^n=n^m$.