[Math] Dethestifying complex numbers

cv.complex-variablessoft-questionteaching

At the end of this month I start teaching complex analysis to
2nd year undergraduates, mostly from engineering but some from
science and maths. The main applications for them in future
studies are contour integrals and Laplace transform, but this should be a "real" complex analysis course which I could later
refer to in honours courses. I am now confident (after
this
discussion
, especially Gauss’s complaints given in Keith’s comment)
that the name "complex" is discouraging to average students.

Why do we need to study numbers which do not belong to the real world?

We all know that the thesis is wrong and I have in mind some examples
where the use of complex variable functions simplify solving considerably
(I give two below). The drawback is that all them assume some
knowledge from students already.

So I would be happy to learn elementary examples which may
convince students that complex numbers and functions of a
complex variable are useful.
As this question runs in the community wiki mode,
I would be glad to see one example per answer.

Thank you in advance!

Here are the two promised examples. I was reminded of the second one by several answers and comments about trigonometric functions (and also by the notification that "the bounty on your question Trigonometry related to Rogers–Ramanujan identities expires within three days"; it seems to be harder than I expected).

Example 1.
What is the Fourier expansion of the (unbounded) periodic function
$$
f(x)=\ln\Bigl\lvert\sin\frac x2\Bigr\rvert\ ?
$$

Solution.
The function $f(x)$ is periodic with period $2\pi$ and has poles at the
points $2\pi k$, $k\in\mathbb Z$.

Consider the function on the interval $x\in[\varepsilon,2\pi-\varepsilon]$.
The series
$$
\sum_{n=1}^\infty\frac{z^n}n, \qquad z=e^{ix},
$$

converges for all values $x$ from the interval.
Since
$$
\Bigl\lvert\sin\frac x2\Bigr\rvert=\sqrt{\frac{1-\cos x}2}
$$

and $\operatorname{Re}\ln w=\ln\lvert w\rvert$, where we choose $w=\frac12(1-z)$,
we deduce that
$$
\operatorname{Re}\Bigl(\ln\frac{1-z}2\Bigr)=\ln\sqrt{\frac{1-\cos x}2}
=\ln\Bigl\lvert\sin\frac x2\Bigr\rvert.
$$

Thus,
$$
\ln\Bigl\lvert\sin\frac x2\Bigr\rvert
=-\ln2-\operatorname{Re}\sum_{n=1}^\infty\frac{z^n}n
=-\ln2-\sum_{n=1}^\infty\frac{\cos nx}n.
$$

As $\varepsilon>0$ can be taken arbitrarily small,
the result remains valid for all $x\ne2\pi k$.

Example 2.
Let $p$ be an odd prime number.
$\newcommand\Legendre{\genfrac(){}{}}$For an integer $a$ relatively prime to $p$,
the Legendre symbol $\Legendre ap$ is $+1$ or $-1$
depending on whether the congruence
$x^2\equiv a\pmod{p}$ is solvable or not.
Using the elementary result (a consequence of Fermat's little theorem) that
$$
\Legendre ap \equiv a^{(p-1)/2}\pmod p,
\tag{*}\label{star}
$$

show that
$$
\Legendre 2p=(-1)^{(p^2-1)/8}.
$$

Solution.
In the ring $\mathbb Z+\mathbb Zi=\Bbb Z[i]$, the binomial formula implies
$$
(1+i)^p\equiv1+i^p\pmod p.
$$

On the other hand,
$$
(1+i)^p
=\bigl(\sqrt2e^{\pi i/4}\bigr)^p
=2^{p/2}\biggl(\cos\frac{\pi p}4+i\sin\frac{\pi p}4\biggr)
$$

and
$$
1+i^p
=1+(e^{\pi i/2})^p
=1+\cos\frac{\pi p}2+i\sin\frac{\pi p}2
=1+i\sin\frac{\pi p}2.
$$

Comparing the real parts implies that
$$
2^{p/2}\cos\frac{\pi p}4\equiv1\pmod p,
$$

hence from $\sqrt2\cos(\pi p/4)\in\{\pm1\}$ we conclude that
$$
2^{(p-1)/2}\equiv\sqrt2\cos\frac{\pi p}4\pmod p.
$$

Then using the elementary result \eqref{star}:
$$
\Legendre2p
\equiv2^{(p-1)/2}
\equiv\sqrt2\cos\frac{\pi p}4
=\begin{cases}
1 & \text{if } p\equiv\pm1\pmod8, \cr
-1 & \text{if } p\equiv\pm3\pmod8,
\end{cases}
$$

which is exactly the required formula.

Best Answer

The nicest elementary illustration I know of the relevance of complex numbers to calculus is its link to radius of convergence, which student learn how to compute by various tests, but more mechanically than conceptually. The series for $1/(1-x)$, $\log(1+x)$, and $\sqrt{1+x}$ have radius of convergence 1 and we can see why: there's a problem at one of the endpoints of the interval of convergence (the function blows up or it's not differentiable). However, the function $1/(1+x^2)$ is nice and smooth on the whole real line with no apparent problems, but its radius of convergence at the origin is 1. From the viewpoint of real analysis this is strange: why does the series stop converging? Well, if you look at distance 1 in the complex plane...

More generally, you can tell them that for any rational function $p(x)/q(x)$, in reduced form, the radius of convergence of this function at a number $a$ (on the real line) is precisely the distance from $a$ to the nearest zero of the denominator, even if that nearest zero is not real. In other words, to really understand the radius of convergence in a general sense you have to work over the complex numbers. (Yes, there are subtle distinctions between smoothness and analyticity which are relevant here, but you don't have to discuss that to get across the idea.)

Similarly, the function $x/(e^x-1)$ is smooth but has a finite radius of convergence $2\pi$ (not sure if you can make this numerically apparent). Again, on the real line the reason for this is not visible, but in the complex plane there is a good explanation.

Related Question