[Math] Evaluate using Riemann sums $\int_0^a \cos x\mathrm{d}x$

calculusintegration

I have to evaluate this integral
$$\int_0^a \cos x\mathrm{d}x$$
using the Riemann sums. I've been thinkin about doing something like ($a = k\pi$, $k\in \mathbb{R} $)
$$\int_0^a \cos x\mathrm{d}x = \lim_{n\rightarrow \infty}\frac{k\pi}{n}\sum_{i=1}^{n}\cos{\frac{ik\pi}{n}}$$
but I'm totally stuck. Any help would be appreciated!

Best Answer

I don't think you need to specialize to $a=k \pi$. Rather, there is a simple, analytical expression for the sum of the cosine series.

Write

$$\sum_{k=1}^n \cos{\left(\frac{k a}{n}\right)} = \Re{\left[\sum_{k=1}^n e^{i k a/n}\right ]} $$

The sum on the right is a simple geometrical series:

$$\sum_{k=1}^n e^{i k a/n} = \frac{e^{i a}-1}{1-e^{-i a/n}} = e^{i a (1+(1/n))/2} \frac{\sin{(a/2)}}{\sin{(a/(2n))}}$$

Taking the real part of the sum, I get

$$\frac{a}{n} \sum_{k=1}^n \cos{\left(\frac{k a}{n}\right)} = \frac{a\sin{(a/2)}}{n \sin{(a/(2 n))}} \cos{\left[\frac{a}{2}\left ( 1+\frac{1}{n}\right)\right]}$$

To evaluate the integral, take the limit as $n \to \infty$ and note that, in this limit, $n \sin{(a/(2 n))} \approx a/2$. Then

$$\int_0^a dx \, \cos{x} = a \frac{\sin{(a/2)}}{a/2} \cos{(a/2)} = \sin{a}$$