I am having trouble figuring this very simple thing out. Consider the $L^1$ space. Saying that a positive random variable with density lies in $L^1$ means that $\mathbb{E}[X] < \infty$. On the other hand, the density itself lies in $L^1$ in the analysis framework since $$ \int_{\mathbb{R}} f(x) dx = 1 < \infty. $$ Does that mean that the two notions of $L^p$ space are not the same ?
I understand that the transfer theorem is probably what's linking the two notions. However I could not figure it correctly.
The definiton $L^{p}$ depends on the measure under consideration. In Probability Theory a random variable $X$ are defined on a probability space $(\Omega, \mathcal F,P)$ and integrability of $X$ means $\int_{\Omega} |X| dP<\infty$ which may or may not hold. If $X$ has a density $f$ then $f$ is always integrable w.r.t. Lebesgue measure: $\int_{\mathbb R} f(x)dx <\infty$. The statement $X \in L^{1}$ is equivalent to $\int_{\mathbb R} |x| f(x)dx <\infty$. This equivalence comes from the transfer theorem.