Evaluate Integrals by Changing to Polar Coordinates I'm working on this question for my Calculus III Homework:
Evaluate the given integral by changing to polar coordinates. 
$$\iint_{R} (5x-y)\,dA$$
where R is the region in the first quadrant enclosed by the circle
$x^2 + y^2 = 16$ and the lines $x = 0$ and $y = x$.
I mapped out the coordinates and got $\displaystyle\iint_R (5r\cos\theta-r\sin\theta)\,r \,dr\, d\theta$, where $0 \le r \le 4$ and $0 \le \theta \le \pi/4 $. Working it out it came out to $64 \sqrt{2} \, 64/3$, which was incorrect. If anyone could point out where I went wrong (most likely with defining coordinates), I would appreciate it very much.
 A: $$\int_{\pi/4}^{\pi/2}\int_{0}^{4}(5r\cos\theta-r\sin \theta)r\,dr\,d\theta$$
$$\int_{\pi/4}^{\pi/2}\int_{0}^{4}(5r^2\cos\theta-r^2\sin \theta)\,dr\,d\theta$$
$$\int_{\pi/4}^{\pi/2}(5\cdot64/3\cos\theta-64/3\sin \theta)\,d\theta$$
$$(5\cdot64/3(1-\frac{1}{\sqrt{2}})+64/3(0-\frac{1}{\sqrt{2}})=\frac{320-192\sqrt{2}}{3}$$

A: $$
\int \left( \int (r\cos\theta) r\,dr\right)\,d\theta = \int\left( (\cos\theta) \int r^2\,dr \right) \, d\theta
$$
The above can be done because $\cos\theta$ does not change as $r$ changes; thus it is a "constant" as far as the inside integral is concerned.
Next, observe that the inside integral, with respect to $r$, does not change as $\theta$ changes, since no $\theta$ appears in it.  It is therefore a "constant" as far as the outside integral is concerned, and thus can be pulled out, getting
$$
\int \cos\theta\,d\theta \cdot \int r^2\,dr.
$$
As for the bounds on $\theta$: draw the picture.  The line $y=x$ is where $\theta=\pi/4$, and the line $x=0$ is where $\theta=\pi/2$.
