9

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

Bernard
  • 179,256
Maverick
  • 10,736
  • Those Riemann sums have no closed formula that might help. – lhf Aug 22 '19 at 15:53
  • 1
    Maybe do a change of variable first to convert it to the form 1/x. Then make use of https://math.stackexchange.com/questions/1322182. – kvantour Aug 27 '19 at 09:32

2 Answers2

8

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.

  • 1
    Really nice job! (+1) I'm a fan of the creative choice of $x_k$ – clathratus Aug 27 '19 at 19:11
  • 2
    Note that this is part of a general trick, if you happen to know the solution to an integral in advance. Suppose that you know that $\int f(x) dx = F(x)$ and that you can invert the function $F$. Then, to compute $\int_a^b f(x) dx$ by Riemann sums, choose division points at $F^{-1} \left( \tfrac{k}{N} F(a) + \tfrac{N-k}{n} F(b) \right)$. In this case, $F(x) = - \log \cos x$, so $F^{-1}(t) = \cos^{-1}(e^{-y})$. This explains where the formula $\cos^{-1} 2^{-k/(2N)}$ comes from. – David E Speyer Aug 29 '19 at 12:41
  • 1
    This trick is of course useless for computing new integrals, but useful for problems where the teacher says "using Riemann sums". Similar tricks: If the teacher says "using a $u$-substition", make the substitution $u=F(x)$; if the teacher says "using integration by parts", compute $\int u dv$ where $v=F(x)$ and $u=1$. (Can you tell that I don't like being told how to do something?) – David E Speyer Aug 29 '19 at 12:45
  • @Christian Blatter. In (1) why have you chosen to write $\tan \xi_{k}$ instead of $\tan x_{k}$ or $\tan x_{k-1}$. And after that I you have replaced$\xi_{k}$ by $x_{k}$. This is the only confusion that I have – Maverick Aug 29 '19 at 15:44
  • 2
    @Maverick: General Riemann sums are of the form $\sum_{k=1}^N f(\xi_k)>(x_k-x_{k-1})$ with $\xi_k\in[x_{k-1},x_k]$. When $f$ (as $f:=\tan$) is integrable you can take the lim of arbitrary such sums given that $\lim_{N\to\infty}\bigl(\max_k(x_k-x_{k-1})\bigr)=0$. – Christian Blatter Aug 29 '19 at 18:12
3

Use the fact, that if $a_n \to a$ then $\frac{1}{n} \sum_{r=1}^n a_r \to a.$