# Evaluate the integral? :  int_(-pi/2)^(pi/2) cosx/(e^x+1) dx

Nov 15, 2017

${\int}_{- \frac{\pi}{2}}^{\frac{\pi}{2}} \cos \frac{x}{{e}^{x} + 1} \cdot \mathrm{dx} = 1$

#### Explanation:

$I = {\int}_{- \frac{\pi}{2}}^{\frac{\pi}{2}} \cos \frac{x}{{e}^{x} + 1} \cdot \mathrm{dx}$

After using $x = - y$ and $\mathrm{dx} = - \mathrm{dy}$ transforms,

$I = {\int}_{\frac{\pi}{2}}^{- \frac{\pi}{2}} \cos \frac{- y}{{e}^{- y} + 1} \cdot \left(- \mathrm{dy}\right)$

$= {\int}_{- \frac{\pi}{2}}^{\frac{\pi}{2}} \cos \frac{- y}{{e}^{- y} + 1} \cdot \mathrm{dy}$

$= {\int}_{- \frac{\pi}{2}}^{\frac{\pi}{2}} \cos \frac{y}{{e}^{- y} + 1} \cdot \mathrm{dy}$

$= {\int}_{- \frac{\pi}{2}}^{\frac{\pi}{2}} \frac{{e}^{y} \cdot \cos y}{{e}^{y} + 1} \cdot \mathrm{dy}$

$= {\int}_{- \frac{\pi}{2}}^{\frac{\pi}{2}} \frac{{e}^{x} \cdot \cos x}{{e}^{x} + 1} \cdot \mathrm{dx}$

After collecting 2 integrals,

$2 I = {\int}_{- \frac{\pi}{2}}^{\frac{\pi}{2}} \frac{\left({e}^{x} + 1\right) \cdot \cos x}{{e}^{x} + 1} \cdot \mathrm{dx}$

$= {\int}_{- \frac{\pi}{2}}^{\frac{\pi}{2}} \cos x \cdot \mathrm{dx}$

$= {\int}_{0}^{\frac{\pi}{2}} 2 \cos x \cdot \mathrm{dx}$

=${\left[2 \sin x\right]}_{0}^{\frac{\pi}{2}}$

=$2$

Hence $I = {\int}_{- \frac{\pi}{2}}^{\frac{\pi}{2}} \cos \frac{x}{{e}^{x} + 1} \cdot \mathrm{dx} = 1$

Nov 16, 2017

${\int}_{- \frac{\pi}{2}}^{\frac{\pi}{2}} \setminus \cos \frac{x}{{e}^{x} + 1} \setminus \mathrm{dx} = 1$

#### Explanation:

Let:

$I = {\int}_{- \frac{\pi}{2}}^{\frac{\pi}{2}} \setminus \cos \frac{x}{{e}^{x} + 1} \setminus \mathrm{dx}$ ..... [A]

We cannot find an elementary solution to the indefinite integral but despite this we can readily evaluate this definite integral If we perform a trivial substitution:

$u = - x \implies \frac{\mathrm{du}}{\mathrm{dx}} = - 1$

And using this substitution we can transform the limits of integration:

When $x = \left\{\begin{matrix}- \frac{\pi}{2} \\ \frac{\pi}{2}\end{matrix}\right. \implies u = \left\{\begin{matrix}\frac{\pi}{2} \\ - \frac{\pi}{2}\end{matrix}\right.$

Then substitution into the integral [A] gives:

$I = {\int}_{\frac{\pi}{2}}^{- \frac{\pi}{2}} \setminus \cos \frac{- u}{{e}^{- u} + 1} \setminus \left(- 1\right) \setminus \mathrm{du}$
$\setminus \setminus = - {\int}_{\frac{\pi}{2}}^{- \frac{\pi}{2}} \setminus \cos \frac{- u}{{e}^{- u} + 1} \setminus \mathrm{du}$

Using the properties:

$\setminus \setminus \setminus \cos \left(- A\right) = \cos \left(A\right)$
${\int}_{a}^{b} \setminus f \left(x\right) \setminus \mathrm{dx} = - {\int}_{b}^{a} \setminus f \left(x\right) \setminus \mathrm{dx}$

We have:

$I = {\int}_{- \frac{\pi}{2}}^{\frac{\pi}{2}} \setminus \cos \frac{u}{{e}^{- u} + 1} \setminus \mathrm{du}$
$\setminus \setminus = {\int}_{- \frac{\pi}{2}}^{\frac{\pi}{2}} \setminus {e}^{u} / {e}^{u} \setminus \cos \frac{u}{{e}^{- u} + 1} \setminus \mathrm{du}$
$\setminus \setminus = {\int}_{- \frac{\pi}{2}}^{\frac{\pi}{2}} \setminus \frac{{e}^{u} \cos u}{1 + {e}^{u}} \setminus \mathrm{du}$ ..... [B]

If we add Eq [A] to Eq[B], we get:

$I + I = {\int}_{- \frac{\pi}{2}}^{\frac{\pi}{2}} \setminus \cos \frac{x}{{e}^{x} + 1} \setminus \mathrm{dx} + {\int}_{- \frac{\pi}{2}}^{\frac{\pi}{2}} \setminus \frac{{e}^{u} \cos u}{1 + {e}^{u}} \setminus \mathrm{du}$

And as indefinite integrals are independent of the variable of integration, we have:

$2 I = {\int}_{- \frac{\pi}{2}}^{\frac{\pi}{2}} \setminus \cos \frac{t}{{e}^{t} + 1} \setminus \mathrm{dt} + {\int}_{- \frac{\pi}{2}}^{\frac{\pi}{2}} \setminus \frac{{e}^{t} \cos t}{1 + {e}^{t}} \setminus \mathrm{dt}$

$\setminus \setminus \setminus = {\int}_{- \frac{\pi}{2}}^{\frac{\pi}{2}} \setminus \cos \frac{t}{1 + {e}^{t}} + \frac{{e}^{t} \cos t}{1 + {e}^{t}} \setminus \mathrm{dt}$

$\setminus \setminus \setminus = {\int}_{- \frac{\pi}{2}}^{\frac{\pi}{2}} \setminus \frac{\cos t + {e}^{t} \cos t}{1 + {e}^{t}} \setminus \mathrm{dt}$

$\setminus \setminus \setminus = {\int}_{- \frac{\pi}{2}}^{\frac{\pi}{2}} \setminus \frac{\left(1 + {e}^{t}\right) \cos t}{1 + {e}^{t}} \setminus \mathrm{dt}$

$\therefore 2 I = {\int}_{- \frac{\pi}{2}}^{\frac{\pi}{2}} \setminus \cos t \setminus \mathrm{dt}$

And this is now a trivial integral:

$\setminus \setminus \setminus \setminus \setminus 2 I = {\left[\sin t\right]}_{- \frac{\pi}{2}}^{\frac{\pi}{2}}$

$\therefore 2 I = \sin \left(\frac{\pi}{2}\right) - \sin \left(- \frac{\pi}{2}\right)$

$\therefore 2 I = 1 - \left(- 1\right)$

$\therefore 2 I = 2$

Hence:

$I = {\int}_{- \frac{\pi}{2}}^{\frac{\pi}{2}} \setminus \cos \frac{x}{{e}^{x} + 1} \setminus \mathrm{dx} = 1$