Functions for which $\int f(g(x))\, \mathrm dx = f\left(\int g(x) \, dx\right)$

I was playing around with some integrals, and this question popped into my head:

What functions exist such that the following is true? $$\int f(g(x))\;\mathrm dx = f\left(\int g(x)\;\mathrm dx\right)$$

There there's the obvious example of $f(x) = x, \;g(x)=e^x$, but I was wondering if others exist.
EDIT 1: As pointed out in the comments, this is true for any $g$ if $f(x) = x$. But, this is sort of trivial--I'd really like to know about for other assignments of $f$... :)

My question is twofold:

  1. Are there known functions that satisfy this equality?
  2. What sort of topic in math would this fall under? (e.g. Abstract Algebra, Differential/Integral equations, etc.)

EDIT 2:
I'd also accept an answer to a similar, but slightly different question, as phrased in the comments by user1551; if it's easier/more feasible to answer:

Find a pair of functions $f$ and $g$ such that $\int_a^b f(g(x))dx=f\left(\int_a^bg(x)dx\right)$ for any interval $[a,b]$


Solution 1:

I can reformulate the problem in the following way. Suppose we have $$\int_0^x f(g(y)) dy = f\left( \int_0^x g(y)dy \right).$$ Take a derivative of each side to get $$f(g(x))=g(x) f'\left(\int_0^x g(y)dy \right).$$ Assume $g(x)$ is invertible. Then letting $z=g(x)$ we get $$\frac{f(z)}{z} = f'\left( \int_0^{g^{-1}(z)} g(y) dy \right).$$

Let $h(z)=\int_0^{g^{-1}(z)} g(y) dy$ be some arbitrary function. Note that this is the same as $h(g(x))=\int_0^x g(y)dy$. Then we look for solutions to $$\frac{f(z)}{z} =f'(h(z)),\qquad f(0)=0$$ $$h'(z)=z/g'(g^{-1}(z)), \qquad h(g(0))=0.$$ The boundary conditions come from plugging in $x=0$ into the appropriate expressions. We see that regardless of what $h(z)$ is, $f(z)=z$ is always a solution, as mentioned in the comments.

I spent some time trying to find another solution, but I could not. However, if you modify the original problem to $$\int_0^x f(g(y)) dy = f\left( \int_{-\infty}^x g(y)dy \right),$$ then our new equations reduce to $$\frac{f(z)}{z} =f'(h(z)),\qquad f(0)=0$$ $$h'(z)=z/g'(g^{-1}(z)), \qquad h(g(-\infty))=0.$$

It turns out that $f(x)=x^p$ and $h(x)=x/p^{p-1}$ satisfy the first equation. Then if we choose $g(x)=e^{x p^{p-1}}$, we find the second equation is also satisfied.

If we really asked, for what $f$ and $g$ does there exist such that $\int_{-\infty}^x f(g(y)) dy - f\left( \int_{-\infty}^x g(y)dy \right)$ is constant, then the above gives a new solution.