Say we have a uniform density wire in the shape of the parabola $1-x^2$ from $-1$ to $1$, rotated about $x=0$ (y axis). I'm attempting to calculate the moment of inertia for this object.
I have the following $$\int_{x=-1}^{x=1} x^2 dm = \int_{x=-1}^{x=1} x^2 \rho d\ell$$ I interpret this as follows. $dm$ is a small change in mass as I make a small change along the wire, $d\ell$. Now, I just need to express the small change along the wire $d\ell$ in terms of a small change in $x$, $dx$. However, I don't know how to do this.
I postulate the following. Assume we are making small changes $d\ell$ along a function $f(x)$. Then I tack on the arc length integrand so $$d\ell = \sqrt{1+f'(x)^2}dx$$
I used $\sqrt{1+f'(x)^2}$ precisely because it was related to arc length, but I don't have any other justification for using it.
As such, I use some already known moments of inertia to see if this is accurate. Both a stick rotated about it center and end can be derived from my result, since
$$f(x)=0,\qquad \rho = {M\over L}$$ $$\int_{x=-L/2\text{ or }0}^{x=L/2\text{ or }L} x^2 dm = \int_{\text{whatever}} x^2 \rho \cdot\sqrt{1+0^2}dx = \frac13 ML^2\text{ or }\frac1{12} ML^2$$
Using it on a hoop (which rotates between $x$ or $y$. $z$ is just using a circle's arc length which doesn't need my postulated method) also works
$$f(x)=\sqrt{r^2-x^2},\qquad \rho = {M\over 2\pi r}$$ $$\int_{x=-r}^{x=r} x^2 dm = \int_{\text{whatever}} x^2 \rho \cdot\sqrt{1+\left({-x\over \sqrt{r^2-x^2}}\right)^2}dx = \frac12 Mr^2$$
This leads me to believe that the formula which describes the moment of inertia about some axis with varying distance $x$ of a 1D object described by $f(x)$ is (I omit bounds but w/e) $$\int x^2 dm = \int x^2 \rho d\ell = \int x^2 \rho \sqrt{1+f'(x)^2}dx$$ $\rho$ in the meanwhile should just be the mass divided by the true arc length of the object.
If my postulate is correct, then the moment of inertia of a uniform density wire in the shape of the parabola $1-x^2$ from $-1$ to $1$, rotated about $x=0$ is just $$\int_{-1}^{1} x^2 \rho \sqrt{1+4x^2} dx = \frac1{32}\rho \left(18\sqrt5 - \operatorname{arcsinh}(2)\right)$$ Since $$\rho = \frac{M}{\displaystyle\int_{-1}^1\sqrt{1+4x^2}dx} = \frac{M}{\sqrt5 + \frac12\operatorname{arcsinh}(2)}$$ it seems the moment of inertia of my object is $$\frac1{32}\rho \left(18\sqrt5 - \operatorname{arcsinh}(2)\right) = \frac{M(18\sqrt5 - \operatorname{arcsinh}(2))}{16(2\sqrt5 + \operatorname{arcsinh}(2))}$$
I have two questions. Is the above moment of inertia $\frac{M(18\sqrt5 - \operatorname{arcsinh}(2))}{16(2\sqrt5 + \operatorname{arcsinh}(2))}$ correct?
Is my general formula $\int x^2 \rho \sqrt{1+f'(x)^2}dx$ correct?



Yes of course, indeed we have that
$$ds= \sqrt{dx^2+dy^2}=\sqrt{1+\left[f'(x)\right]^2}dx$$
and therefore by definition since $dm=\rho \,ds$
$$I = 2\rho\int_0^1 x^2\sqrt{1+\left[f'(x)\right]^2}dx$$