# Monotonic operations and integrals

If I have a monotonic function, say ln, can I bring it inside an integral?

in other words, is $$\ln\left[ \int f(x)\, dx\right] = \int \ln(f(x))\, dx.$$

My limits of integration don't depend on $$x,$$ so I think I can.

Could I move expectation inside the integral?

(I am working on something with the Cramer-Rao inequality, which requires that I take the natural log and then the expectation of a function.)

• You can say, I think, that $\ln\int f\ge \int\ln f,$ since $\ln$ is a concave function. See Jensen's Inequality. – Adrian Keister Jun 13 at 21:27
• To see this intuitively, consider the integrals as a limit of a specific sum: $\int f(x) = \lim \sum \cdots$. Your claim is then equivalent to $\ln(\lim \sum \cdots) = \lim \sum \ln(\cdots)$. Clearly, this should not hold for operations, which do not commute with summations, such as $\ln$. In contrast, if you take $g(x) := 2\cdot x$ as your function applied on the integral, you clearly have $g(\int f(x)) = \int g(f(x))$. Indeed, $g$ commutes with summation. – ComFreek Jun 14 at 7:31

## 2 Answers

$$\ln\left(\int_0^1 x\,dx\right)=\ln\left(\frac{1}{2}\right),$$ but $$\int_0^1 \ln x\,dx=-1$$. So no, it's not that simple.

No. As a counterexample, take $$f(x)=e^x$$.