I was trying to solve for the moment of inertia of a solid and a hollow cylinder, and I faced a small problem. I looked through online resources and found many ways to approach the problem.
One of these methods was, integrating the following in cylindrical polar coordinates.
$I_{yy} = \int dm (x^2+z^2)$
In case of hollow cylinder, $x=Rcos\phi$ and $dm=\sigma Rd\phi dz$.Using this I was easily able to obtain the moment of Inertia.
Similarly, in case of solid cylinder, $x=rcos\phi$ and $dm=\rho rdrd\phi dz$. Again, I was able to obtain the correct expression using this.
My question is, what if I try to solve the above integrals forcibly in the cartesian coordinate system. How would the limits of integration, and the area and volume elements change?
I was able to do this for the solid cylinder, as follows :
$I_{yy} = \rho \int\limits_{-a}^{a} \int\limits_{-\sqrt{a^2-x^2}}^{\sqrt{a^2-x^2}} \int\limits_{-l/2}^{l/2} (x^2+z^2)dxdydz$
However, I don't know how to write the integral for hollow cylinder for cartesian coordinates. What would be the surface area element of a cylinder, in cartesian coordinates? I'm inclined to say, $dm=\sigma dz\sqrt{(dx)^2+(dy)^2}$, however, I'm not sure if this is correct.
How would we write the integral then, or is it at all possible to write the integral for surface element purely in cartesian coordinates, or is it only possible in a cylindrical coordinate system?
Suppose we consider the hollow cylinder $C=\{(x,y,z)\in\Bbb{R}^3\,|\,\, x^2+y^2=R^2\,\text{and}\,\, 0\leq z\leq L\}$ of radius $R$ and height $L$. Suppose we also have a nice continuous function $f:\Bbb{R}^3\to\Bbb{R}$ (in your case $f(x,y,z)=x^2+z^2$ to get the $I_{yy}$ part of the moment of inertia). Suppose the cylinder has a mass density of $\sigma$ (not necessarily constant). Then, the question becomes how to express the integral \begin{align} \int_Cf\,dm&=\int_Cf\cdot \sigma\,dA \end{align} in terms of cartesian coordinates. For now I won't invoke any symmetry properties, just to show you how to set things up in the general case.
Well, note that the cylinder is a two dimensional object, so we should only be using two coordinates at a time. If we wish to use cartesian coordinates, we have to be careful, because there is no way to parametrize the cylinder using a single cartesian coordinate system. What we can do is chop up the cylinder $C$ into two pieces and on each piece we can use cartesian coordinates.
So, let $C_{y,+}=\{(x,y,z)\in C\,:\,y>0\}$ be the positive part of the cylinder with respect to the $y$-coordinate. Note that on this portion of the cylinder, we have $y=\sqrt{R^2-x^2}$. Similarly, we can introduce $C_{y,-}$, where $y=-\sqrt{R^2-y^2}$. In these cases, the area elements are $\sqrt{1+\left(\frac{dy}{dx}\right)^2}\,dx\,dz=\frac{R}{\sqrt{R^2-x^2}}\,dx\,dz$ (note that we have to do this calculation twice, once with $y=\sqrt{R^2-x^2}$ to deal with the upper part of the cylinder, and once with $y=-\sqrt{R^2-x^2}$ for the lower part of the cylinder, but due to the square term, the $\pm$ signs do not make a difference, so actually the geometry of the cylinder simplifies life for us slightly).
Thus, \begin{align} \int_Cf\,dm&=\int_Cf\sigma\,dA\\ &=\int_{C_{y,+}}f\sigma\,dA+\int_{C_{y,-}}f\sigma\,dA\\ &=\int_{(-R,R)\times(0,L)}f(x,\sqrt{R^2-x^2},z)\sigma(x,\sqrt{R^2-x^2},z)\cdot\frac{R}{\sqrt{R^2-x^2}}\,dx\,dz\\ &+\int_{(-R,R)\times(0,L)}f(x,-\sqrt{R^2-x^2},z)\sigma(x,-\sqrt{R^2-x^2},z)\cdot\frac{R}{\sqrt{R^2-x^2}}\,dx\,dz\\\\ &=\int_0^L\int_{-R}^Rf(x,\sqrt{R^2-x^2},z)\sigma(x,\sqrt{R^2-x^2},z)\cdot\frac{R}{\sqrt{R^2-x^2}}\,dx\,dz\\ &+\int_0^L\int_{-R}^Rf(x,-\sqrt{R^2-x^2},z)\sigma(x,-\sqrt{R^2-x^2},z)\cdot\frac{R}{\sqrt{R^2-x^2}}\,dx\,dz \end{align} This shows you how to set up an integral over a cylinder using cartesian coordinates. Note that while for the sake of presentation I used $C_{y,+},C_{y,-}$, I could have just as well defined $C_{x,+},C_{x,-}$ and carried on the computation analogously.
In your case, $f(x,y,z)=x^2+z^2$ doesn't actually depend on the second entry, and $\sigma$ is constant so the two integrals are actually the same thing thus, \begin{align} \int_C(x^2+z^2)\,dm&=2\int_0^L\int_{-R}^R(x^2+z^2)\cdot\sigma\cdot\frac{R}{\sqrt{R^2-x^2}}\,dx\,dz, \end{align} which I leave to you to calculate if you wish. Note that we could have easily predicted this symmetry right from the beginning because the cylinder is clearly symmetric under the change $y\mapsto -y$, and likewise the function $f(x,y,z)=x^2+z^2$ also enjoys this symmetry property. In general though if you didn't have such a symmetry, you'd have to grind through the two double integrals I wrote above.
Extra Remark.
Throughout my answer, one small point which I glossed over is that $C\neq C_{y,+}\cup C_{y,-}$; the difference of the sets is non-empty, but the stuff that is left out is negligible (strictly speaking has measure zero with respect to the surface measure on the cylinder). Likewise, the parametrization $(-R,R)\times (0,L): (x,z)\mapsto (x,\sqrt{R^2-x^2},z)$ doesn't cover the whole of $C_{y,+}$, but it covers most of it, and the stuff it doesn't cover is again negligible, which is why all the integrals above are equal.