I want
\begin{equation}
\int\_a^b f(g(x))dg=\int\_{g(a)}^{g(b)} f(t)dt,\tag{$\heartsuit$}\label{heart}
\end{equation}
where $g$ is a continuous but not necessarily monotone (or bounded variation) function of $[a,b]$, both integrals are Riemann–Stieltjes (that is, $\int\_a^b h(x)dg(x)$ is the limit of Riemann–Stieltjes sums $\sum\_{i=0}^{n-1} h(c\_i)(g(x\_{i+1})-g(x\_i))$ where $a=x\_0<x\_1<\dotsb<x\_n=b$ is a partition of $[a,b]$, $c\_i\in [x\_i,x\_{i+1}]$ for $i=0,\dotsc,n-1$, and $\max \lvert x\_{i+1}-x\_i\rvert$ goes to 0).


If both integrals in \eqref{heart} exist, does it follow that they are equal?


Note that without continuity of $g$ this is not necessarily so, even if $g$ is increasing: say, if $a=0$, $b=1$, $g(x)=\chi\_{[1/2,1]}$, and $f(0)=f(1)=0$, then LHS is 0 but RHS may be non-zero. For increasing continuous $g$ this is less or more obvious. But we sometimes would like to have not monotone change of variables (cf. $\int\_a^b f(x^2)x\,dx=\frac12 \int\_{a^2}^{b^2} f(t)dt$ with $a<0<b$).


If not, what are additional conditions under which \eqref{heart} holds?



Change of variables in Riemann–Stieltjes integral
Looks like the answer is yes, they are equal, and perhaps you do not really need to assume the existence of the integral in the right-hand side, that is, $\int\_{g(a)}^{g(b)} f(t) dt$. This is proved in the context of Henstock–Kurzweil integrals as Theorem 6.1 in [1].


The key lemma is that if $g(a) = g(b)$, then $\int\_a^b f(g(x)) dg(x) = 0$. This is applied to reduce the problem to the case when $g$ is monotone, which is rather well-known.


Reference:


[1] Michael Bensimhoun, *Change of Variable Theorems for the KH Integral*, Real Analysis Exchange 35(1) (2009–2010): 167–194, [DOI:10.14321/realanalexch.35.1.0167](https://doi.org/10.14321/realanalexch.35.1.0167)


