Optimal. Leaf size=73 \[ \frac {a^2 \cos (c+d x)}{d}-\frac {2 a^2 \cot (c+d x)}{d}-\frac {a^2 \tanh ^{-1}(\cos (c+d x))}{2 d}-\frac {a^2 \cot (c+d x) \csc (c+d x)}{2 d}-2 a^2 x \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.13, antiderivative size = 73, normalized size of antiderivative = 1.00, number of steps used = 7, number of rules used = 6, integrand size = 27, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.222, Rules used = {2872, 3767, 8, 3768, 3770, 2638} \[ \frac {a^2 \cos (c+d x)}{d}-\frac {2 a^2 \cot (c+d x)}{d}-\frac {a^2 \tanh ^{-1}(\cos (c+d x))}{2 d}-\frac {a^2 \cot (c+d x) \csc (c+d x)}{2 d}-2 a^2 x \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 8
Rule 2638
Rule 2872
Rule 3767
Rule 3768
Rule 3770
Rubi steps
\begin {align*} \int \cot ^2(c+d x) \csc (c+d x) (a+a \sin (c+d x))^2 \, dx &=\frac {\int \left (-2 a^4+2 a^4 \csc ^2(c+d x)+a^4 \csc ^3(c+d x)-a^4 \sin (c+d x)\right ) \, dx}{a^2}\\ &=-2 a^2 x+a^2 \int \csc ^3(c+d x) \, dx-a^2 \int \sin (c+d x) \, dx+\left (2 a^2\right ) \int \csc ^2(c+d x) \, dx\\ &=-2 a^2 x+\frac {a^2 \cos (c+d x)}{d}-\frac {a^2 \cot (c+d x) \csc (c+d x)}{2 d}+\frac {1}{2} a^2 \int \csc (c+d x) \, dx-\frac {\left (2 a^2\right ) \operatorname {Subst}(\int 1 \, dx,x,\cot (c+d x))}{d}\\ &=-2 a^2 x-\frac {a^2 \tanh ^{-1}(\cos (c+d x))}{2 d}+\frac {a^2 \cos (c+d x)}{d}-\frac {2 a^2 \cot (c+d x)}{d}-\frac {a^2 \cot (c+d x) \csc (c+d x)}{2 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.67, size = 102, normalized size = 1.40 \[ \frac {a^2 \left (8 \cos (c+d x)+8 \tan \left (\frac {1}{2} (c+d x)\right )-8 \cot \left (\frac {1}{2} (c+d x)\right )-\csc ^2\left (\frac {1}{2} (c+d x)\right )+\sec ^2\left (\frac {1}{2} (c+d x)\right )+4 \log \left (\sin \left (\frac {1}{2} (c+d x)\right )\right )-4 \log \left (\cos \left (\frac {1}{2} (c+d x)\right )\right )-16 c-16 d x\right )}{8 d} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [B] time = 0.53, size = 143, normalized size = 1.96 \[ -\frac {8 \, a^{2} d x \cos \left (d x + c\right )^{2} - 4 \, a^{2} \cos \left (d x + c\right )^{3} - 8 \, a^{2} d x - 8 \, a^{2} \cos \left (d x + c\right ) \sin \left (d x + c\right ) + 2 \, a^{2} \cos \left (d x + c\right ) + {\left (a^{2} \cos \left (d x + c\right )^{2} - a^{2}\right )} \log \left (\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) - {\left (a^{2} \cos \left (d x + c\right )^{2} - a^{2}\right )} \log \left (-\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right )}{4 \, {\left (d \cos \left (d x + c\right )^{2} - d\right )}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 0.19, size = 128, normalized size = 1.75 \[ \frac {a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 16 \, {\left (d x + c\right )} a^{2} + 4 \, a^{2} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) \right |}\right ) + 8 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + \frac {16 \, a^{2}}{\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 1} - \frac {6 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 8 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + a^{2}}{\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2}}}{8 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.35, size = 93, normalized size = 1.27 \[ \frac {a^{2} \cos \left (d x +c \right )}{2 d}+\frac {a^{2} \ln \left (\csc \left (d x +c \right )-\cot \left (d x +c \right )\right )}{2 d}-2 a^{2} x -\frac {2 a^{2} \cot \left (d x +c \right )}{d}-\frac {2 a^{2} c}{d}-\frac {a^{2} \left (\cos ^{3}\left (d x +c \right )\right )}{2 d \sin \left (d x +c \right )^{2}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 0.58, size = 104, normalized size = 1.42 \[ -\frac {8 \, {\left (d x + c + \frac {1}{\tan \left (d x + c\right )}\right )} a^{2} - a^{2} {\left (\frac {2 \, \cos \left (d x + c\right )}{\cos \left (d x + c\right )^{2} - 1} + \log \left (\cos \left (d x + c\right ) + 1\right ) - \log \left (\cos \left (d x + c\right ) - 1\right )\right )} - 2 \, a^{2} {\left (2 \, \cos \left (d x + c\right ) - \log \left (\cos \left (d x + c\right ) + 1\right ) + \log \left (\cos \left (d x + c\right ) - 1\right )\right )}}{4 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 8.78, size = 213, normalized size = 2.92 \[ \frac {a^2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2}{8\,d}-\frac {4\,a^2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3-\frac {15\,a^2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2}{2}+4\,a^2\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )+\frac {a^2}{2}}{d\,\left (4\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4+4\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2\right )}+\frac {a^2\,\ln \left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )}{2\,d}+\frac {4\,a^2\,\mathrm {atan}\left (\frac {16\,a^4}{4\,a^4+16\,a^4\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}-\frac {4\,a^4\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{4\,a^4+16\,a^4\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{d}+\frac {a^2\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F(-1)] time = 0.00, size = 0, normalized size = 0.00 \[ \text {Timed out} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________