Triple integral - possible change of variables? Tried using cylindrical coordinates.

Let $$R =\{(x,y,z) \in \mathbb{R^3} \mid 1 \leq x^2 + y^2 \leq 16, 0 \leq z \leq y + 4\}$$.

Let $$I = \int_{R} (x-y) \,dV.$$ Calculate $$I$$ to 3 decimal places.

I have tried converting to cylindrical coordinates, however I get a negative answer. What am I doing wrong?

So far I have:

$$1 \leq x^2 + y^2 \leq 16 \implies 1 \leq r \leq 4$$ and $$0 \leq z \leq r\sin(\theta) + 4$$ from $$y = r\sin(\theta)$$ and $$x^2 + y^2 =r^2$$

$$(x-y) \,dV = r(r\cos\theta - r\sin\theta) \,dz \,dr \,d\theta$$

Using a diagram of the region $$R$$ I have concluded that theta should be between $$0$$ and $$\pi$$.

I have included the Jacobian and my resulting triple integral is completely correct as checked by an online calculator. However, these limits and change of variables still leads to a negative definite integral.

Are my limits incorrect? Is the change of variables incorrect? Should I use a different change of variables?

$$I = \int_{\theta =0}^\pi \int_{r=1}^4 \int_0^{r\sin(\theta)+4} r^2(\cos\theta- \sin\theta) \,dz \,dr \,d\theta = -\frac{255\pi}{8}$$

• Wolfram Mathematica says your calculation is almost correct. It should be $\frac{-255\pi}{4}$. I think $\theta\in[0,2\pi]$.. Nov 9, 2020 at 18:36
• Any reason you shouldn't have a negative result? $(x-y) < 0$ half the time over the interval $0\le \theta\le 2\pi.$ (And most of the time over the interval $0\le\theta\le\pi.$ Why is this your interval?) Nov 9, 2020 at 18:45

Your are integrating over a cylinder with axial hole ($$1 \leq r \leq 4$$).

It is bound above by the plane $$z = y + 4$$ and below by $$z = 0$$. Please note the plane $$z = y + 4$$ truncates the cylinder (with a slant) such that $$z = 0$$ at $$y = -4$$ and $$z = 8$$ at $$y = 4$$ (So clearly $$\theta$$ should go from $$0$$ to $$2 \pi$$). Note that $$z$$ varies with $$y$$ and for a given $$y$$, $$z$$ remains constant wrt. $$x$$.

Now if you visualize the truncated cylinder, the volume of the cylinder is less in third and fourth quadrant (below $$y$$ axis) and is increasing as we get into positive $$y$$ (first and second quadrant).

Please also consider the function ($$x-y$$) that you are integrating over this cylinder and how the function is set up in different quadrants.

So I am not surprised with a negative value from integration.

Lastly, limits for $$\theta$$ should be $$0$$ to $$2 \pi$$.

$$I = \displaystyle \int_{0}^{2\pi}\int_{r=1}^{4}\int_0^{4+rsin(\theta)} r^2(cos\theta- sin\theta) \, dz \, dr \, d\theta$$