Given the partition $\{0,\frac{\pi}{2},\,\pi\}$, $\bar{x}_1=\frac{\pi}{2}$, and $\bar{x}_2=\pi$, find the Riemann sum $R(P)$ for the integral $\int_0^{\pi}\cos(x)\,dx$.

Problem: 

Given the partition $\{0,\frac{\pi}{2},\,\pi\}$, $\bar{x}_1=\frac{\pi}{2}$, and $\bar{x}_2=\pi$, find the Riemann sum $R(P)$ for the integral $\int_0^{\pi}\cos(x)\,dx$.

Answer: 

$R(P)=-\frac{\pi}{2}$