Optimal. Leaf size=44 \[ \frac {2 a^2 \tan (c+d x)}{d}+\frac {2 a^2 \sec (c+d x)}{d}-\frac {a^2 \tanh ^{-1}(\cos (c+d x))}{d} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.13, antiderivative size = 44, normalized size of antiderivative = 1.00, number of steps used = 9, number of rules used = 7, integrand size = 27, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.259, Rules used = {2873, 3767, 8, 2622, 321, 207, 2606} \[ \frac {2 a^2 \tan (c+d x)}{d}+\frac {2 a^2 \sec (c+d x)}{d}-\frac {a^2 \tanh ^{-1}(\cos (c+d x))}{d} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 8
Rule 207
Rule 321
Rule 2606
Rule 2622
Rule 2873
Rule 3767
Rubi steps
\begin {align*} \int \csc (c+d x) \sec ^2(c+d x) (a+a \sin (c+d x))^2 \, dx &=\int \left (2 a^2 \sec ^2(c+d x)+a^2 \csc (c+d x) \sec ^2(c+d x)+a^2 \sec (c+d x) \tan (c+d x)\right ) \, dx\\ &=a^2 \int \csc (c+d x) \sec ^2(c+d x) \, dx+a^2 \int \sec (c+d x) \tan (c+d x) \, dx+\left (2 a^2\right ) \int \sec ^2(c+d x) \, dx\\ &=\frac {a^2 \operatorname {Subst}(\int 1 \, dx,x,\sec (c+d x))}{d}+\frac {a^2 \operatorname {Subst}\left (\int \frac {x^2}{-1+x^2} \, dx,x,\sec (c+d x)\right )}{d}-\frac {\left (2 a^2\right ) \operatorname {Subst}(\int 1 \, dx,x,-\tan (c+d x))}{d}\\ &=\frac {2 a^2 \sec (c+d x)}{d}+\frac {2 a^2 \tan (c+d x)}{d}+\frac {a^2 \operatorname {Subst}\left (\int \frac {1}{-1+x^2} \, dx,x,\sec (c+d x)\right )}{d}\\ &=-\frac {a^2 \tanh ^{-1}(\cos (c+d x))}{d}+\frac {2 a^2 \sec (c+d x)}{d}+\frac {2 a^2 \tan (c+d x)}{d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.11, size = 69, normalized size = 1.57 \[ \frac {a^2 \left (\log \left (\sin \left (\frac {1}{2} (c+d x)\right )\right )-\log \left (\cos \left (\frac {1}{2} (c+d x)\right )\right )+\frac {4 \sin \left (\frac {1}{2} (c+d x)\right )}{\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )}\right )}{d} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [B] time = 0.46, size = 126, normalized size = 2.86 \[ \frac {4 \, a^{2} \cos \left (d x + c\right ) + 4 \, a^{2} \sin \left (d x + c\right ) + 4 \, a^{2} - {\left (a^{2} \cos \left (d x + c\right ) - a^{2} \sin \left (d x + c\right ) + 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 ) - a^{2} \sin \left (d x + c\right ) + a^{2}\right )} \log \left (-\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right )}{2 \, {\left (d \cos \left (d x + c\right ) - d \sin \left (d x + c\right ) + d\right )}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 0.20, size = 38, normalized size = 0.86 \[ \frac {a^{2} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) \right |}\right ) - \frac {4 \, a^{2}}{\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1}}{d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.55, size = 55, normalized size = 1.25 \[ \frac {2 a^{2}}{d \cos \left (d x +c \right )}+\frac {2 a^{2} \tan \left (d x +c \right )}{d}+\frac {a^{2} \ln \left (\csc \left (d x +c \right )-\cot \left (d x +c \right )\right )}{d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 0.31, size = 65, normalized size = 1.48 \[ \frac {a^{2} {\left (\frac {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 \, a^{2} \tan \left (d x + c\right ) + \frac {2 \, a^{2}}{\cos \left (d x + c\right )}}{2 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 8.89, size = 39, normalized size = 0.89 \[ \frac {a^2\,\ln \left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )}{d}-\frac {4\,a^2}{d\,\left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )-1\right )} \]
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]
________________________________________________________________________________________