Optimal. Leaf size=107 \[ -\frac {2 \cot ^5(c+d x)}{5 a^2 d}+\frac {\cot ^3(c+d x)}{3 a^2 d}-\frac {\cot (c+d x)}{a^2 d}+\frac {2 \csc ^5(c+d x)}{5 a^2 d}-\frac {4 \csc ^3(c+d x)}{3 a^2 d}+\frac {2 \csc (c+d x)}{a^2 d}-\frac {x}{a^2} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.17, antiderivative size = 107, normalized size of antiderivative = 1.00, number of steps used = 12, number of rules used = 8, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.381, Rules used = {3888, 3886, 3473, 8, 2606, 194, 2607, 30} \[ -\frac {2 \cot ^5(c+d x)}{5 a^2 d}+\frac {\cot ^3(c+d x)}{3 a^2 d}-\frac {\cot (c+d x)}{a^2 d}+\frac {2 \csc ^5(c+d x)}{5 a^2 d}-\frac {4 \csc ^3(c+d x)}{3 a^2 d}+\frac {2 \csc (c+d x)}{a^2 d}-\frac {x}{a^2} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 8
Rule 30
Rule 194
Rule 2606
Rule 2607
Rule 3473
Rule 3886
Rule 3888
Rubi steps
\begin {align*} \int \frac {\cot ^2(c+d x)}{(a+a \sec (c+d x))^2} \, dx &=\frac {\int \cot ^6(c+d x) (-a+a \sec (c+d x))^2 \, dx}{a^4}\\ &=\frac {\int \left (a^2 \cot ^6(c+d x)-2 a^2 \cot ^5(c+d x) \csc (c+d x)+a^2 \cot ^4(c+d x) \csc ^2(c+d x)\right ) \, dx}{a^4}\\ &=\frac {\int \cot ^6(c+d x) \, dx}{a^2}+\frac {\int \cot ^4(c+d x) \csc ^2(c+d x) \, dx}{a^2}-\frac {2 \int \cot ^5(c+d x) \csc (c+d x) \, dx}{a^2}\\ &=-\frac {\cot ^5(c+d x)}{5 a^2 d}-\frac {\int \cot ^4(c+d x) \, dx}{a^2}+\frac {\operatorname {Subst}\left (\int x^4 \, dx,x,-\cot (c+d x)\right )}{a^2 d}+\frac {2 \operatorname {Subst}\left (\int \left (-1+x^2\right )^2 \, dx,x,\csc (c+d x)\right )}{a^2 d}\\ &=\frac {\cot ^3(c+d x)}{3 a^2 d}-\frac {2 \cot ^5(c+d x)}{5 a^2 d}+\frac {\int \cot ^2(c+d x) \, dx}{a^2}+\frac {2 \operatorname {Subst}\left (\int \left (1-2 x^2+x^4\right ) \, dx,x,\csc (c+d x)\right )}{a^2 d}\\ &=-\frac {\cot (c+d x)}{a^2 d}+\frac {\cot ^3(c+d x)}{3 a^2 d}-\frac {2 \cot ^5(c+d x)}{5 a^2 d}+\frac {2 \csc (c+d x)}{a^2 d}-\frac {4 \csc ^3(c+d x)}{3 a^2 d}+\frac {2 \csc ^5(c+d x)}{5 a^2 d}-\frac {\int 1 \, dx}{a^2}\\ &=-\frac {x}{a^2}-\frac {\cot (c+d x)}{a^2 d}+\frac {\cot ^3(c+d x)}{3 a^2 d}-\frac {2 \cot ^5(c+d x)}{5 a^2 d}+\frac {2 \csc (c+d x)}{a^2 d}-\frac {4 \csc ^3(c+d x)}{3 a^2 d}+\frac {2 \csc ^5(c+d x)}{5 a^2 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 1.35, size = 149, normalized size = 1.39 \[ \frac {\sec ^2(c+d x) \left (-120 d x \cos ^4\left (\frac {1}{2} (c+d x)\right )+3 \tan \left (\frac {1}{2} (c+d x)\right )-31 \tan \left (\frac {c}{2}\right ) \cos ^2\left (\frac {1}{2} (c+d x)\right )-31 \sec \left (\frac {c}{2}\right ) \sin \left (\frac {d x}{2}\right ) \cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {d x}{2}\right ) \cos ^3\left (\frac {1}{2} (c+d x)\right ) \left (15 \csc \left (\frac {c}{2}\right ) \cot \left (\frac {1}{2} (c+d x)\right )+193 \sec \left (\frac {c}{2}\right )\right )\right )}{30 a^2 d (\sec (c+d x)+1)^2} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.67, size = 106, normalized size = 0.99 \[ -\frac {26 \, \cos \left (d x + c\right )^{3} + 22 \, \cos \left (d x + c\right )^{2} + 15 \, {\left (d x \cos \left (d x + c\right )^{2} + 2 \, d x \cos \left (d x + c\right ) + d x\right )} \sin \left (d x + c\right ) - 17 \, \cos \left (d x + c\right ) - 16}{15 \, {\left (a^{2} d \cos \left (d x + c\right )^{2} + 2 \, a^{2} d \cos \left (d x + c\right ) + a^{2} d\right )} \sin \left (d x + c\right )} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 0.36, size = 84, normalized size = 0.79 \[ -\frac {\frac {120 \, {\left (d x + c\right )}}{a^{2}} + \frac {15}{a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )} - \frac {3 \, a^{8} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 25 \, a^{8} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 165 \, a^{8} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{a^{10}}}{120 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.70, size = 94, normalized size = 0.88 \[ \frac {\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )}{40 a^{2} d}-\frac {5 \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{24 a^{2} d}+\frac {11 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{8 a^{2} d}-\frac {1}{8 a^{2} d \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}-\frac {2 \arctan \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{a^{2} d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 0.59, size = 113, normalized size = 1.06 \[ \frac {\frac {\frac {165 \, \sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} - \frac {25 \, \sin \left (d x + c\right )^{3}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{3}} + \frac {3 \, \sin \left (d x + c\right )^{5}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{5}}}{a^{2}} - \frac {240 \, \arctan \left (\frac {\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1}\right )}{a^{2}} - \frac {15 \, {\left (\cos \left (d x + c\right ) + 1\right )}}{a^{2} \sin \left (d x + c\right )}}{120 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 1.40, size = 78, normalized size = 0.73 \[ -\frac {x}{a^2}-\frac {\frac {26\,{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6}{15}-\frac {28\,{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4}{15}+\frac {17\,{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2}{60}-\frac {1}{40}}{a^2\,d\,{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5\,\sin \left (\frac {c}{2}+\frac {d\,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 \[ \frac {\int \frac {\cot ^{2}{\left (c + d x \right )}}{\sec ^{2}{\left (c + d x \right )} + 2 \sec {\left (c + d x \right )} + 1}\, dx}{a^{2}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________