If $f$ is a differentiable function in $[0,1]$ such that $f(f(x))=x$ and $f(0)=1$.
Find the value of $\int_{0}^{1} (x-f(x))^{2016} dx$.
This is a very popular problem(maybe). I used two attempts to solve the problem. It appears my Attempt $1$ didn't quite work, as I intended. My Attempt $2$ surprisingly worked. I will demonstrate both the attempts.
Attempt 1:
We first consider,if $f(x)=y$ then, $f(f(x))=x=f(y).$ We consider, the integral $I=\int (x-f(x))^{2016} dx$.
We try changing, all the independent variable of integration, from $x$ to $y$( or, in other words we are trying to apply method of substitution i.e substituting, $y=f(x)$ in $I$). For that, we have to replace $dx$ as well.
We notice that, $$f(y)=x\implies \frac{df(y)}{dy}\frac{dy}{dx}=\frac{d}{dx}x\implies f'(y)\frac{dy}{dx}=1\implies f'(y)dy=dx.$$ We are now in a place to completely do the change of variables in $I$.
We have, $$I=\int (x-f(x))^{2016} dx=\int (f(y)-y)^{2016}f'(y)dy$$. We can again, change the variable representation in $I$ to $x$ as, $$I=\int(f(x)-x)^{2016}f'(x)dx\tag {1}.$$
Now, we again observe $\int (x-f(x))^{2016} dx$ and adding it with $( 1),$ we have $$2I=\int\left( (x-f(x))^{2016} +(f(x)-x)^{2016}f'(x)\right)dx.$$ This can be readily simplified to,
$$2I=\int\left( (x-f(x))^{2016}(1 +f'(x))\right)dx.$$
We now, have, $$I=\frac{\int\left( (x-f(x))^{2016}(1 +f'(x)\right)dx}{2}.$$ We hereby, put the upper limit and lower limit as $1$ and $0$ respectively. This means,$$I=\frac{\int_0^1\left( (x-f(x))^{2016}(1 +f'(x)\right)dx}{2}.$$
Here comes a mystery. I was stuck at this particular step.
Attempt 2:
(In this method, I proceeded to work with $I=\int_0^1(x-f(x))^{2016}dx$ instead of, $I=\int(x-f(x))^{2016}dx$)
We first consider,if $f(x)=y$ then, $f(f(x))=x=f(y).$ We consider, the integral $I=\int (x-f(x))^{2016} dx$.
We try changing, all the independent variable of integration, from $x$ to $y$( or, in other words we are trying to apply method of substitution i.e substituting, $y=f(x)$ in $I$). For that, we have to replace $dx$ as well.
We notice that, $$f(y)=x\implies \frac{df(y)}{dy}\frac{dy}{dx}=\frac{d}{dx}x\implies f'(y)\frac{dy}{dx}=1\implies f'(y)dy=dx.$$ We are now in a place to completely do the change of variables in $I$.
We have, $$I=\int_0^1 (x-f(x))^{2016} dx=\int_1^0 (f(y)-y)^{2016}f'(y)dy$$.
(We have, $y=f(x)$ and $x=0\implies y=f(0)=1$ and $x=1\implies y=f(1)=f(f(0))=0$ and since the variable of integration is $y$ here, so the corresponding upper limit and lower limit in terms $x$ (initially) $(1,0)$ will change to $(0,1)$ due to change in variable to $y$)
We can again, change the variable representation in $I$ to $x$ as, $$I=\int_1^0(f(x)-x)^{2016}f'(x)dx$$ $$\implies I=-\int_0^1(f(x)-x)^{2016}f'(x)dx \tag 1.$$
Now, we again observe $\int_0^1 (x-f(x))^{2016} dx$ and adding it with $( 1),$ we have $$2I=\int_0^1\left( (x-f(x))^{2016} -(f(x)-x)^{2016}f'(x)\right)dx.$$ This can be readily simplified to,
$$2I=\int_0^1\left( (x-f(x))^{2016}(1 -f'(x))\right)dx.$$
We now, have, $$I=\frac{\int_0^1(x-f(x))^{2016}(1 -f'(x))dx}{2}.$$
We notice, $$I=\frac{\int_0^1 (x-f(x))^{2016}(1 -f'(x))dx}{2},$$ can again be readily simplified by substituting $t=x-f(x)$ and so, $$\frac{dt}{dx}=(1-f'(x))\implies \frac{dt}{(1-f'(x))}=dx.$$
Hence, $$I=\frac{\int_0^1 (x-f(x))^{2016}(1 -f'(x))dx}{2}=$$ $$\begin{align}\frac{\int_{-1}^1 (x-f(x))^{2016}(1 -f'(x))\frac{dt}{(1-f'(x))}}{2}\end{align}$$ $$=\frac 1{2}\int_{-1}^1t^{2016}dt=\frac{1}{2.2017}[t^{2017}]^1_{-1}=\frac{1}{2017}.$$
So, I could solve, the problem in my 2nd Attempt prestty much easily.
I analyzed both of the attempt $1$ and $2.$ I found that the problem in Attempt $1$ started because in the last step of Attempt $1$ we hit at the expression $$I=\frac{\int_0^1\left( (x-f(x))^{2016}(1 +f'(x)\right)dx}{2}.$$
In attempt $2$, inspite of hitting at $$I=\frac{\int_0^1\left( (x-f(x))^{2016}(1 +f'(x)\right)dx}{2},$$ we hit at $$I=\frac{\int_0^1(x-f(x))^{2016}(1 -f'(x))dx}{2}.$$ This expression $$I=\frac{\int_0^1(x-f(x))^{2016}(1 -f'(x))dx}{2},$$ was easy to manipulate further, because, we had $(1-f'(x))$ here, instead of the "troublesome" $(1+f'(x))$ there.
But this is strange, why do I get $$I=\frac{\int_0^1(x-f(x))^{2016}(1 -f'(x))dx}{2},$$ in attempt $2$ , instead of $$I=\frac{\int_0^1\left( (x-f(x))^{2016}(1 +f'(x)\right)dx}{2},$$ as in Attempt $1$? If one notice, then it might be observed that, there is no difference in the procedure applied in both of the attempts, only thing that was not alike, is that in attempt one we ignored the limits (upper and lower limit) and at the final step we put them to convert $I$ into a definite integral. On the other, hand, in attempt $2$ we exactly imitated what we did in attempt $1$ just that, here, at each step we were writing the upper and lower limits.
My question, is, why this mysterious thing is occuring ? Both of the simplication in the two attempts should have been same. Where does the difference occur , in either of the two cases ?
Another (Unexplained) Absurdity :
If in Attempt $2$ we took the substitution $t=(x-f(x))^{2016}$ then things would have been different and we would have got,$I=0.$ The corresponding calculation, for $t=(x-f(x))^{2016}$:
$$I=\frac{\int_0^1 (x-f(x))^{2016}(1 -f'(x))dx}{2}=$$ $$\begin{align}\frac{\int_1^1 (x-f(x))^{2016}(1 -f'(x))\frac{dt}{2016(x-f(x))^{2015}(1-f'(x))}}{2}\end{align}$$ $$=0.$$
Precisely, I am looking for a convincing explanation of these apparent absurdities, using elementary real analysis (basic) elementary calculus(/basic real analysis).
Hint 2: is there another one? Differntiate.
– Roland F May 13 '23 at 09:10