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.

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.$
