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.126604, antiderivative size = 33, normalized size of antiderivative = 1., 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 4397
Rule 2711
Rule 2607
Rule 30
Rule 2606
Rule 14
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.0158117, 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]
________________________________________________________________________________________
Maple [A] time = 0.041, size = 32, normalized size = 1. \begin{align*}{\frac{1}{40} \left ( \tan \left ({\frac{x}{2}} \right ) \right ) ^{5}}-{\frac{1}{24} \left ( \tan \left ({\frac{x}{2}} \right ) \right ) ^{3}}-{\frac{1}{8}\tan \left ({\frac{x}{2}} \right ) }-{\frac{1}{8} \left ( \tan \left ({\frac{x}{2}} \right ) \right ) ^{-1}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A] time = 0.996161, size = 61, normalized size = 1.85 \begin{align*} -\frac{\cos \left (x\right ) + 1}{8 \, \sin \left (x\right )} - \frac{\sin \left (x\right )}{8 \,{\left (\cos \left (x\right ) + 1\right )}} - \frac{\sin \left (x\right )^{3}}{24 \,{\left (\cos \left (x\right ) + 1\right )}^{3}} + \frac{\sin \left (x\right )^{5}}{40 \,{\left (\cos \left (x\right ) + 1\right )}^{5}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 2.13688, size = 109, normalized size = 3.3 \begin{align*} -\frac{\cos \left (x\right )^{3} + 2 \, \cos \left (x\right )^{2} + 8 \, \cos \left (x\right ) + 4}{15 \,{\left (\cos \left (x\right )^{2} + 2 \, \cos \left (x\right ) + 1\right )} \sin \left (x\right )} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F] time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{1}{\left (\sin{\left (x \right )} + \tan{\left (x \right )}\right )^{2}}\, dx \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 1.15399, size = 42, normalized size = 1.27 \begin{align*} \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 ) \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]