A few weeks ago I found a video on my YouTube feed that had the problem $f'(e^{x^2})=e^{x^2}$ on its thumbnail. I was disappointed to find that the video was intended to fix problems students might have with the chain rule, but I tried to solve that problem anyway. It was easy to solve ($f'(x)$ should equal $x$ for this to be true) but what about $f'(g(x))=h(x)$? How can I solve this equation, where $g$ and $h$ are given? If $g$ is invertible then clearly $f(x)=\int h(g^{-1}(x))dx$, but what if it isn't?
General cases for $g$ and $h$ are accepted.
Hint By the Chain Rule, $$(f \circ g)' = (f' \circ g) g' = h g' ,$$ so $$(f \circ g)(x) = \int_{x_0}^x h(t) g'(t) \,dt .$$
Remark In general we are guaranteed neither uniqueness (even up to adding a constant of integration) nor existence of a solution $f$ of $$f' \circ g = h .$$
If $g$ is constant so is $f' \circ g$, hence there are no solutions if $g$ is constant but $h$ is not.
On the other hand, in the example $g(x) = h(x) = e^{x^2}$ in the problem statement, any differentiable extension of $f : (1, \infty) \to \Bbb R$, $y \mapsto \frac12 y^2 + C$ (for any constant $C$), to $\Bbb R$ is a solution of $f' \circ g = h$, and not all such $f$ satisfy $f'(y) = y$. More generally, the condition $j \circ g = g$ only imposes on $j$ that $j(y) = y$ for $y \in \operatorname{im} g$.