Find the value of the following expression:

$$\int \frac{\cos^2x}{1+\sin x}\ dx$$

My Working:

Failed Method 1:

Basically, I first tried to use $u$-substitution with $u=1+\sin x$, and this would result in

\begin{align} \frac{du}{dx}&=\cos x\\ du&=\cos x\cdot dx \end{align}

This would not cancel out the other $\cos x$.

Failed Method 2:

I also tried using the formula $$\cos^2x=\frac{1+\cos2x}{2},$$ but that would result in the integral being equivalent to

\begin{align} & \quad\int\frac{\frac{1+\cos 2x}{2}}{1+\sin x}\ dx\\ &=\int\frac{1+\cos2x}{2+2\sin x}\ dx \end{align}

Nothing would cancel out here either.

WolframAlpha's Answer Which Looks Ridiculous:

I've also tried using WolframAlpha, but the "answer", shown below, looks terrifying, and maybe not the right answer (at least, not the simplified right answer). (By the way, I don't have WolframAlpha Pro, so I cannot access the step-by-step solution)

$$-\frac{\left[2 \sqrt{1 - \sin x} \sin^{-1}\left(\frac{\sqrt{1 - \sin x}}{\sqrt{2}}\right) + (\sin x - 1) \sqrt{\sin x + 1}\right] \cos^3x}{(\sin x - 1)^2 (\sin x + 1)^{3/2}} + c$$

Could you please give me some advice on how to solve the problem? Thanks!


4 Answers 4


Did Wolfram Alpha really produce that?

$\cos^2 x=1-\sin^2x=(1+\sin x)(1-\sin x)$.

You can do the rest yourself.

  • $\begingroup$ Thanks, I have solved the problem now. I just forgot to use the theorem. +1, will accept soon. $\endgroup$ Commented Oct 8, 2022 at 6:35
  • 1
    $\begingroup$ I don't understand why but I got the same result: wolframalpha.com/… But look at this: wolframalpha.com/… $\endgroup$ Commented Oct 8, 2022 at 6:36
  • 3
    $\begingroup$ The lesson being: WolframAlpha isn't infallible. $\endgroup$ Commented Oct 8, 2022 at 6:37
  • $\begingroup$ @PrincessEev Yes, I remember when it couldn't factor $x^4+y^4$ without going to complex numbers. $\endgroup$ Commented Oct 8, 2022 at 6:38
  • $\begingroup$ @SuzuHirose Very strange. I reported this as a bug. $\endgroup$
    – Klaus
    Commented Oct 8, 2022 at 9:32

$$\begin{align} \int {\cos^2 x \over 1+\sin x } \mathrm{d}x&= \int {1-\sin^2 x \over 1 + \sin x } \mathrm{d}x \\&=\int {(1+\sin x)(1-\sin x) \over (1+\sin x) } \mathrm{d}x\\ &=\int (1-\sin x) \mathrm d x\\&=x+\cos x + \mathrm{const} \end{align}$$

  • $\begingroup$ Wait wait, why I was downvoted? $\endgroup$ Commented Oct 8, 2022 at 6:39
  • 1
    $\begingroup$ Sorry, probably because you answered a little late. But you still provided more working out, so I upvoted anyway. $\endgroup$ Commented Oct 8, 2022 at 6:41

Use the "tan half-ange" substitution, $viz$ $$u=\tan (x/2)$$ to convert the integral to the integral of a rational function.


Use $\cos^2x=1-\sin^2x$. Then $I=\int (1-\sin x) dx$


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .