Optimal. Leaf size=55 \[ \frac {a^2 (A+2 B) \cos (c+d x)}{d}-\left (a^2 x (A+2 B)\right )+\frac {(A+B) \sec (c+d x) (a \sin (c+d x)+a)^2}{d} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.09, antiderivative size = 55, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, integrand size = 31, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.065, Rules used = {2855, 2638} \[ \frac {a^2 (A+2 B) \cos (c+d x)}{d}+a^2 x (-(A+2 B))+\frac {(A+B) \sec (c+d x) (a \sin (c+d x)+a)^2}{d} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 2638
Rule 2855
Rubi steps
\begin {align*} \int \sec ^2(c+d x) (a+a \sin (c+d x))^2 (A+B \sin (c+d x)) \, dx &=\frac {(A+B) \sec (c+d x) (a+a \sin (c+d x))^2}{d}-(a (A+2 B)) \int (a+a \sin (c+d x)) \, dx\\ &=-a^2 (A+2 B) x+\frac {(A+B) \sec (c+d x) (a+a \sin (c+d x))^2}{d}-\left (a^2 (A+2 B)\right ) \int \sin (c+d x) \, dx\\ &=-a^2 (A+2 B) x+\frac {a^2 (A+2 B) \cos (c+d x)}{d}+\frac {(A+B) \sec (c+d x) (a+a \sin (c+d x))^2}{d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.24, size = 91, normalized size = 1.65 \[ \frac {a^2 \sec (c+d x) \left (4 (A+2 B) \sin ^{-1}\left (\frac {\sqrt {1-\sin (c+d x)}}{\sqrt {2}}\right ) \sqrt {\cos ^2(c+d x)}+4 A \sin (c+d x)+4 A+4 B \sin (c+d x)+B \cos (2 (c+d x))+5 B\right )}{2 d} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [B] time = 0.68, size = 128, normalized size = 2.33 \[ -\frac {{\left (A + 2 \, B\right )} a^{2} d x - B a^{2} \cos \left (d x + c\right )^{2} - 2 \, {\left (A + B\right )} a^{2} + {\left ({\left (A + 2 \, B\right )} a^{2} d x - {\left (2 \, A + 3 \, B\right )} a^{2}\right )} \cos \left (d x + c\right ) - {\left ({\left (A + 2 \, B\right )} a^{2} d x - B a^{2} \cos \left (d x + c\right ) + 2 \, {\left (A + B\right )} a^{2}\right )} \sin \left (d x + c\right )}{d \cos \left (d x + c\right ) - d \sin \left (d x + c\right ) + d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [B] time = 0.20, size = 125, normalized size = 2.27 \[ -\frac {{\left (A a^{2} + 2 \, B a^{2}\right )} {\left (d x + c\right )} + \frac {2 \, {\left (2 \, A a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 2 \, B a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - B a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 2 \, A a^{2} + 3 \, B a^{2}\right )}}{\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{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 [B] time = 0.61, size = 123, normalized size = 2.24 \[ \frac {a^{2} A \left (\tan \left (d x +c \right )-d x -c \right )+B \,a^{2} \left (\frac {\sin ^{4}\left (d x +c \right )}{\cos \left (d x +c \right )}+\left (2+\sin ^{2}\left (d x +c \right )\right ) \cos \left (d x +c \right )\right )+\frac {2 a^{2} A}{\cos \left (d x +c \right )}+2 B \,a^{2} \left (\tan \left (d x +c \right )-d x -c \right )+a^{2} A \tan \left (d x +c \right )+\frac {B \,a^{2}}{\cos \left (d x +c \right )}}{d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 0.50, size = 104, normalized size = 1.89 \[ -\frac {{\left (d x + c - \tan \left (d x + c\right )\right )} A a^{2} + 2 \, {\left (d x + c - \tan \left (d x + c\right )\right )} B a^{2} - B a^{2} {\left (\frac {1}{\cos \left (d x + c\right )} + \cos \left (d x + c\right )\right )} - A a^{2} \tan \left (d x + c\right ) - \frac {2 \, A a^{2}}{\cos \left (d x + c\right )} - \frac {B a^{2}}{\cos \left (d x + c\right )}}{d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 9.30, size = 110, normalized size = 2.00 \[ -\frac {4\,A\,a^2+6\,B\,a^2+{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2\,\left (4\,A\,a^2+4\,B\,a^2\right )-2\,B\,a^2\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{d\,\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3-{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )-1\right )}-A\,a^2\,x-2\,B\,a^2\,x \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F] time = 0.00, size = 0, normalized size = 0.00 \[ a^{2} \left (\int A \sec ^{2}{\left (c + d x \right )}\, dx + \int 2 A \sin {\left (c + d x \right )} \sec ^{2}{\left (c + d x \right )}\, dx + \int A \sin ^{2}{\left (c + d x \right )} \sec ^{2}{\left (c + d x \right )}\, dx + \int B \sin {\left (c + d x \right )} \sec ^{2}{\left (c + d x \right )}\, dx + \int 2 B \sin ^{2}{\left (c + d x \right )} \sec ^{2}{\left (c + d x \right )}\, dx + \int B \sin ^{3}{\left (c + d x \right )} \sec ^{2}{\left (c + d x \right )}\, dx\right ) \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________