Theorem: Harmonic Continued Fraction for Pi

:$\dfrac 2 {\pi - 2} = \dfrac 1 1 + \cfrac 1 {\dfrac 1 2 + \cfrac 1 {\dfrac 1 3 + \cfrac 1 {\dfrac 1 4 + \cfrac 1 {\dfrac 1 5 + \cfrac 1 {\dfrac 1 6 + \cfrac \ddots \ddots} } } } }$

Proof:
Let $I_n = \ds \int_0^{\frac \pi 4} \dfrac {\paren {\cos 2 x}^n} {\cos^2 x} \rd x$.
With a view to expressing the primitive in the form:
{{begin-eqn}}
{{eqn | l = \int u \frac {\d v} {\d x} \rd x
      | r = u v - \int v \frac {\d u} {\d x} \rd x
      | c = Integration by Parts
}}
{{end-eqn}}
let:
{{begin-eqn}}
{{eqn | l = u
      | r = \paren {\cos 2 x}^n
      | c = 
}}
{{eqn | ll= \leadsto
      | l = \frac {\d u} {\d x}
      | r = n \paren {\cos 2 x}^{n - 1} \paren {- \sin 2 x} \paren 2
      | c = Chain Rule for Derivatives, Derivative of Cosine Function and Derivative of Power
}}
{{end-eqn}}
and let:
{{begin-eqn}}
{{eqn | l = \frac {\d v} {\d x}
      | r = \frac 1 {\cos^2 x }
      | c = 
}}
{{eqn | ll= \leadsto
      | l = v
      | r = \tan x
      | c = Primitive of $\sec^2 x$
}}
{{end-eqn}}
Then:
{{begin-eqn}}
{{eqn | l = I_n
      | r = \int_0^{\frac \pi 4} \dfrac {\paren {\cos 2 x}^n} {\cos^2 x} \rd x
      | c = 
}}
{{eqn | r = \bigintlimits { \paren {\cos 2 x}^n \tan x } 0 {\frac {\pi} 4} + 2 n \int_0^{\frac {\pi} 4 } \tan x \paren {\cos 2 x}^{n - 1} \paren { \sin 2 x} \rd x 
      | c = Integration by Parts
}}
{{eqn | r = 0 + n \int_0^{\frac {\pi} 4 } \paren {\cos 2 x}^{n - 1} \paren { \sin 2 x} \paren {\frac {2 \sin x} {\cos x} } \rd x 
      | c = {{cos|90}}, {{tan|0}} and Tangent is Sine divided by Cosine
}}
{{eqn | r = n \int_0^{\frac {\pi} 4 } \paren {\cos 2 x}^{n - 1} \paren { \sin 2 x} \paren {\frac {2 \sin x} {\cos x} \times \frac {\cos x} {\cos x} } \rd x 
      | c = multiplying top and bottom by $\cos x$
}}
{{eqn | r = n \int_0^{\frac {\pi} 4 } \paren {\cos 2 x}^{n - 1} \paren { \sin 2 x} \paren {\frac {2 \sin x \cos x} {\cos^2 x} } \rd x 
      | c = 
}}
{{eqn | r = n \int_0^{\frac {\pi} 4 } \paren {\cos 2 x}^{n - 1} \paren { \sin 2 x} \paren {\frac {\sin 2 x} {\cos^2 x} } \rd x 
      | c = Double Angle Formula for Sine
}}
{{eqn | r = n \int_0^{\frac {\pi} 4 } \paren {\cos 2 x}^{n - 1} \paren {\frac {\sin^2 2 x} {\cos^2 x} } \rd x 
      | c = 
}}
{{eqn | r = n \int_0^{\frac {\pi} 4 } \paren {\cos 2 x}^{n - 1} \paren {\frac {1 - \cos^2 2 x} {\cos^2 x} } \rd x 
      | c = Sum of Squares of Sine and Cosine
}}
{{eqn | r = n \int_0^{\frac \pi 4} \dfrac {\paren {\cos 2 x}^{n - 1} } {\cos^2 x} \rd x - n \int_0^{\frac \pi 4} \dfrac {\paren {\cos 2 x}^{n + 1} } {\cos^2 x} \rd x
      | c = Linear Combination of Integrals
}}
{{eqn | r = n I_{n - 1} - n I_{n + 1}
      | c = 
}}
{{end-eqn}}
From the recursive equation, $I_n = n I_{n - 1} - n I_{n + 1}$, we obtain:
{{begin-eqn}}
{{eqn | n = 1
      | l = I_n
      | r = n I_{n - 1} - n I_{n + 1}
      | c = 
}}
{{eqn | n = 2
      | ll = \leadsto
      | l = I_{n - 1}
      | r = \dfrac 1 n I_n + I_{n + 1}
      | c = 
}}
{{eqn | ll = \leadsto
      | l = \dfrac {I_n} {I_{n - 1} }
      | r = n - n \dfrac {I_{n + 1} } {I_{n - 1} }
      | c = dividing $1$ by $I_{n - 1}$
}}
{{eqn | r = n - \dfrac {n I_{n + 1} } {\paren {\dfrac 1 n I_n + I_{n + 1} } }
      | c = substituting from $2$
}}
{{eqn | r = n \times \dfrac {\paren {\dfrac 1 n I_n + I_{n + 1} } } {\paren {\dfrac 1 n I_n + I_{n + 1} } } - \dfrac {n I_{n + 1} } {\paren {\dfrac 1 n I_n + I_{n + 1} } }
      | c = multiplying top and bottom by $\paren {\dfrac 1 n I_n + I_{n + 1} }$
}}
{{eqn | r = \dfrac { I_n } {\paren {\dfrac 1 n I_n + I_{n + 1} } }
      | c = 
}}
{{eqn | r = \dfrac { I_n \times \dfrac 1 {I_n} } {\paren {\dfrac 1 n I_n + I_{n + 1} } \times \dfrac 1 {I_n} }
      | c = multiplying top and bottom by $\dfrac 1 {I_n}$
}}
{{eqn | r = \dfrac 1 {\paren {\dfrac 1 n + \dfrac {I_{n + 1} } {I_n} } }
      | c = 
}}
{{eqn | ll = \leadsto
      | l = \dfrac {I_n} {I_{n - 1} }
      | r = \dfrac 1 {\paren {\dfrac 1 n + \dfrac {I_{n + 1} } {I_n} } }
      | c = 
}}
{{end-eqn}}
Therefore:
{{begin-eqn}}
{{eqn | l = \dfrac {I_1} {I_0}
      | r = \dfrac 1 {\dfrac 1 1 + \dfrac {I_2 } {I_1} }
      | c = 
}}
{{eqn | r = \dfrac 1 {\dfrac 1 1 + \cfrac 1 {\dfrac 1 2 + \dfrac {I_3 } {I_2} } }
      | c = 
}}
{{eqn | r = \dfrac 1 {\dfrac 1 1 + \cfrac 1 {\dfrac 1 2 + \cfrac 1 {\dfrac 1 3 + \dfrac {I_4 } {I_3} } } }
      | c = 
}}
{{end-eqn}}
Evaluating $I_1$, we find:
{{begin-eqn}}
{{eqn | l = I_1
      | r = \int_0^{\frac \pi 4} \dfrac {\paren {\cos 2 x} } {\cos^2 x} \rd x
      | c = 
}}
{{eqn | r = \int_0^{\frac \pi 4} \dfrac {\paren {2 \cos^2 x - 1} } {\cos^2 x} \rd x
      | c = {{Corollary|Double Angle Formula for Cosine|1}}
}}
{{eqn | r = 2 \int_0^{\frac \pi 4} \rd x - \int_0^{\frac \pi 4} \dfrac 1 {\cos^2 x} \rd x
      | c = 
}}
{{eqn | r = 2 \bigintlimits { x } 0 {\frac {\pi} 4} - \bigintlimits { \tan x } 0 {\frac {\pi} 4}
      | c = Primitive of $\sec^2 x$
}}
{{eqn | r = \frac {\pi} 2 - 1
      | c = {{tan|45}} and {{tan|0}}
}}
{{end-eqn}}
Evaluating $I_0$, we find:
{{begin-eqn}}
{{eqn | l = I_0
      | r = \int_0^{\frac \pi 4} \dfrac 1 {\cos^2 x} \rd x
      | c = 
}}
{{eqn | r = \bigintlimits { \tan x } 0 {\frac {\pi} 4}
      | c = Primitive of $\sec^2 x$
}}
{{eqn | r = 1
      | c = {{tan|45}} and {{tan|0}}
}}
{{end-eqn}}
Therefore, $\dfrac {I_1} {I_0} $ can be written as:
{{begin-eqn}}
{{eqn | l = \frac {I_1} {I_0}
      | r = \frac {\pi - 2} 2
      | c = 
}}
{{eqn | r = \cfrac 1 {\dfrac 1 1 + \cfrac 1 {\dfrac 1 2 + \cfrac 1 {\dfrac 1 3 + \cfrac 1 {\dfrac 1 4 + \cfrac 1 {\dfrac 1 5 + \cfrac 1 {\dfrac 1 6 + \cfrac \ddots \ddots} } } } } }
      | c = 
}}
{{eqn | ll = \leadsto
      | l = \dfrac 2 {\pi - 2}
      | r = \dfrac 1 1 + \cfrac 1 {\dfrac 1 2 + \cfrac 1 {\dfrac 1 3 + \cfrac 1 {\dfrac 1 4 + \cfrac 1 {\dfrac 1 5 + \cfrac 1 {\dfrac 1 6 + \cfrac \ddots \ddots} } } } }
      | c = taking the reciprocal of both sides
}}
{{end-eqn}}
{{qed}}