On the assumption that you have set up the integral correctly, the $x$'s appearing in two occurrences of $\mathrm{d}x$, despite being given the same name, nonetheless refer to different variables. And there's no way to tell from the notation which of the two $x$'s are meant to be the same as the $x$ appearing in $x^2$. Or maybe even that $x$ is supposed to be a third variable entirely that is constant with respect to the other two $x$'s.
Problems like this are why it's a very bad thing to use the same variable to mean different things in the same scope. Generally, its preferred to outright forbid such usage, so that readers can always be confident that when the same variable is reused in the same scope, it means the same thing in every usage.
The fact that you set up the integral and are still confused, however, leaves me nearly certain of one thing:
You have not set up the integral correctly.
Without having tried to reverse engineer where you went wrong, I think the likely fixes to this state of affairs are either
- to recognize you introduced two dummy variables when setting up the integral, and give them different names when you redo the setup
- to actually introduce meaningful variables to be integrated over
For the sake of pedantry (i.e. I'm nearly certain that this is not what you are trying to do and/or understand), there is a situation where it does make sense to have an integrand of $f(x) \, \mathrm{d}x \mathrm{d}x$ where all of the $x$'s refer to the same thing: when this formula refers to a differential form you're integrating over a surface.
But if you really knew enough about the arithmetic of differential forms to correctly write down such a formula, you surely also be aware that $\mathrm{d}x \mathrm{d}x = 0$.