# Which function can be used for Substitution

Find the value of $$I=\int_{0}^{\frac{\pi}{2}}\left(\sin(x)-\cos(x)\right)\,\log(\sin(x))dx$$

Method $(1)$. I splitted up the Integral into two Integrals as

$$I=I_1+I_2$$ where $I_1=\int_{0}^{\frac{\pi}{2}}\sin(x)\,\log(\sin(x))dx$ and $I_2=\int_{0}^{\frac{\pi}{2}}\cos(x)\,\log(\sin(x))dx$

For $I_1$, using Substitution $\cos(x)=t$ we get $$I_1=\int_{1}^{0}-\log(\sqrt{1-t^2})dt=\frac{1}{2}\int_{0}^{1}\log(1-t)+\log(1+t)dt=\frac{1}{2}\int_{0}^{2}\log(x)dx=\log(2)-1$$

Similarly in $I_2$ Use substitution $\sin(x)=t$ we get

$$I_2=\int_{0}^{1}\log(t)dt=-1$$ Hence

$$I=I_1+I_2=\log(2)$$

Method $(2)$. If for $I$, i use Substitution $\sin(x)+\cos(x)=t$ ,then $\left(\cos(x)-\sin(x)\right)dx=dt$ and $\sin(x)$ will be some function of $t$. But since limits are getting $1$ and $1$, Cant we conclude that Integral is Zero?

• i think the problem with your second substitution is, that it is not 1-to-1. this always causes trouble and one has to be really careful about limits, differential etc. – tired May 26 '15 at 12:48

You cannot use that substitution.

When you substitute, you are actually composing with a function $x=\varphi(t)$ in this way:

$$\int_{\varphi(a)}^{\varphi(b)}f(x)dx=\int_a^bf(\varphi(t))\varphi'(t)dt$$

Can you write $\sin(x)+\cos(x)=t$ as $x=\varphi(t)$?

The answer is no: the function $t=f(x)=\sin(x)+\cos(x)$ is not invertible in $[0, \pi/2]$ because it is not injective. As you have noticed, it achieves the same value in $0$ and $\pi/2$. This implies that the function $f(x)$ is not invertible.

The second approach fails because $\sin x+\cos x$ is not a bijective function on $[0,\pi/2]$.

If you like a third approach: $$I=\int_{0}^{\pi/2}\left(\sin x-\cos x\right)\log \sin x\,dx = \left.\frac{d}{d\alpha}\int_{0}^{\pi/2}\left(\sin^{\alpha+1}x-\cos x\sin^{\alpha} x\right)\,dx\,\right|_{\alpha=0}$$ leads to: $$\begin{eqnarray*} I &=& \left.\frac{d}{d\alpha}\left(\frac{1}{2}\,B\left(\frac{1}{2},1+\frac{\alpha}{2}\right)-\frac{1}{\alpha+1}\right)\right|_{\alpha=0}\\&=&\left.\frac{1}{4}\,B\left(\frac{1}{2},1+\frac{\alpha}{2}\right)\left(\psi(1+\alpha/2)-\psi(3/2+\alpha/2)\right)+\frac{1}{(1+\alpha)^2}\right|_{\alpha=0}\\&=&\frac{1}{2}\left(\psi(1)-\psi(3/2)\right)+1\\&=&1-\sum_{n\geq 1}\frac{1}{2n(2n+1)}=\color{red}{\log 2}. \end{eqnarray*}$$

The using of method "substitution" needs $t$ changes from $\alpha=\phi(a)$ to $\beta=\phi(b)$ monotonically while $x$ changs from $a$ to $b$ monotonically.