4

My friend showed me this integral (and a neat way he evaluated it) and I am interested in seeing a few ways of evaluating it, especially if they are "often" used tricks.

I can't quite recall his way, but it had something to do with an identity for phase shifting sine or cosine, like noting that $\cos(x+\pi/2)=-\sin(x)$ we get: $$ I=\int_{0}^{\pi/2}\frac{\cos(x)}{\sin(x)+\cos(x)}dx=\int_{\pi/2}^{\pi}\frac{-\sin(x)}{-\sin(x)+\cos(x)}dx\\ $$ Except for as I have tried, my signs don't work out well. The end result was finding $$ 2I=\int_{0}^{\pi/2}dx\Rightarrow I=\pi/4 $$ Any help is appreciated! Thanks.

operatorerror
  • 29,103

4 Answers4

4

$$\int_{0}^{a}{\frac{f(x)}{f(x)+f(a-x)}}dx=\frac{a}{2}$$ let $f(x)=\sin x$ and $a=\frac\pi2$

  • Is there a name for this formula? Where can I find more? – operatorerror Jun 18 '16 at 21:06
  • No there is not – Behrouz Maleki Jun 18 '16 at 21:08
  • 1
    @qbert The formula arises from another one: $\int_{0}^{a}\mathrm{F}\left(x\right),\mathrm{d}x = \int_{0}^{a}\mathrm{F}\left(a - x\right),\mathrm{d}x$ which sometimes we say "by reflection in the mirror" especially by people that computes MonteCarlo integrals. By adding ( to the original one ) and dividing by two we usually arrives to an integrand which is somehow smooth which the MC-people like a lot because it can reduce computing time. – Felix Marin Jun 19 '16 at 02:31
3

You're integrating on $[0, \pi/2]$ so replacing $x$ by $\pi/2 -x$ we see that $$I=\int_0^{\pi/2} \frac{\sin{x}}{\cos{x}+\sin{x}}dx.$$ Now sum this integral with the initial expression and notice that $2I=\pi/2$ hence...

user1892304
  • 2,808
3

Let

\begin{equation} I=\int_0^{\pi/2}\frac{\cos x}{\sin x+\cos x}\ dx \end{equation}

and

\begin{equation} J=\int_0^{\pi/2}\frac{\sin x}{\sin x+\cos x}\ dx \end{equation}

then

\begin{equation} I+J=\frac{\pi}{2}\tag1 \end{equation}

and

\begin{align} I-J&=\int_0^{\pi/2}\frac{\cos x-\sin x}{\sin x+\cos x}\ dx\\[10pt] &=\int_0^{\pi/2}\frac{1}{\sin x+\cos x}\ d(\sin x+\cos x)\\[10pt] &=0\tag2 \end{align}

Hence, $$I=J=\frac\pi4$$by linear combinations $(1)$ and $(2)$.

2

Hint: Substitute $2i\sin(x)=e^{ix}-e^{-ix}$ and $2\cos(x)=e^{ix}+e^{-ix}$

$$ I=\int_{0}^{\pi/2}\frac{2\cos(x)}{2\sin(x)+2\cos(x)}dx=\int_{0}^{\pi/2}\frac{e^{ix}+e^{-ix}}{\frac{e^{ix}-e^{-ix}}{i}+e^{ix}+e^{-ix}}dx$$

Now substitute $u=e^{ix} \implies du = ie^{ix}dx=iudx$

$$ I=\int\frac{u+1/u}{\frac{u-1/u}{i}+u+1/u}\frac{du}{iu}$$


Alternative method: $$ I=\int_{0}^{\pi/2}\frac{\cos(x)}{\sin(x)+\cos(x)}dx=\int_{0}^{\pi/2}\frac{1}{\tan(x)+1}dx$$

Substitute: $u=\tan(x) \implies du=(1+\tan^2(x))dx=(1+u^2)dx$

$$ I=\int\frac{1}{u+1}\frac{du}{1+u^2}$$

MrYouMath
  • 15,833