Optimal. Leaf size=33 \[ -\frac {2}{5} \cot ^5(x)-\frac {\cot ^3(x)}{3}+\frac {2 \csc ^5(x)}{5}-\frac {2 \csc ^3(x)}{3} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.13, antiderivative size = 33, normalized size of antiderivative = 1.00, number of steps used = 11, number of rules used = 6, integrand size = 7, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.857, Rules used = {4397, 2711, 2607, 30, 2606, 14} \[ -\frac {2}{5} \cot ^5(x)-\frac {\cot ^3(x)}{3}+\frac {2 \csc ^5(x)}{5}-\frac {2 \csc ^3(x)}{3} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 14
Rule 30
Rule 2606
Rule 2607
Rule 2711
Rule 4397
Rubi steps
\begin {align*} \int \frac {1}{(\sin (x)+\tan (x))^2} \, dx &=\int \frac {\cot ^2(x)}{(1+\cos (x))^2} \, dx\\ &=\int \left (\cot ^4(x) \csc ^2(x)-2 \cot ^3(x) \csc ^3(x)+\cot ^2(x) \csc ^4(x)\right ) \, dx\\ &=-\left (2 \int \cot ^3(x) \csc ^3(x) \, dx\right )+\int \cot ^4(x) \csc ^2(x) \, dx+\int \cot ^2(x) \csc ^4(x) \, dx\\ &=2 \operatorname {Subst}\left (\int x^2 \left (-1+x^2\right ) \, dx,x,\csc (x)\right )+\operatorname {Subst}\left (\int x^4 \, dx,x,-\cot (x)\right )+\operatorname {Subst}\left (\int x^2 \left (1+x^2\right ) \, dx,x,-\cot (x)\right )\\ &=-\frac {1}{5} \cot ^5(x)+2 \operatorname {Subst}\left (\int \left (-x^2+x^4\right ) \, dx,x,\csc (x)\right )+\operatorname {Subst}\left (\int \left (x^2+x^4\right ) \, dx,x,-\cot (x)\right )\\ &=-\frac {1}{3} \cot ^3(x)-\frac {2 \cot ^5(x)}{5}-\frac {2 \csc ^3(x)}{3}+\frac {2 \csc ^5(x)}{5}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.02, size = 57, normalized size = 1.73 \[ -\frac {7}{120} \tan \left (\frac {x}{2}\right )-\frac {1}{8} \cot \left (\frac {x}{2}\right )+\frac {1}{40} \tan \left (\frac {x}{2}\right ) \sec ^4\left (\frac {x}{2}\right )-\frac {11}{120} \tan \left (\frac {x}{2}\right ) \sec ^2\left (\frac {x}{2}\right ) \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 1.45, size = 34, normalized size = 1.03 \[ -\frac {\cos \relax (x)^{3} + 2 \, \cos \relax (x)^{2} + 8 \, \cos \relax (x) + 4}{15 \, {\left (\cos \relax (x)^{2} + 2 \, \cos \relax (x) + 1\right )} \sin \relax (x)} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 0.14, size = 31, normalized size = 0.94 \[ \frac {1}{40} \, \tan \left (\frac {1}{2} \, x\right )^{5} - \frac {1}{24} \, \tan \left (\frac {1}{2} \, x\right )^{3} - \frac {1}{8 \, \tan \left (\frac {1}{2} \, x\right )} - \frac {1}{8} \, \tan \left (\frac {1}{2} \, x\right ) \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.12, size = 32, normalized size = 0.97 \[ \frac {\left (\tan ^{5}\left (\frac {x}{2}\right )\right )}{40}-\frac {\left (\tan ^{3}\left (\frac {x}{2}\right )\right )}{24}-\frac {\tan \left (\frac {x}{2}\right )}{8}-\frac {1}{8 \tan \left (\frac {x}{2}\right )} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 0.31, size = 45, normalized size = 1.36 \[ -\frac {\cos \relax (x) + 1}{8 \, \sin \relax (x)} - \frac {\sin \relax (x)}{8 \, {\left (\cos \relax (x) + 1\right )}} - \frac {\sin \relax (x)^{3}}{24 \, {\left (\cos \relax (x) + 1\right )}^{3}} + \frac {\sin \relax (x)^{5}}{40 \, {\left (\cos \relax (x) + 1\right )}^{5}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 2.39, size = 40, normalized size = 1.21 \[ -\frac {8\,{\cos \left (\frac {x}{2}\right )}^6-4\,{\cos \left (\frac {x}{2}\right )}^4+14\,{\cos \left (\frac {x}{2}\right )}^2-3}{120\,{\cos \left (\frac {x}{2}\right )}^5\,\sin \left (\frac {x}{2}\right )} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int \frac {1}{\left (\sin {\relax (x )} + \tan {\relax (x )}\right )^{2}}\, dx \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________