Prove that \[ \cot\frac{\pi}{8}=\sqrt2+1 \]
Proof:
Using the half-angle identity:
\[
\tan\frac{\theta}{2}
=
\frac{1-\cos\theta}{\sin\theta}
\]
Let
\[
\theta=\frac{\pi}{4}
\]
Then,
\[
\tan\frac{\pi}{8}
=
\frac{1-\cos\frac{\pi}{4}}{\sin\frac{\pi}{4}}
\]
Using standard values:
\[
\sin\frac{\pi}{4}=\frac{\sqrt2}{2}
\]
and
\[
\cos\frac{\pi}{4}=\frac{\sqrt2}{2}
\]
Substituting:
\[
\tan\frac{\pi}{8}
=
\frac{1-\frac{\sqrt2}{2}}{\frac{\sqrt2}{2}}
\]
\[
=
\frac{2-\sqrt2}{\sqrt2}
\]
\[
=
\sqrt2-1
\]
Therefore,
\[
\cot\frac{\pi}{8}
=
\frac{1}{\tan\frac{\pi}{8}}
=
\frac{1}{\sqrt2-1}
\]
Rationalizing:
\[
=
\frac{\sqrt2+1}{(\sqrt2-1)(\sqrt2+1)}
\]
\[
=
\frac{\sqrt2+1}{2-1}
\]
\[
=
\sqrt2+1
\]
Hence proved,
\[
\boxed{
\cot\frac{\pi}{8}=\sqrt2+1
}
\]