# Alternative methods for finding antiderivative of $\frac x{(1+\sin x)^2}$

This problem was assigned to a student I'm tutoring as extra credit:

$$\int\frac{x}{(1+\sin x)^2}\,\mathrm dx$$

I have two potential methods in mind, though I suspect the first, which employs the Weierstrass tangent half-angle substitution, goes beyond the student's curriculum, while the second probably falls within what he's learned (or at least in my opinion, what he should absolutely know). Both methods are rather lengthy, and, while I'm convinced the "extra credit" part about this problem is correlated with that, I can't help but wonder if there are more straightforward methods to do it.

I outline my suggestions below.

Method 1:

• Integrate by parts to get $$\int\frac x{(1+\sin x)^2}\,\mathrm dx=uv-\int v\,\mathrm du$$where $u=x$ and $v=\displaystyle\int\frac{\mathrm dx}{(1+\sin x)^2}$.

• Compute $v$ using the Weierstrass substitution $t=\tan\dfrac x2$, which yields $$-\frac{2+3\tan\dfrac{x}{2}+3\tan^2\dfrac{x}{2}}{3\left(1+\tan\dfrac{x}{2}\right)^3}x+\int\frac{2+3\tan\dfrac{x}{2}+3\tan^2\dfrac{x}{2}}{3\left(1+\tan\dfrac{x}{2}\right)^3}\,\mathrm dx$$

• Compute the remaining integral by expanding like so: $$\int\frac{\mathrm dx}{\left(1+\tan\dfrac{x}{2}\right)^2}+\int\frac{1+\tan^2\dfrac{x}{2}}{\left(1+\tan\dfrac{x}{2}\right)^2}\,\mathrm dx-\frac{4}{3}\int\frac{\mathrm dx}{\left(1+\tan\dfrac{x}{2}\right)^3}$$and with appropriate substitutions (Weierstrass and $w=1+\tan\dfrac x2$) rewrite as $$\int\frac{2}{(1+t)^2(1+t^2)}\,\mathrm dt+\int\frac{2}{w^2}\,\mathrm dw-\frac{4}{3}\int\frac{2}{(1+t)^3(1+t^2)}\,\mathrm dt$$

• Decompose into partial fractions, etc.

Method 2:

• Let $x=\dfrac\pi2-y$ and rewrite the integral as $$\int\frac x{(1+\sin x)^2}\,\mathrm dx=\int\frac{y-\dfrac\pi2}{(1+\cos y)^2}\,\mathrm dy$$

• Recalling the half-angle identity for cosine, we can rewrite the integrand as $$\int\left(\frac y4-\frac\pi8\right)\sec^4\frac y2\,\mathrm dy=\int\left(y-\frac\pi4\right)\sec^4y\,\mathrm dy$$

• Integrate by parts $$\int\left(y-\frac\pi4\right)\sec^4y\,\mathrm dy=uv-\int v\,\mathrm du$$this time with $u=y-\dfrac\pi4$ and $v=\displaystyle\int\sec^4y\,\mathrm dy$.

• Compute $v$ with a reduction formula or the expansion $\sec^4y=\sec^2y(1+\tan^2y)$, etc.

• Check that the derivative of the result works :P – Paolo Leonetti Dec 23 '16 at 23:27
• Perhaps, for $v$ in method 1, take $1+sin(x)=t$? Don't have to do the Weierstrass substitution. I like Method 2 a lot better, though. Or you can just combine the two methods-- forgo Weierstrass in favour of $x=\frac{\pi}{2}-y$. – learning Dec 23 '16 at 23:31
• For $v$ I mean. – learning Dec 23 '16 at 23:37

If you let $\displaystyle u=x, \;v=\int\frac{1}{(1+\sin x)^2}\,dx=\int\frac{1}{(\sin\frac{x}{2}+\cos\frac{x}{2})^2}\,dx=\int\frac{1}{(\sqrt{2}\cos\left(\frac{x}{2}-\frac{\pi}{4}\right))^2}\,dx$

$\displaystyle\hspace{1.3 in}=\frac{1}{2}\int\sec^2\left(\frac{x}{2}-\frac{\pi}{4}\right)\,dx=\tan\left(\frac{x}{2}-\frac{\pi}{4}\right)+C$, this gives

$\displaystyle\int\frac{1}{(1+\sin x)^2}dx=uv-\int v\, du=x\tan\left(\frac{x}{2}-\frac{\pi}{4}\right)-\left[-2\ln\big|\cos\left(\frac{x}{2}-\frac{\pi}{4}\right)\big|\right]+C$

$\displaystyle\hspace{2.25 in}=\color{blue}{x\tan\left(\frac{x}{2}-\frac{\pi}{4}\right)+2\ln\big|\cos\left(\frac{x}{2}-\frac{\pi}{4}\right)\big|+C}$

Indeed one can make the substitution $t=\tan \frac{x}{2}$ (which surely goes back to Euler or even earlier) one then gets $$2\int \frac{t^2+1}{(t+1)^4}\arctan (2t) dt$$

Now this integral is $$=\int\frac{1}{(t+1)^2}\arctan (2t)dt-\int\frac{2}{(t+1)^3}\arctan (2t)dt+\int\frac{2}{(t+1)^4}\arctan (2t)dt$$

Each of which can be evaluated by a standard integration by parts.

An alternate method would be to start as in Method 1, and then find $v$ using

$\displaystyle v=\int\frac{1}{(1+\sin x)^2}dx=\int\frac{(1-\sin x)^2}{\cos^4x}dx=\int(\sec^4x-2\sec^3x\tan x+\tan^2x\sec^2x)dx$

$\hspace{.14 in}=\tan x+\frac{2}{3}\tan^3x-\frac{2}{3}\sec^3 x+C$.

This gives

$\displaystyle\int\frac{1}{(1+\sin x)^2}dx=uv-\int v\,du$

$\displaystyle\hspace{1.2 in} =x\tan x+\frac{2}{3}x\,(\tan^3x-\sec^3x)+\frac{1}{3}\left(\sec x\tan x+\ln(1+\sin x)-\tan^2 x\right)+C$