Optimal. Leaf size=85 \[ -\frac {a^2 \cot ^3(c+d x)}{3 d}+\frac {a^2 \cot (c+d x)}{d}+a^2 x-\frac {2 a b \csc ^3(c+d x)}{3 d}+\frac {2 a b \csc (c+d x)}{d}-\frac {b^2 \cot ^3(c+d x)}{3 d} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.12, antiderivative size = 85, normalized size of antiderivative = 1.00, number of steps used = 9, number of rules used = 6, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.286, Rules used = {3886, 3473, 8, 2606, 2607, 30} \[ -\frac {a^2 \cot ^3(c+d x)}{3 d}+\frac {a^2 \cot (c+d x)}{d}+a^2 x-\frac {2 a b \csc ^3(c+d x)}{3 d}+\frac {2 a b \csc (c+d x)}{d}-\frac {b^2 \cot ^3(c+d x)}{3 d} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 8
Rule 30
Rule 2606
Rule 2607
Rule 3473
Rule 3886
Rubi steps
\begin {align*} \int \cot ^4(c+d x) (a+b \sec (c+d x))^2 \, dx &=\int \left (a^2 \cot ^4(c+d x)+2 a b \cot ^3(c+d x) \csc (c+d x)+b^2 \cot ^2(c+d x) \csc ^2(c+d x)\right ) \, dx\\ &=a^2 \int \cot ^4(c+d x) \, dx+(2 a b) \int \cot ^3(c+d x) \csc (c+d x) \, dx+b^2 \int \cot ^2(c+d x) \csc ^2(c+d x) \, dx\\ &=-\frac {a^2 \cot ^3(c+d x)}{3 d}-a^2 \int \cot ^2(c+d x) \, dx-\frac {(2 a b) \operatorname {Subst}\left (\int \left (-1+x^2\right ) \, dx,x,\csc (c+d x)\right )}{d}+\frac {b^2 \operatorname {Subst}\left (\int x^2 \, dx,x,-\cot (c+d x)\right )}{d}\\ &=\frac {a^2 \cot (c+d x)}{d}-\frac {a^2 \cot ^3(c+d x)}{3 d}-\frac {b^2 \cot ^3(c+d x)}{3 d}+\frac {2 a b \csc (c+d x)}{d}-\frac {2 a b \csc ^3(c+d x)}{3 d}+a^2 \int 1 \, dx\\ &=a^2 x+\frac {a^2 \cot (c+d x)}{d}-\frac {a^2 \cot ^3(c+d x)}{3 d}-\frac {b^2 \cot ^3(c+d x)}{3 d}+\frac {2 a b \csc (c+d x)}{d}-\frac {2 a b \csc ^3(c+d x)}{3 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.48, size = 122, normalized size = 1.44 \[ -\frac {\csc ^3(c+d x) \left (-9 a^2 c \sin (c+d x)-9 a^2 d x \sin (c+d x)+3 a^2 c \sin (3 (c+d x))+3 a^2 d x \sin (3 (c+d x))+4 a^2 \cos (3 (c+d x))+12 a b \cos (2 (c+d x))-4 a b+3 b^2 \cos (c+d x)+b^2 \cos (3 (c+d x))\right )}{12 d} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.50, size = 102, normalized size = 1.20 \[ \frac {6 \, a b \cos \left (d x + c\right )^{2} + {\left (4 \, a^{2} + b^{2}\right )} \cos \left (d x + c\right )^{3} - 3 \, a^{2} \cos \left (d x + c\right ) - 4 \, a b + 3 \, {\left (a^{2} d x \cos \left (d x + c\right )^{2} - a^{2} d x\right )} \sin \left (d x + c\right )}{3 \, {\left (d \cos \left (d x + c\right )^{2} - d\right )} \sin \left (d x + c\right )} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [B] time = 0.32, size = 176, normalized size = 2.07 \[ \frac {a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 2 \, a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 24 \, {\left (d x + c\right )} a^{2} - 15 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 18 \, a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 3 \, b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + \frac {15 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 18 \, a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 3 \, b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - a^{2} - 2 \, a b - b^{2}}{\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3}}}{24 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.82, size = 111, normalized size = 1.31 \[ \frac {a^{2} \left (-\frac {\left (\cot ^{3}\left (d x +c \right )\right )}{3}+\cot \left (d x +c \right )+d x +c \right )+2 a b \left (-\frac {\cos ^{4}\left (d x +c \right )}{3 \sin \left (d x +c \right )^{3}}+\frac {\cos ^{4}\left (d x +c \right )}{3 \sin \left (d x +c \right )}+\frac {\left (2+\cos ^{2}\left (d x +c \right )\right ) \sin \left (d x +c \right )}{3}\right )-\frac {b^{2} \left (\cos ^{3}\left (d x +c \right )\right )}{3 \sin \left (d x +c \right )^{3}}}{d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 0.57, size = 76, normalized size = 0.89 \[ \frac {{\left (3 \, d x + 3 \, c + \frac {3 \, \tan \left (d x + c\right )^{2} - 1}{\tan \left (d x + c\right )^{3}}\right )} a^{2} + \frac {2 \, {\left (3 \, \sin \left (d x + c\right )^{2} - 1\right )} a b}{\sin \left (d x + c\right )^{3}} - \frac {b^{2}}{\tan \left (d x + c\right )^{3}}}{3 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 1.46, size = 118, normalized size = 1.39 \[ a^2\,x+\frac {{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3\,{\left (a-b\right )}^2}{24\,d}-\frac {\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (\frac {a\,\left (a-b\right )}{2}+\frac {{\left (a-b\right )}^2}{8}\right )}{d}-\frac {{\mathrm {cot}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3\,\left (\frac {2\,a\,b}{3}+\frac {a^2}{3}+\frac {b^2}{3}-{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2\,\left (5\,a^2+6\,a\,b+b^2\right )\right )}{8\,d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int \left (a + b \sec {\left (c + d x \right )}\right )^{2} \cot ^{4}{\left (c + d x \right )}\, dx \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________