# Integrate $\int e^x\frac{1+\sin x}{1+\cos x}dx$

Integrate $$\int e^x\cdot\frac{1+\sin x}{1+\cos x}\,dx$$

My try;

First step: I let $$\frac{1+\sin x}{1+\cos x} = u$$ $$e^x = v$$ and then I applied integration by parts: $$\frac{1+\sin x}{1+\cos x}=u \implies du=\frac{\sin x+\cos x+1}{(1+\cos x)^2}dx$$ $$v = e^x \implies dv = e^x$$ and $$\int e^x\cdot\frac{1+\sin x}{1+\cos x}\,dx=e^x\cdot\frac{1+\sin x}{1+\cos x}-\int e^x\cdot\frac{\sin x+\cos x+1}{(1+\cos x)^2}dx$$

• Did you try using the half-angle formulae for sine and cos? The integral converts into the form: $\int e^x (f(x) + f'(x)) dx$ – Saransh Kumar May 28 '16 at 12:24
• differentiate with respect to $x$ $$e^x\tan(x/2)$$ – Dr. Sonnhard Graubner May 28 '16 at 12:36
• I know what is answer but how we go there? – Jale'de jale uff ne jale May 28 '16 at 12:42
• @SaranshKumar Can you explain more please? – Jale'de jale uff ne jale May 28 '16 at 12:43

Use $\sin x=2\sin\frac{x}{2}\cos\frac{x}{2},1+\cos x=2\cos^2\frac{x}{2}$. The integrand becomes $e^x\tan\frac{x}{2}+\frac{1}{2}e^x\sec^2\frac{x}{2}$.
Since the derivative of $\tan\frac{x}{2}$ is $\frac{1}{2}\sec^2\frac{x}{2}$ we can integrate immediately to get $e^x\tan\frac{x}{2}+C$.
$$\int e^x\cdot\dfrac{1+\sin x}{1+\cos x}\,dx = \int e^x\cdot\dfrac{1+2\sin\left(\frac{x}{2}\right)\cos\left(\frac{x}{2}\right)}{2\cos^2\left(\frac{x}{2}\right)}\,dx\\=\int e^x\cdot\left(\frac{1}{2}\sec^2\frac{x}{2} + \tan\frac{x}{2}\right)dx$$
$$\int e^x\cdot\frac{1}{2}\sec^2\frac{x}{2}\,dx + \int e^x\cdot\tan\frac{x}{2}\,dx$$ Integrate by parts, the integral: $$\int e^x\cdot\tan\frac{x}{2} dx$$ You should get the final answer as
$$e^x\cdot\tan\frac{x}{2} + c$$