# Trouble with indefinite integral $\int \sqrt{\csc x-\sin x} dx$

I'm trying to find out the antiderivative. My approach is:

$\int \sqrt{\csc x-\sin x} dx = \int \sqrt{\frac{1}{\sin x}-\sin x} dx= \int \sqrt{\frac{1-\sin^2x}{\sin x}}dx$

Then: $\int \sqrt{\frac{\cos^2 x}{\sin x}} dx = \int \frac{\cos x}{\sqrt{\sin x}} dx$

Let $u$ be $\sin x$ so $\int \frac{du}{\sqrt{u}} = 2\sqrt{u} + k$

Finally $\int \sqrt{\csc x-\sin x} dx = 2\sqrt{\sin x} +k$

I thought I was right but apparently neither WolframAlpha nor the other antiderivative calculators agree with my result.

I don't know where I went wrong, I'd very much appreciate if someone could help me out.

Thanks BTW: I haven't mastered LaTeX yet, so forgive me if it is poorly formatted.

• As long as we keep in mind that in fact $\;\sqrt{\cos^2x}=|\cos x|\;$ , your answer looks correct to me (up to a sign depending on the above) – DonAntonio Aug 29 '16 at 21:35
• @Genis Remember that these online tools sometimes use different trig identities than we would and thus they may come up with an anti derivative that is essentially the same (I hope so!) but differ by a constant. – imranfat Aug 29 '16 at 21:39
• FWIW, Maple agrees with your result. – user307169 Aug 29 '16 at 21:39
• Your result is correct. – Mark Viola Aug 29 '16 at 21:40

Your answer is correct and Wolfram Alpha does indeed agree with you. When I use Wolfram Alpha, I get this: $$\int\sqrt{\csc x - \sin x} \, dx = 2\tan x \sqrt{\cos x \cot x} + C$$
Ignoring the $+C$ (and ignoring the $\sqrt{a^2} = |a|$ paradigm with trig functions, as we often do with indefinite integrals involving trig functions and substitutions, etc...) the RHS can be simplified as follows: