Finding $\int_0^{\pi/4}\sqrt{1+\left( \tan x\right)^2}dx$ I would like to understand all the steps to find out this integral $$ \int_0^{\pi/4} \sqrt{1+\left( \tan x\right)^2} dx$$ Wolfram Alpha returns: $$ \frac12 \log(3+2 \sqrt2) = 0.881373587019543...$$ Why does it give this value? Thank you.
 A: An alternative approach. By substituting $x=\arctan t$, we get:
$$ I = \int_{0}^{1}\frac{dt}{\sqrt{1+t^2}}=\operatorname{ArcSinh}(1) $$
hence the value of the integral is given by the solution of:
$$ e^{x}-e^{-x} = 2 $$
or by the logarithm of the positive solution of:
$$ y-\frac{1}{y}=2, $$
hence $I=\log(1+\sqrt{2})$ as wanted.
A: Here are different steps.

$$ \int_0^{\pi/4} \sqrt{1+\left( \tan x\right)^2} \:dx = \ln\left(1+\sqrt{2}\right).$$

Proof.
For $0<x<\pi/4$, set $\displaystyle t:=\tan\left(\frac{x}{2}\right)$ giving $$\cos x = \frac{1-t^2}{1+t^2},\quad x=2 \arctan t, \quad dx=\frac{2}{1+t^2}dt.$$ 
Then
$$
\begin{align} 
\int_0^{\pi/4} \sqrt{1+\left( \tan x\right)^2} \:dx & = \int_0^{\pi/4} \frac{\sqrt{\cos^2 x+\sin^2 x}}{\cos x} \:dx \\\\
& = \int_0^{\pi/4} \frac{1}{\cos x} \:dx \\\\
& = \int_0^{\tan(\pi/8)} \frac{1+t^2}{1-t^2}\frac{2 \:dt}{1+t^2} \\\\
& = \int_0^{\tan(\pi/8)} \left( \frac{1}{1-t}+\frac{1}{1+t}\right)dt \\\\
& = \ln \left( \frac{1+\tan(\pi/8)}{1-\tan(\pi/8)}\right)\\\\
&= \ln\left(1+\sqrt{2}\right)\\\\
& \approx \color{blue}{0.88137358701954 \dots}\\
\end{align}
$$ where we have used $\displaystyle \tan(\pi/8)=\sqrt{2}-1$ obtained from $\displaystyle \tan(2x)=\frac{2\tan x}{1-\tan^2 x}$ with $x=\pi/8$ knowing that $\displaystyle \tan(\pi/4)=1.$
A: Using $1+\tan^{2}x=\sec^{2}x$ gives 
$\int_0^{\frac{\pi}{4}}\sqrt{1+\tan^{2}x}\,dx=\int_0^{\frac{\pi}{4}}\sec x\,dx=\big[\ln(\sec x+\tan x)\big]_0^{\frac{\pi}{4}}=\ln(\sqrt{2}+1)-\ln 1=\ln(\sqrt{2}+1)$
