Optimal. Leaf size=80 \[ \frac {(a \sin (c+d x)+a)^{m+3}}{a^3 d (m+3)}-\frac {2 (a \sin (c+d x)+a)^{m+2}}{a^2 d (m+2)}+\frac {(a \sin (c+d x)+a)^{m+1}}{a d (m+1)} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.08, antiderivative size = 80, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 3, integrand size = 27, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.111, Rules used = {2833, 12, 43} \[ -\frac {2 (a \sin (c+d x)+a)^{m+2}}{a^2 d (m+2)}+\frac {(a \sin (c+d x)+a)^{m+3}}{a^3 d (m+3)}+\frac {(a \sin (c+d x)+a)^{m+1}}{a d (m+1)} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 12
Rule 43
Rule 2833
Rubi steps
\begin {align*} \int \cos (c+d x) \sin ^2(c+d x) (a+a \sin (c+d x))^m \, dx &=\frac {\operatorname {Subst}\left (\int \frac {x^2 (a+x)^m}{a^2} \, dx,x,a \sin (c+d x)\right )}{a d}\\ &=\frac {\operatorname {Subst}\left (\int x^2 (a+x)^m \, dx,x,a \sin (c+d x)\right )}{a^3 d}\\ &=\frac {\operatorname {Subst}\left (\int \left (a^2 (a+x)^m-2 a (a+x)^{1+m}+(a+x)^{2+m}\right ) \, dx,x,a \sin (c+d x)\right )}{a^3 d}\\ &=\frac {(a+a \sin (c+d x))^{1+m}}{a d (1+m)}-\frac {2 (a+a \sin (c+d x))^{2+m}}{a^2 d (2+m)}+\frac {(a+a \sin (c+d x))^{3+m}}{a^3 d (3+m)}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.19, size = 77, normalized size = 0.96 \[ -\frac {(a (\sin (c+d x)+1))^{m+1} \left (\left (m^2+3 m+2\right ) \cos (2 (c+d x))+4 (m+1) \sin (c+d x)-m^2-3 m-6\right )}{2 a d (m+1) (m+2) (m+3)} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.45, size = 93, normalized size = 1.16 \[ -\frac {{\left ({\left (m^{2} + m\right )} \cos \left (d x + c\right )^{2} - m^{2} + {\left ({\left (m^{2} + 3 \, m + 2\right )} \cos \left (d x + c\right )^{2} - m^{2} - m - 2\right )} \sin \left (d x + c\right ) - m - 2\right )} {\left (a \sin \left (d x + c\right ) + a\right )}^{m}}{d m^{3} + 6 \, d m^{2} + 11 \, d m + 6 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [B] time = 0.26, size = 170, normalized size = 2.12 \[ \frac {{\left (a \sin \left (d x + c\right ) + a\right )}^{m} m^{2} \sin \left (d x + c\right )^{3} + {\left (a \sin \left (d x + c\right ) + a\right )}^{m} m^{2} \sin \left (d x + c\right )^{2} + 3 \, {\left (a \sin \left (d x + c\right ) + a\right )}^{m} m \sin \left (d x + c\right )^{3} + {\left (a \sin \left (d x + c\right ) + a\right )}^{m} m \sin \left (d x + c\right )^{2} + 2 \, {\left (a \sin \left (d x + c\right ) + a\right )}^{m} \sin \left (d x + c\right )^{3} - 2 \, {\left (a \sin \left (d x + c\right ) + a\right )}^{m} m \sin \left (d x + c\right ) + 2 \, {\left (a \sin \left (d x + c\right ) + a\right )}^{m}}{{\left (m^{3} + 6 \, m^{2} + 11 \, m + 6\right )} d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [F] time = 4.78, size = 0, normalized size = 0.00 \[ \int \cos \left (d x +c \right ) \left (\sin ^{2}\left (d x +c \right )\right ) \left (a +a \sin \left (d x +c \right )\right )^{m}\, dx \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 0.64, size = 84, normalized size = 1.05 \[ \frac {{\left ({\left (m^{2} + 3 \, m + 2\right )} a^{m} \sin \left (d x + c\right )^{3} + {\left (m^{2} + m\right )} a^{m} \sin \left (d x + c\right )^{2} - 2 \, a^{m} m \sin \left (d x + c\right ) + 2 \, a^{m}\right )} {\left (\sin \left (d x + c\right ) + 1\right )}^{m}}{{\left (m^{3} + 6 \, m^{2} + 11 \, m + 6\right )} d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 9.92, size = 138, normalized size = 1.72 \[ \frac {{\left (a\,\left (\sin \left (c+d\,x\right )+1\right )\right )}^m\,\left (2\,m+6\,\sin \left (c+d\,x\right )-2\,\sin \left (3\,c+3\,d\,x\right )+m\,\sin \left (c+d\,x\right )+2\,m\,\left (2\,{\sin \left (c+d\,x\right )}^2-1\right )-3\,m\,\sin \left (3\,c+3\,d\,x\right )+3\,m^2\,\sin \left (c+d\,x\right )+2\,m^2\,\left (2\,{\sin \left (c+d\,x\right )}^2-1\right )+2\,m^2-m^2\,\sin \left (3\,c+3\,d\,x\right )+8\right )}{4\,d\,\left (m^3+6\,m^2+11\,m+6\right )} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [A] time = 11.85, size = 697, normalized size = 8.71 \[ \begin {cases} x \left (a \sin {\relax (c )} + a\right )^{m} \sin ^{2}{\relax (c )} \cos {\relax (c )} & \text {for}\: d = 0 \\\frac {2 \log {\left (\sin {\left (c + d x \right )} + 1 \right )} \sin ^{2}{\left (c + d x \right )}}{2 a^{3} d \sin ^{2}{\left (c + d x \right )} + 4 a^{3} d \sin {\left (c + d x \right )} + 2 a^{3} d} + \frac {4 \log {\left (\sin {\left (c + d x \right )} + 1 \right )} \sin {\left (c + d x \right )}}{2 a^{3} d \sin ^{2}{\left (c + d x \right )} + 4 a^{3} d \sin {\left (c + d x \right )} + 2 a^{3} d} + \frac {2 \log {\left (\sin {\left (c + d x \right )} + 1 \right )}}{2 a^{3} d \sin ^{2}{\left (c + d x \right )} + 4 a^{3} d \sin {\left (c + d x \right )} + 2 a^{3} d} + \frac {4 \sin {\left (c + d x \right )}}{2 a^{3} d \sin ^{2}{\left (c + d x \right )} + 4 a^{3} d \sin {\left (c + d x \right )} + 2 a^{3} d} + \frac {3}{2 a^{3} d \sin ^{2}{\left (c + d x \right )} + 4 a^{3} d \sin {\left (c + d x \right )} + 2 a^{3} d} & \text {for}\: m = -3 \\- \frac {2 \log {\left (\sin {\left (c + d x \right )} + 1 \right )} \sin {\left (c + d x \right )}}{a^{2} d \sin {\left (c + d x \right )} + a^{2} d} - \frac {2 \log {\left (\sin {\left (c + d x \right )} + 1 \right )}}{a^{2} d \sin {\left (c + d x \right )} + a^{2} d} + \frac {\sin ^{2}{\left (c + d x \right )}}{a^{2} d \sin {\left (c + d x \right )} + a^{2} d} - \frac {2}{a^{2} d \sin {\left (c + d x \right )} + a^{2} d} & \text {for}\: m = -2 \\\frac {\log {\left (\sin {\left (c + d x \right )} + 1 \right )}}{a d} - \frac {\sin {\left (c + d x \right )}}{a d} - \frac {\cos ^{2}{\left (c + d x \right )}}{2 a d} & \text {for}\: m = -1 \\\frac {m^{2} \left (a \sin {\left (c + d x \right )} + a\right )^{m} \sin ^{3}{\left (c + d x \right )}}{d m^{3} + 6 d m^{2} + 11 d m + 6 d} + \frac {m^{2} \left (a \sin {\left (c + d x \right )} + a\right )^{m} \sin ^{2}{\left (c + d x \right )}}{d m^{3} + 6 d m^{2} + 11 d m + 6 d} + \frac {3 m \left (a \sin {\left (c + d x \right )} + a\right )^{m} \sin ^{3}{\left (c + d x \right )}}{d m^{3} + 6 d m^{2} + 11 d m + 6 d} + \frac {m \left (a \sin {\left (c + d x \right )} + a\right )^{m} \sin ^{2}{\left (c + d x \right )}}{d m^{3} + 6 d m^{2} + 11 d m + 6 d} - \frac {2 m \left (a \sin {\left (c + d x \right )} + a\right )^{m} \sin {\left (c + d x \right )}}{d m^{3} + 6 d m^{2} + 11 d m + 6 d} + \frac {2 \left (a \sin {\left (c + d x \right )} + a\right )^{m} \sin ^{3}{\left (c + d x \right )}}{d m^{3} + 6 d m^{2} + 11 d m + 6 d} + \frac {2 \left (a \sin {\left (c + d x \right )} + a\right )^{m}}{d m^{3} + 6 d m^{2} + 11 d m + 6 d} & \text {otherwise} \end {cases} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________