Solve this integral $\int \frac{dx} {\sin^5{x}}$ Let us denote
$$I_{m,n} = \int \sin^m{x} \cos^n{x}\ dx$$
where $m,n$ are integers (possibly negative or zeros).
There are some well-known recurrent formulas for $I_{m,n}$
So... as an example I was trying to solve this particular integral
$$\int \frac{dx} {\sin^5{x}}$$
using these recurrent formulas and I finally got this answer
(the computations were not very long, just 1 or 2 A4 sheets):
$$F(x) = \frac{5}{8} \ln {|\tan \frac{x}{2}|} - \frac{5}{24} \cdot \frac{\cos{x}}{\sin^2{x}} - \frac{1}{6} \cdot \frac{\cos{x}}{\sin^4{x}}$$
But WA is not giving me a simple expression when I differentiate $F(x)$
Is my answer incorrect? How do I check it with some tool other than WA?
Any ideas how to verify?
EDIT: Now I fixed the issues in my calculations and I am getting this answer.
$$\frac{3}{8}\ln|\tan(\frac{x}{2})|-\frac{3}{8}\frac{\cos(x)}{\sin^{2}(x)}-\frac{1}{4}\frac{\cos(x)}{\sin^{4}(x)}$$
But it still does not match with the WA answer...
WA answer
Which one is correct here?
 A: Use $$\frac{1}{\sin^5x}dx=\frac{\sin{x}}{(1-\cos^2x)^3}dx=-\frac{d(\cos{x})}{(1-\cos^2x)^3}$$
A: You rationalize by the simple change of variable $t:=\cos x$:
$$\int\frac{dt}{(1-t^2)^3}.$$
The partial fraction decomposition is
$$\frac3{16(1+t)}-\frac3{16(1-t)}+\frac3{16(1+t)^2}+\frac3{16(1-t)^2}+\frac1{8(1+t)^3}-\frac1{8(1-t)^3}$$ and causes no difficulty.

$$\frac3{16}\log(1-\cos^2x)-\frac3{8(1-\cos^2 x)}+\frac{1+\cos^2x}{8(1-\cos^2 x)^2}.$$

A: You made a mistake somewhere. From WA and after simplifications you should have (what I get):
$$\frac{3}{8}\ln|\tan(\frac{x}{2})|-\frac{3}{8}\frac{\cos(x)}{\sin^{2}(x)}-\frac{1}{4}\frac{\cos(x)}{\sin^{4}(x)}$$
Let me know!

I think the $24\ln|\tan(\frac{x}{2})|$ is clear and we multiplied it by $\frac{1}{64}$ to give the correct term.
Then re-write the remaining terms (from WA) as:
$$\frac{1}{64}\big[-\frac{1}{\sin^{4}(\frac{x}{2})}-\frac{6}{\sin^{2}({\frac{x}{2})}}+\frac{1}{\cos^{4}(\frac{x}{2})}+\frac{6}{\cos^{2}({\frac{x}{2})}}\big]$$
$$=\frac{6}{64}\big[\frac{\sin^{2}(\frac{x}{2})-\cos^{2}(\frac{x}{2})}{\sin^2({\frac{x}{2})\cos^{2}(\frac{x}{2})}}\big]+\frac{1}{64}\big[\frac{\sin^{4}(\frac{x}{2})-\cos^{4}(\frac{x}{2})}{\sin^4({\frac{x}{2})\cos^{4}(\frac{x}{2})}}\big].$$
Then using $\cos^2(x)-\sin^2(x)=\cos(2x)$ and $\sin(2x)=2\sin(x)\cos(x)$ the first term becomes:
$$\frac{6}{64}\big[\frac{\sin^{2}(\frac{x}{2})-\cos^{2}(\frac{x}{2})}{\sin^2({\frac{x}{2})\cos^{2}(\frac{x}{2})}}\big]=-\frac{3}{32}\big[\frac{\cos(x)}{\frac{\sin^{2}(x)}{4}}\big]=-\frac{3}{8}\frac{\cos(x)}{\sin^{2}(x)}.$$
For the other term we have (numerator is of the form $(A^2-B^2)=(A-B)(A+B)$):
$$-\frac{1}{64}\big[\frac{\cos^{2}(\frac{x}{2})-\sin^2({\frac{x}{2})}}{\frac{\sin^{4}(x)}{2^4}}\big]=-\frac{1}{4}\frac{\cos(x)}{\sin^{4}(x)}.$$
A: Wolfram Alpha agrees with you. You just typed in the coefficients wrong when specifying the putative antiderivative you wanted differentiated. It took me some experimenting with brackets to get it to understand the corrected query.
A: I would like to suggest another method: reduction formula for the cosecant (you know that $1$ over sine is the cosecant function):
$$\int \csc^m(x)\ \text{d}x = -\dfrac{\cos(x)\csc^{m-1}(x)}{m-1} + \frac{m-2}{m-1}\int \csc^{m-2}(x)\ \text{d}x$$
Use it twice.
During the process you will have to integrate the cosecant itself, which is a well known integral:
$$\int \csc(x)\ \text{d}x = -\ln(\cot(x) + \csc(x))$$
And eventually the result is:
$$-\frac{1}{64} \csc ^4\left(\frac{x}{2}\right)-\frac{3}{32} \csc ^2\left(\frac{x}{2}\right)+\frac{1}{64} \sec ^4\left(\frac{x}{2}\right)+\frac{3}{32} \sec ^2\left(\frac{x}{2}\right)+\frac{3}{8} \log \left(\sin \left(\frac{x}{2}\right)\right)-\frac{3}{8} \log \left(\cos \left(\frac{x}{2}\right)\right)$$
