How can we simplify this integral? $\int{x\frac{f(x)}{\int f(x) dx} dx}$ In a machine learning lecture, we encountered the following integral that we needed to solve to calculate the mean of some random variable $x$:
\begin{equation*}
  \int{x\frac{f(x)}{\int f(x) dx} dx}
\end{equation*}
Without really explaining, the professor just simplified it to this:
\begin{equation*}
  \frac{\int x f(x) dx}{\int f(x) dx}
\end{equation*}
I'm not sure how that works. Since the integration is without limits, then the result is a function not a constant, right? It can't be factored out as if it were a constant. Am I missing something? Does integrating on the same variable twice have any special properties that are relevant here?
I'm sorry if the question is lacking in details, if there's anything I can edit to make it clearer, please let me know.
Edit: The problem is solved. The simplification is because the denominator is a definite integral and I didn't understand that at first. Since the result of a definite is just a constant, it can be factored outside the integral.
 A: It should read$$\int x\frac{f(x)}{\int_a^bf(y)dy}dx=\frac{\int xf(x)dx}{\int_a^bf(y)dy},$$where the $x$-integral may or may not be definite (though in this context it would be).
A: I think maybe it is meant to read something like:
$$\int_a^bx\frac{f(x)}{\int_a^bf(x)dx}dx$$
as then the bottom integral is a constant and you can bring it outside:
$$\frac{1}{\int_a^bf(x)dx}\int_a^bxf(x)dx=\frac{\int_a^bxf(x)dx}{\int_a^bf(x)dx}$$

Or maybe if it is:
$$\int x\frac{f(x)}{\int f(x)dx}dx$$
then you can define:
$$F(x)=\int f(x)dx$$ so you get:
$$\int x\frac{F'(x)}{F(x)}dx=\int\frac{F^{-1}(u)}{u}du$$
I don't really understand the notation but its a suggestion
A: call $Q= x f(x) $, then our integral is:
$$ \int \frac{Q}{\int f(x) dx} dx $$
Now integrating by parts:
$$ \frac{ \int Q dx}{\int f(x) dx} +\int \frac{\int Q dx}{ ( \int f(x) dx)^2} f(x) dx$$
For the above to be equal to, $ \frac{ \int x f(x) dx}{\int f(x) dx} i.e: \frac{\int Q dx}{\int f(x) dx}$,
$$ \int \frac{ \int Q dx}{ (\int f(x) dx )^2} f(x) dx= 0$$
So, the equality you wrote is only true for functions $f(x)$ which satisfy above criteria.
A: This is a typical abuse of notation.
Unless we have bounds on an integral, like $\int_a^b$, the integral $\int f(x)dx$ stands for a primitive function of $f$.
However, according to the argument of your professor he/she really means an integral with bounds.
