$\require{color}$

# Viète’s Formula

#### May 3rd, 2017

Today we are going to derive one of the most elegant formulas math has ever seen (in my opinion), Viète’s formula. The formula is based on the following idea

$$\frac{2}{\pi} = \frac{\text{area of inscribed square}}{\text{area of unit circle}}$$

Viète realized this formula could be manipulated by adding intermediate steps between the circle and the square

$$\frac{2}{\pi} = \frac{\text{area of inscribed square}}{\text{area of inscribed octagon}}\cdot\frac{\text{area of inscribed octagon}}{\text{area of unit circle}}$$

$$\frac{2}{\pi} = \frac{\text{area of inscribed square}}{\text{area of inscribed octagon}}\cdot\frac{\text{area of inscribed octagon}}{\text{area of inscribed }2^4\text{-gon}}\cdot\frac{\text{area of inscribed }2^4\text{-gon}}{\text{area of unit circle}}$$

As we look at polygons with more and more sides, their area approaches that of the circle. In math terms, we can write

$$\lim_{n\rightarrow\infty}\frac{\text{area of inscribed }2^n\text{-gon}}{\text{area of unit circle}} = 1$$

### Formulation

First, we need to create some notation to help our calculations. Define $Q_n$ as

$$Q_n = \frac{\text{area of } 2^n\text{-gon}}{\text{area of } 2^{n+1}\text{-gon}}$$

We know that as $n\rightarrow\infty$, $Q_n\rightarrow 1$. As a result, the infinite product has a chance of converging (and in this case, it does!). We can then write

$$\frac{2}{\pi} = Q_{2}\cdot Q_{3} \cdot Q_{4}\dots$$

### Area Computation Part 1

Consider the regular n-gon. We will compute the area by dividing the polygon into $n$ triangles.

*********

The interior angle for each of these isosceles triangles is

$$\theta=\frac{2\pi}{n}$$

We also know that the side lengths are 1, since the shape is inscribed inside a circle of radius 1. We will use some trig to get the base and height of the triangle. Here is a picture for an octagon.

$$B = 2\sin\frac{\theta}{2}\hspace{10mm}H=\cos\frac{\theta}{2}$$

$$\text{area} = \frac{BH}{2} = \sin\frac{\theta}{2}\cos\frac{\theta}{2}$$

We have $n$ triangles in our shape, and we already said that the angle $\theta=\frac{2\pi}{n}$, so

$$\text{area of inscribed n-gon} = n\cdot\sin\frac{\pi}{n}\cos\frac{\pi}{n}$$

### Area Computation Part 2

We now go back to our definition for $Q_n$

$$Q_n = \frac{\text{area of } 2^n\text{-gon}}{\text{area of } 2^{n+1}\text{-gon}}$$

$$Q_n = \frac{ 2^n\cdot\sin\frac{\pi}{2^n}\cos\frac{\pi}{2^n}}{2^{n+1}\cdot\sin\frac{\pi}{2^{n+1}}\cos\frac{\pi}{2^{n+1}}}$$

$$= \frac{\sin\frac{\pi}{2^n}\cos\frac{\pi}{2^n}}{2\cdot\sin\frac{\pi}{2^{n+1}}\cos\frac{\pi}{2^{n+1}}}$$

Now we need to make this formula look a little nicer. We can do this by using the trivial fact that

$$\frac{\pi}{2^n} = 2\cdot\frac{\pi}{2^{n+1}}$$

$$Q_n = \frac{\sin\frac{2\pi}{2^{n+1}}\cos\frac{\pi}{2^{n}}}{2\cdot\sin\frac{\pi}{2^{n+1}}\cos\frac{\pi}{2^{n+1}}}$$

Now use the double angle formula for $\sin$

$$\sin2\theta = 2\sin\theta\cos\theta$$

$$\sin\frac{2\pi}{2^{n+1}} = 2\sin\frac{\pi}{2^{n+1}}\cos\frac{\pi}{2^{n+1}}$$

$$Q_n = \frac{2\cdot\sin\frac{\pi}{2^{n+1}}\cos\frac{\pi}{2^{n+1}}\cos\frac{\pi}{2^{n}}}{2\cdot\sin\frac{\pi}{2^{n+1}}\cos\frac{\pi}{2^{n+1}}}$$

The ugly stuff cancels out wonderfully, leaving us with

$$Q_n= \cos\frac{\pi}{2^{n}}$$

Therefore

$$\bbox[15px,border:1px solid black]{\frac{2}{\pi} = \cos\frac{\pi}{2} \cos\frac{\pi}{4} \cos\frac{\pi}{8}\dots}$$

### Reformulation

The issue with the formula above is that, well, it uses $\pi$ to compute $\pi$. This is criminal circular logic. However, we can easily remedy this. Let’s look at the double angle formula for $\cos$

$$\cos 2\theta = 2\cos^2\theta – 1$$

$$\cos\theta = 2\cos^2\frac{\theta}{2} -1$$

$$\cos\frac{\theta}{2} = \sqrt{\frac{1+\cos\theta}{2}}$$

$$\cos\frac{\theta}{2} = \frac{\sqrt{2+2\cos\theta}}{2}$$

Using this, and starting from $\cos\frac{\pi}{4} = \frac{\sqrt{2}}{2}$ yields

$$\cos\frac{\pi}{4}=\frac{\sqrt{2}}{2}\hspace{20mm}\cos\frac{\pi}{8}=\frac{\sqrt{2+\sqrt{2}}}{2}\hspace{20mm}\cos\frac{\pi}{16}=\frac{\sqrt{2+\sqrt{2+\sqrt{2}}}}{2}$$

Therefore,  we can finish off this post, having derived Viète’s formula.

$$\bbox[15px,border:1px solid black]{\frac{2}{\pi} = \frac{\sqrt{2}}{2}\cdot \frac{\sqrt{2+\sqrt{2}}}{2}\cdot \frac{\sqrt{2+\sqrt{2+\sqrt{2}}}}{2}\cdot\frac{\sqrt{2+\sqrt{2+\sqrt{2+\sqrt{2}}}}}{2}\dots}$$

Comment

# Basel Problem Solution

#### April 22nd, 2017

Hey folks, I’ve been pretty busy lately, but I have an incredibly elegant proof to show you today. In 1734, a man named Leonard Euler gained immediate recognition around the world of mathematics for solving the Basel problem. The problem was to find the following

$$\sum_{n=1}^{\infty}\frac{1}{n^2}=?$$

Euler’s initial solution relied on the manipulation of the Taylor series for $sin(x)$, and some algebraic wizardry that was relatively unproven at the time. Euler’s solution is incredibly elegant and cool, but we aren’t going to show his proof, because I don’t think it’s as cool as this solution. This solution uses Cauchy’s Residue Theorem. I will explain briefly how this theorem works before using it extensively to solve this problem.

I. Residue Theorem

In complex analysis, it is easy to show that the integral of a function over a closed curve is determined only by the singularities, or undefined points, of the function on the interior (or boundary) of the curve. The integral of a function over a region with no singularities is 0, so we can essentially shrink our region down to a bunch of small integrals around the singular points. These integrals are called the residues of f at a point. Here is a sketch of the idea

Since our curve encloses no singular points, the integral must be 0. As we let the gaps shrink to infinity, we get that the integral around the entire region (black), – the integrals around the singular points (pink), must be 0. Therefore, the integrals around the singular points is equal to the entire integral. The integrals around the singular points are called the residues. We can use Cauchy’s Residue Theorem to write

$$\oint_\gamma f(z) \text{d}z = 2\pi i \sum_k\underset{z\rightarrow z_k}{\text{Res}}\hspace{2mm}f(z)$$

This is a fancy way of writing that the integral of $f(z)$ over a closed curve $\gamma$ is equal to $2\pi i$ times the sum of all the residues inside $\gamma$. For a simple pole, we can compute the residue using

$$\underset{z\rightarrow z_o}{\text{Res}}\hspace{2mm}f(z) = \underset{z\rightarrow z_k}{\text{lim}}f(z)(z-z_o)$$

II. Adaptation to Basel Problem

Well, that’s a 5 minute course in complex analysis. How can this possibly help us with the Basel problem, a real valued problem which appears to want nothing to do with complex numbers, is surely the question you are asking. Let’s consider the function

$$f(z) = \pi\cot(\pi z) = \frac{\pi\cos(\pi z)}{\sin(\pi z)}$$

$\sin(z)$ is 0 at any integer multiple of $\pi$. So $\sin(\pi z)$ is 0 at any integer z.

$$\sin(\pi z) = 0 \hspace{10mm} z = n \in \mathbb{Z}$$

This means that for any integer $n$, our function has a singular point at $z=n$. Since $\sin(\pi z)$ can be written as an infinite product of all the singular points with each point order 1, all of the singular points are simple poles. This is crucial. Let’s calculate the residues using the limit definition.

$$\underset{z\rightarrow n}{\text{Res}}\hspace{2mm}f(z) = \underset{z\rightarrow n}{\text{lim}}\frac{\pi\cos(\pi z)(z-n)}{\sin(\pi z)}$$

Using L’Hopital’s rule

$$= \pi\cdot \underset{z\rightarrow n}{\text{lim}}\frac{\frac{\text{d}}{\text{d}z}\hspace{2mm} z\cos(\pi z) -n\cos(\pi z)}{\frac{\text{d}}{\text{d}z}\hspace{2mm}\sin(\pi z)}$$

$$= \pi\cdot \underset{z\rightarrow n}{\text{lim}}\frac{\cos(\pi z) – \pi z \sin(\pi z) + n\pi\sin(\pi z)}{\pi \cos(\pi z)}$$

$$= \pi\cdot \frac{\cos(\pi n) – 0 + 0}{\pi\cos(\pi n)}$$

$$= 1$$

So, the residue at each pole is 1. Now we will use the residue theorem in a very odd way.

III. Kill The Integral

We showed that $$\underset{z\rightarrow n}{\text{Res}}\hspace{2mm}\pi\cot(\pi z) = 1\hspace{5mm} n\in\mathbb{Z}$$

Using the residue theorem, let’s integrate over a circle of radius $R$ centered at the origin. We will call our curve $\gamma_R$. Let $R$ be slightly bigger than some integer $n$ but less than $n+1$

$$\oint_{\gamma_R} \pi\cot(\pi z) \hspace{1mm}\text{d}z = 2\pi i \sum_{k}\underset{z\rightarrow z_k}{\text{Res}}\hspace{2mm}\pi\cot(\pi z)$$

We just showed that all of the residues are 1, so we can rewrite as

$$= 2\pi i \sum_k 1$$

The trick now is that we actually know exactly how many residues we are summing. Here’s a picture.

We have exactly $2n+1$ poles inside our circle. Therefore

$$\oint_{\gamma_R} \pi\cot(\pi z) \hspace{1mm}\text{d}z = 2\pi i \sum_{k=1}^{2n+1}1$$

$$\Big|\oint_{\gamma_R} \pi\cot(\pi z) \hspace{1mm}\text{d}z \Big|= 4\pi n + 2\pi$$

$$\Big|\oint_{\gamma_R} \pi\cot(\pi z) \hspace{1mm}\text{d}z \Big| < 4\pi R + 2\pi$$

So, we have found that our integral is $O(R)$. Therefore,

$$\Big|\oint_{\gamma_R} \frac{\pi\cot(\pi z)}{z^2} \hspace{1mm}\text{d}z \Big| < \frac{4\pi R + 2\pi}{R^2}$$

As $R\rightarrow\infty$

$$\underset{R\rightarrow \infty}{\text{lim}}\Big|\oint_{\gamma_R} \frac{\pi\cot(\pi z)}{z^2} \hspace{1mm}\text{d}z \Big| <\underset{R\rightarrow \infty}{\text{lim}}\Big|\oint_{\gamma_R} \frac{\pi\cot(\pi z)}{|z^2|} \hspace{1mm}\text{d}z \Big|$$

$$< \underset{R\rightarrow \infty}{\text{lim}}\Big|\oint_{\gamma_R} \frac{\pi\cot(\pi z)}{R^2} \hspace{1mm}\text{d}z \Big|< \underset{R\rightarrow \infty}{\text{lim}}\frac{1}{R^2}\Big|\oint_{\gamma_R} \pi\cot(\pi z)\hspace{1mm}\text{d}z \Big|$$

$$< \underset{R\rightarrow \infty}{\text{lim}}\frac{4\pi R + 2\pi}{R^2} = 0$$

As we let $R$ go to $\infty$, our integral vanishes, so we have

$$\underset{R\rightarrow \infty}{\text{lim}}\Big|\oint_{\gamma_R} \frac{\pi\cot(\pi z)}{z^2} \hspace{1mm}\text{d}z \Big| = 0$$

$$\underset{R\rightarrow \infty}{\text{lim}}\oint_{\gamma_R} \frac{\pi\cot(\pi z)}{z^2} \hspace{1mm}\text{d}z = 0$$

IV. Reformulation of Residues

Simple Poles

We started by finding the poles of $f(z) = \pi\cot(\pi z)$, and finding the residues to be 1. What about the poles of our new function

$$f(z) = \frac{\pi \cot(\pi z)}{z^2}$$

Well, since the denominator is analytic (well defined) at all $z\in\mathbb{Z}, z\neq 0$, the poles, other than z = 0, are still simple. Let’s compute the residues

$$\underset{z\rightarrow n}{\text{Res}}\hspace{2mm}f(z) = \underset{z\rightarrow n}{\text{lim}}\frac{\pi\cos(\pi z)(z-n)}{\sin(\pi z)z^2}$$

Using L’Hopital’s rule

$$= \pi\cdot \underset{z\rightarrow n}{\text{lim}}\frac{\frac{\text{d}}{\text{d}z}\hspace{2mm} z\cos(\pi z) -n\cos(\pi z)}{\frac{\text{d}}{\text{d}z}\hspace{2mm}\sin(\pi z)z^2}$$

$$= \pi\cdot \underset{z\rightarrow n}{\text{lim}}\frac{\cos(\pi z) – \pi z \sin(\pi z) + n\pi\sin(\pi z)}{\pi \cos(\pi z)z^2 + 2z\sin(\pi z)}$$

$$= \pi\cdot \frac{\cos(\pi n) – 0 + 0}{\pi n^2\cos(\pi n)}$$

$$= \frac{1}{n^2}$$

The residue at every pole other than $z=0$ is equal to $\frac{1}{n^2}$.

At z = 0

We now have to find the residue at $z=0$. Since $z=0$ was a pole of order 1 for $f(z)=\pi\cot(\pi z)$, we know that it is a pole of order 3 for $f(z) \frac{\pi\cot(\pi z)}{z^2}$

We will use the limit definition for a 3rd order pole

$$\underset{z\rightarrow 0}{\text{Res}}f(z) = \frac{1}{2}\cdot\underset{z\rightarrow 0}{\text{lim}}\hspace{2mm}\frac{\text{d}^2}{\text{d}z^2}\hspace{2mm}\frac{\pi\cos(\pi z)z^3}{\sin(\pi z)z^2}$$

$$\underset{z\rightarrow 0}{\text{lim}}\hspace{2mm}\frac{\text{d}^2}{\text{d}z^2}\hspace{2mm}\frac{\pi\cot(\pi z)z}{2}$$

$$= \underset{z\rightarrow 0}{\text{lim}}\hspace{2mm}\frac{\text{d}}{\text{d}z}\hspace{2mm}\frac{-\pi^2z\csc^2(\pi z)+\pi\cot(\pi z)}{2}$$

$$= \underset{z\rightarrow 0}{\text{lim}}\hspace{2mm}\frac{-\pi^2\csc^2(\pi z) + 2\pi^3z\csc^2(\pi z)\cot(\pi z)+-\pi^2\csc^2(\pi z)}{2}$$

$$= \underset{z\rightarrow 0}{\text{lim}}\hspace{2mm}\pi^2\frac{\pi z \cos(\pi z) – \sin(\pi z)}{\sin^3(\pi z)}$$

Using L’Hopital’s rule

$$= \underset{z\rightarrow 0}{\text{lim}}\hspace{2mm}\pi^2\frac{-\pi^2 z \sin(\pi z) + \pi\cos(\pi z) – \pi\cos(\pi z)}{3\pi\sin^2(\pi z)\cos(\pi z)}$$

$$= \underset{z\rightarrow 0}{\text{lim}}\hspace{2mm}\pi^2\frac{-\pi z}{3\sin(\pi z)\cos(\pi z)}$$

$$= \underset{z\rightarrow 0}{\text{lim}}\hspace{2mm}\pi^2\frac{-2\pi z}{3\sin(2\pi z)}$$

Using L’Hopital’s rule again

$$= \underset{z\rightarrow 0}{\text{lim}}\hspace{2mm}\frac{-2\pi^3}{6\pi\cos(2\pi z)}$$

$$= -\frac{\pi^2}{3}$$

Wow, alright, that was pretty long. But I promise we are almost there. We just need to put it all together.

IV. The Big Reveal

All in all, we’ve established the following

$$\underset{z\rightarrow n}{\text{Res}}\hspace{2mm}\frac{\pi\cot(\pi z)}{z^2}= \frac{1}{n^2} \hspace{7mm} n\in\mathbb{Z}, n\neq 0$$

$$\underset{z\rightarrow n}{\text{Res}}\hspace{2mm}\frac{\pi\cot(\pi z)}{z^2}= -\frac{\pi^2}{3} \hspace{7mm} n = 0$$

$$\underset{R\rightarrow \infty}{\text{lim}}\oint_{\gamma_R} \frac{\pi\cot(\pi z)}{z^2} \hspace{1mm}\text{d}z= 0$$

We know that the integral is equal to $2\pi i$ times the sum of the residues

$$\underset{R\rightarrow \infty}{\text{lim}}\oint_{\gamma_R} \frac{\pi\cot(\pi z)}{z^2} \hspace{1mm}\text{d}z= 2\pi i \sum \underset{z\rightarrow n}{\text{Res}}\hspace{2mm}f(z)$$

But we know the integral is 0, so

$$2\pi i \sum \underset{z\rightarrow n}{\text{Res}}\hspace{2mm}f(z) = 0$$

$$\sum \underset{z\rightarrow n}{\text{Res}}\hspace{2mm}f(z) = 0$$

Now, we can rewrite the sum of the residues, since we’ve computed them all.

$$\sum \underset{z\rightarrow n}{\text{Res}}\hspace{2mm}f(z) = \sum_{n\neq 0}\underset{z\rightarrow n}{\text{Res}}\hspace{2mm}f(z) \hspace{2mm} + \hspace{2mm} \underset{z\rightarrow 0}{\text{Res}}\hspace{2mm}f(z) = 0$$

$$\sum_{n=-\infty}^{\infty, n\neq 0}\frac{1}{n^2} \hspace{2mm} – \hspace{2mm} \frac{\pi^2}{3}= 0$$

But, $\frac{1}{n^2}$ is an even function, so we can rewrite it as

$$\sum_{n=-\infty}^{\infty, n\neq 0}\frac{1}{n^2} = 2\sum_{n=1}^{\infty}\frac{1}{n^2}$$

Therefore

$$2\sum_{n=1}^{\infty}\frac{1}{n^2} \hspace{2mm} – \hspace{2mm} \frac{\pi^2}{3}= 0$$

$$\bbox[10px,border:1px solid black]{\sum_{n=1}^{\infty}\frac{1}{n^2} = \frac{\pi^2}{6}}$$

That’s it folks. As always, thanks for reading! I know this was much more mathematically intense than the rest of my posts, but this is such an incredible formula that I was left with no choice but to present it.