# Composition of functions question

Am restricting this question to the elementary context of Riemann integrals and continuous functions $f,g.$ Because this came up in the context of another question, I would prefer to keep the examples from that question, at the risk of artificiality.

Let $g:[0,4]\to \mathbb{R}$ such that

$$\int_0^1g(x)dx = \int_3^4 4-g(x)dx.~~~~~(1)$$

An example would be $g(x) = x(x-3)^2.$

It is I think not true in general that the above implies

$$\int_0^1 f(g(x))dx = \int_3^4 f(4- g(x))dx ~~~~~(2)$$

however the equality happens to hold with this $g(x).$

My attempt to justify the implication ran as follows. Using an arbitrarily fine Riemann sum approximation of the L.H.S. integral in (1) we get an arbitrarily close approximation to the integral. Using the same process for the R.H.S we (at least in this special case, which is part of my assumptions) have a rearrangement of summands, hence the same approximation.

Regarded as a sum of (say) rectangles on subintervals of $[0,1],$ it seems that we may apply $f$ to the approximation of $g$ in each subinterval and get a Riemann sum for the L.H.S. of (2). Since on the R.H.S. of (2) we are applying $f$ to the same summands (up to rearrangement) it would seem that as the subintervals shrink the equality in (2) should follow.

My question is, where is the flaw in this naive reasoning, if there is one? Are there additional assumptions that would make the implication true?

• I have mostly seen caps being used for these abbreviations. – codetalker Mar 13 '17 at 14:50

For this $g:\mathbb{R}\rightarrow\mathbb{R}, x\mapsto x(x-3)^2$ the implication seems to be true because of a benevolent symmetry: Lets consider the restrictions $g_1:=g|_{[0,1]}$ and $g_1:=g|_{[3,4]}$.
One can prove that $g_1$ and $g_2$ are invertible (bacause of monotonicity on the restricted intervals) and I think (considering the picture - try to prove this formally) that the relation $$(g_2^{-1})'(4-y)=-(g_1^{-1})'(y)$$ holds for all $y\in[0,4]$. (EDIT: It is easy to check, that $g(x)=4-g(4-x)$. From this I deduced the relation.) This is the symmetry, of which we will make use of. The rest is just integration by substitution (the details with the occurring improper integrals are left to the reader and I will ignore them neatly): \begin{align} \int_3^4 f(4-\underbrace{g(x)}_{g_2(x)})dx &= \int_{g_2(3)=0}^{g_2(4)=4} f(4-y)(g_2^{-1})'(y)dy \\ &= -\int_{0}^{4} f(4-y)(g_1^{-1})'(4-y)dy \\ &= \int_{0}^{4} f(y)(g_1^{-1})'(y)dy \\ &= \int_{g_1^{-1}(0)=0}^{g_1^{-1}(4)=1} f(g_1(x))g_1'(x)(g_1^{-1})'(g_1(x))dx \\ &\stackrel{\dagger}{=} \int_{0}^{1} f(g(x))dx. \end{align} The equality $\dagger$ holds because $g_1'(x)(g_1^{-1})'(g_1(x)) = g_1'(x)\frac{1}{g_1'(g_1^{-1}(g_1(x)))} = g_1'(x)\frac{1}{g_1'(x)} = 1.$
To construct one counter example of the implication (for arbitrary $g$) you have to try to find $g$, which violates the symmetry $(g_2^{-1})'(4-y)=-(g_1^{-1})'(y)$. I try to make it plausible without a explicit construction: Since the continuous functions are dense in $L^p$ spaces, its okay just to construct a discontinuous Riemann integrable function for $g$. Consider $g:=4\chi_{[0,\frac{1}{2}]}+2\chi_{[3,4]}$ for example. Then the condition for $g$ is fulfilled. Now take a continuous $f$ with $f(0)=f(4)=0$, $f(2)=1$, then you have $$\int_0^1 f(g(x))dx = \int_0^1 0\ dx = 0$$ but $$\int_3^4 f(g(x))dx = \int_3^4 1\ dx = 1.$$ With an approximation argument you will get a contradiction for the original statement with continuous $g$.
• The proof above seems correct to me and I will work through carefully. I wonder if you think the following would work? [Given the symmetry], for each finite Riemann approximation $\sum_n$ for $g_1,g_2$ (equal by hypothesis), there is a finite approximation $\sum_n$ for $f(g_1),f(g_2))$, s.t. the sums for $f(g_1), f(g_2)$ are equal at each step and approach a common limit. – daniel Mar 13 '17 at 15:36
• I dont think that this way were simpler. There is lots of work to do in argumentation because of that composition with $f$. Take this problem for example: for a given decomposition $(x_i)$ of the interval, why is $(g(x_i))$ an admissable decomp. too? And if yes, why can we gernerate abritrary refinements? All that nasty work is done fundamental theorem of calculus. So it makes almost always more sense to use them. ;) Here we just have substitution in integrals and one cute symmetry condition. :) – tofurind Mar 13 '17 at 15:38
• tofurind, is it possible there is a typo in your proof? The first equality seems to work numerically when I use $\int_0^4 f(4-y)(g^{-1}))'(y)dy$ on the r.h.s. instead of what you have... – daniel Mar 16 '17 at 5:50
• Yes indeed, it seems that I had messed up with the substitution there, sorry. We have the substitution $x=g_2^{-1}(y)$ with $\frac{dx}{dy}=(g_2^{-1})'(y)$ resp. $dx=(g_2^{-1})'(y)dy$. But I did the same mistake in the last substition again, thus the argument seemed to work then. ;) I have corrected the prove, thank you. – tofurind Mar 16 '17 at 7:43