Optimal. Leaf size=60 \[ -\frac {x}{a^3}+\frac {2 \tan (c+d x)}{a^2 d (a \sec (c+d x)+a)}-\frac {\tan ^3(c+d x)}{3 d (a \sec (c+d x)+a)^3} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.17, antiderivative size = 71, normalized size of antiderivative = 1.18, number of steps used = 12, number of rules used = 7, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.333, Rules used = {3888, 3886, 3473, 8, 2606, 2607, 30} \[ \frac {4 \cot ^3(c+d x)}{3 a^3 d}-\frac {\cot (c+d x)}{a^3 d}-\frac {4 \csc ^3(c+d x)}{3 a^3 d}+\frac {3 \csc (c+d x)}{a^3 d}-\frac {x}{a^3} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 8
Rule 30
Rule 2606
Rule 2607
Rule 3473
Rule 3886
Rule 3888
Rubi steps
\begin {align*} \int \frac {\tan ^2(c+d x)}{(a+a \sec (c+d x))^3} \, dx &=\frac {\int \cot ^4(c+d x) (-a+a \sec (c+d x))^3 \, dx}{a^6}\\ &=\frac {\int \left (-a^3 \cot ^4(c+d x)+3 a^3 \cot ^3(c+d x) \csc (c+d x)-3 a^3 \cot ^2(c+d x) \csc ^2(c+d x)+a^3 \cot (c+d x) \csc ^3(c+d x)\right ) \, dx}{a^6}\\ &=-\frac {\int \cot ^4(c+d x) \, dx}{a^3}+\frac {\int \cot (c+d x) \csc ^3(c+d x) \, dx}{a^3}+\frac {3 \int \cot ^3(c+d x) \csc (c+d x) \, dx}{a^3}-\frac {3 \int \cot ^2(c+d x) \csc ^2(c+d x) \, dx}{a^3}\\ &=\frac {\cot ^3(c+d x)}{3 a^3 d}+\frac {\int \cot ^2(c+d x) \, dx}{a^3}-\frac {\operatorname {Subst}\left (\int x^2 \, dx,x,\csc (c+d x)\right )}{a^3 d}-\frac {3 \operatorname {Subst}\left (\int x^2 \, dx,x,-\cot (c+d x)\right )}{a^3 d}-\frac {3 \operatorname {Subst}\left (\int \left (-1+x^2\right ) \, dx,x,\csc (c+d x)\right )}{a^3 d}\\ &=-\frac {\cot (c+d x)}{a^3 d}+\frac {4 \cot ^3(c+d x)}{3 a^3 d}+\frac {3 \csc (c+d x)}{a^3 d}-\frac {4 \csc ^3(c+d x)}{3 a^3 d}-\frac {\int 1 \, dx}{a^3}\\ &=-\frac {x}{a^3}-\frac {\cot (c+d x)}{a^3 d}+\frac {4 \cot ^3(c+d x)}{3 a^3 d}+\frac {3 \csc (c+d x)}{a^3 d}-\frac {4 \csc ^3(c+d x)}{3 a^3 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [B] time = 0.40, size = 125, normalized size = 2.08 \[ -\frac {\sec \left (\frac {c}{2}\right ) \sec ^3\left (\frac {1}{2} (c+d x)\right ) \left (351 \sin \left (c+\frac {d x}{2}\right )-277 \sin \left (c+\frac {3 d x}{2}\right )-3 \sin \left (2 c+\frac {3 d x}{2}\right )+180 d x \cos \left (c+\frac {d x}{2}\right )+60 d x \cos \left (c+\frac {3 d x}{2}\right )+60 d x \cos \left (2 c+\frac {3 d x}{2}\right )-471 \sin \left (\frac {d x}{2}\right )+180 d x \cos \left (\frac {d x}{2}\right )\right )}{480 a^3 d} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.60, size = 80, normalized size = 1.33 \[ -\frac {3 \, d x \cos \left (d x + c\right )^{2} + 6 \, d x \cos \left (d x + c\right ) + 3 \, d x - {\left (7 \, \cos \left (d x + c\right ) + 5\right )} \sin \left (d x + c\right )}{3 \, {\left (a^{3} d \cos \left (d x + c\right )^{2} + 2 \, a^{3} d \cos \left (d x + c\right ) + a^{3} d\right )}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 0.79, size = 50, normalized size = 0.83 \[ -\frac {\frac {3 \, {\left (d x + c\right )}}{a^{3}} + \frac {a^{6} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 6 \, a^{6} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{a^{9}}}{3 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.58, size = 56, normalized size = 0.93 \[ -\frac {\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )}{3 d \,a^{3}}+\frac {2 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{d \,a^{3}}-\frac {2 \arctan \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d \,a^{3}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 0.45, size = 72, normalized size = 1.20 \[ \frac {\frac {\frac {6 \, \sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} - \frac {\sin \left (d x + c\right )^{3}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{3}}}{a^{3}} - \frac {6 \, \arctan \left (\frac {\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1}\right )}{a^{3}}}{3 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 1.16, size = 35, normalized size = 0.58 \[ -\frac {{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3-6\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )+3\,d\,x}{3\,a^3\,d} \]
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 {\tan ^{2}{\left (c + d x \right )}}{\sec ^{3}{\left (c + d x \right )} + 3 \sec ^{2}{\left (c + d x \right )} + 3 \sec {\left (c + d x \right )} + 1}\, dx}{a^{3}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________