Answer
a. $U=\frac{cos(\frac{\pi}{4n})-cos(\frac{\pi}{2}+\frac{\pi}{4n})}{sin(\frac{\pi}{4n})/(\frac{\pi}{4n})}$
b. $1$
Work Step by Step
a. Step 1. Let $f(x)=sin(x)$ and divide the interval $[0,\frac{\pi}{2}]$ into $n$ parts with equal width of $\Delta x=\frac{\pi}{2n}$; we denote the partition as $||P||$ and as $n\to\infty, ||P||\to0$.
Step 2. To calculate the upper sum $U$, use the right end of each division (because $f'(x)\gt0$) with
$x_k=k\Delta x, f(x_k)=sin(x_k)=sin(k\Delta x), k=1,2,...n$
and the area of the rectangle of this division is given by
$A_k=f(x_k)\Delta x=sin(k\Delta x)\Delta x=(\frac{\pi}{2n})sin(\frac{k\pi}{2n})$
Step 3. Using the formula given in the Exercise, evaluate the upper sum as
$U=A_R=\Sigma_{k=1}^nA_k=\Sigma_{k=1}^n(\frac{\pi}{2n})sin(\frac{k\pi}{2n})=(\frac{\pi}{2n})(\frac{cos(\frac{\pi}{4n})-cos((n+ \frac{1}{2})\frac{\pi}{2n})}{2sin(\frac{\pi}{4n})})=\frac{cos(\frac{\pi}{4n})-cos(\frac{\pi}{2}+\frac{\pi}{4n})}{sin(\frac{\pi}{4n})/(\frac{\pi}{4n})}$
b. Evaluating the integral as
$\int_0^ \frac{\pi}{2}sin(x)dx=\lim_{||P||\to0}A_R=\lim_{n\to\infty}A_R= \frac{1-0}{1}=1$