I'm a first year Physics student and currently practicing questions from our 'Introductory Mathematics for Physicists' course. I ran into a problem dealing with a proof of improper integral of a general function. We were needed to prove that in $x>0$:$\\$ $$\int_0^\infty f(x)dx= \frac12 \int_0^\infty \biggl[f(x)+\frac{1}{x^2}f(\frac1x)\biggl]dx$$
$$-$$The solution that was given to us was this:
$$\int_0^\infty f(x)dx=\biggl|\frac1u=x, -\frac{du}{u^2}=dx\biggl|=$$ $$\int_\infty^0 f(\frac1u)(-\frac{du}{u^2})=-\int_\infty^0 \frac{1}{u^2}f(\frac1u)du=$$ $$\int_0^\infty \frac{1}{u^2}f(\frac1u)du=$$ $$\int_0^\infty \frac{1}{x^2}f(\frac1x)dx$$
I don't understand that last transition. When I solved it by myself I got:
$$\int_0^\infty x^2f(x)dx$$
What am I missing here?