<s>[INST] Evaluate using Riemann sums $\int_{\pi/2}^{3\pi/2}(4\sin 3x - 3 \cos 4x)dx$ I have to evaluate this integral using Riemann sums. I've already tried:
$$\int_{\pi/2}^{3\pi/2}(4\sin 3x  - 3\cos 4x)dx = [\delta x = \frac{\pi}{n}, x_i = \frac{\pi}{2} + \frac{i\pi}{n}] =$$$$= \lim_{n \rightarrow \infty}\sum_{i = 1}^n(4\sin(3(\frac{\pi}{2} + \frac{i\pi}{n})) - 3\cos(4(\frac{\pi}{2} + \frac{i\pi}{n})))\frac{\pi}{n} 
 = \lim_{n \rightarrow \infty}(\sum_{i = 1}^n(4\sin\frac{3(\pi n + 2\pi i)}{2n} - 3\sum_{i = 1}^n\cos \frac{4(\pi n + 2\pi i)}{2n})\frac{\pi}{n}
 = \lim_{n \rightarrow \infty} (4\Re[\sum_{k = 1}^ne^{\frac{4i(\pi n + 2\pi k)}{2n}}] - 3\Re[\sum_{k = 1}^ne^{\frac{3i(\pi n + 2\pi k)}{2n}}])\frac{\pi}{n}
 $$
But what can i do with this $e^{.....}$ expressions ? Or maybe here exists a simpler way to evaluate this using Riemann sums.
 [/INST] To evaluate the Riemann sums use the identities:
$$\sum_{k=1}^n \sin kx = \frac{\sin \frac{nx}{2} \sin \frac{(n+1)x}{2}}{\sin \frac{x}{2}}, \quad \sum_{k=1}^n \cos kx = \frac{\sin \frac{nx}{2} \cos \frac{(n+1)x}{2}}{\sin \frac{x}{2}}, $$
which can be derived as the imaginary and real parts of the geometric sum $\sum_{k=1}^n e^{ikx}$.
Thus,
$$\begin{align}\int_{\pi/2}^{3\pi/2} 4 \sin 3x \, dx &= \lim_{n \to \infty}\frac{4\pi}{n}\sum_{k=1}^n \sin\left(\frac{3\pi}{2} + k\frac{3\pi}{n} \right) \\ &= \lim_{n \to \infty}-\frac{4\pi}{n}\sum_{k=1}^n \cos\left(k\frac{3\pi}{n} \right) \\ &= \lim_{n \to \infty}-\frac{4\pi}{n}\frac{\sin \frac{3\pi n}{2n} \cos \frac{3\pi(n+1)}{2n}}{\sin \frac{3 \pi }{2n}} \\ &=  \lim_{n \to \infty}-\frac{3}{8}\frac{\frac{3\pi}{2n}}{\sin \frac{3 \pi }{2n}}\sin \frac{3\pi}{2} \cos \left(\frac{3\pi}{2}(1 + 1/n)\right) \\ &= -\frac{3}{8} \cdot 1 \cdot (-1)\cdot 0 = 0\end{align}$$
The integral of $3 \cos 4x$ can be handled in a similar way.
</s>