Evaluate $\int_{0}^{\frac{\pi}{4}}\tan xdx $ using idea of Riemann Sum Evaluate $$\int_{0}^{\frac{\pi}{4}}\tan x\,dx$$ using Riemann Sum.
My Attempt:
$$\int_{0}^{\frac{\pi}{4}}\tan x\, dx=\frac{\pi}{4}\int_{0}^1\tan\left(\frac{\pi}{4}x\right)dx=\frac{\pi}{4}\lim_{n\to\infty}\frac{1}{n}\sum_{r=1}^{n}\tan\left(\frac{{\pi}r}{4n}\right)$$
After this I am not able to proceed
 A: Choose an $N\gg1$ and dividing points 
$$x_k:=\arccos\bigl(2^{-k/(2N)}\bigr)\qquad(0\leq k\leq N)\ .$$
We then have
$$0=x_0<x_1<\ldots<x_N={\pi\over4}\ ,$$
and
$$\cos x_k=2^{-k/(2N)}\qquad(0\leq k\leq N)\ .$$
The mean value theorem gives
$$\cos x_{k-1}-\cos x_k=\sin\xi_k\>(x_k-x_{k-1}),\qquad\xi_k\in[x_{k-1},x_k]\ .$$
It follows that
$$\tan\xi_k\>(x_k-x_{k-1})={\sin\xi_k\over\cos\xi_k}\>(x_k-x_{k-1})={\cos x_{k-1}-\cos x_k\over\cos\xi_k}\ .\tag{1}$$
The unknown point $\xi_k$ is between $x_{k-1}$ and $x_k$. Therefore the value of the  RHS here is between the values one obtains putting $\xi_k:=x_{k-1}$ or $\xi_k:=x_k$. Both lead to the same end result, and the squeeze theorem guarantees that this is also the result for the unknown correct value $\xi_k$. Putting $\xi_k=x_k$ in $(1)$ we obtain
$$\tan\xi_k\>(x_k-x_{k-1})={\cos x_{k-1}\over\cos x_k}-1=2^{1/(2N)}-1\qquad (0\leq k\leq N)\ ,$$
so that admissible Riemann sums $R_N$ become
$$R_N=\sum_{k=1}^N \tan\xi_k\>(x_k-x_{k-1})=N\bigl(2^{1/(2N)}-1\bigr)\ .$$
Now
$$\lim_{N\to\infty}{2^{1/(2N)}-1\over 1/N}=\lim_{t\to0}{\bigl(\sqrt{2}\bigr)^t-1\over t}=\log\sqrt{2}\ ,$$
as is easily checked using Hopital's rule.
A: Use the fact, that if $a_n \to a$ then $\frac{1}{n} \sum_{r=1}^n a_r \to a.$
