3.1539 \(\int \cos (c+d x) (a+b \sin (c+d x))^2 (A+B \sin (c+d x)) \, dx\)

Optimal. Leaf size=54 \[ \frac {(A b-a B) (a+b \sin (c+d x))^3}{3 b^2 d}+\frac {B (a+b \sin (c+d x))^4}{4 b^2 d} \]

[Out]

1/3*(A*b-B*a)*(a+b*sin(d*x+c))^3/b^2/d+1/4*B*(a+b*sin(d*x+c))^4/b^2/d

________________________________________________________________________________________

Rubi [A]  time = 0.08, antiderivative size = 54, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, integrand size = 29, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.069, Rules used = {2833, 43} \[ \frac {(A b-a B) (a+b \sin (c+d x))^3}{3 b^2 d}+\frac {B (a+b \sin (c+d x))^4}{4 b^2 d} \]

Antiderivative was successfully verified.

[In]

Int[Cos[c + d*x]*(a + b*Sin[c + d*x])^2*(A + B*Sin[c + d*x]),x]

[Out]

((A*b - a*B)*(a + b*Sin[c + d*x])^3)/(3*b^2*d) + (B*(a + b*Sin[c + d*x])^4)/(4*b^2*d)

Rule 43

Int[((a_.) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_.), x_Symbol] :> Int[ExpandIntegrand[(a + b*x)^m*(c + d
*x)^n, x], x] /; FreeQ[{a, b, c, d, n}, x] && NeQ[b*c - a*d, 0] && IGtQ[m, 0] && ( !IntegerQ[n] || (EqQ[c, 0]
&& LeQ[7*m + 4*n + 4, 0]) || LtQ[9*m + 5*(n + 1), 0] || GtQ[m + n + 2, 0])

Rule 2833

Int[cos[(e_.) + (f_.)*(x_)]*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)*((c_.) + (d_.)*sin[(e_.) + (f_.)*(x_)
])^(n_.), x_Symbol] :> Dist[1/(b*f), Subst[Int[(a + x)^m*(c + (d*x)/b)^n, x], x, b*Sin[e + f*x]], x] /; FreeQ[
{a, b, c, d, e, f, m, n}, x]

Rubi steps

\begin {align*} \int \cos (c+d x) (a+b \sin (c+d x))^2 (A+B \sin (c+d x)) \, dx &=\frac {\operatorname {Subst}\left (\int (a+x)^2 \left (A+\frac {B x}{b}\right ) \, dx,x,b \sin (c+d x)\right )}{b d}\\ &=\frac {\operatorname {Subst}\left (\int \left (\frac {(A b-a B) (a+x)^2}{b}+\frac {B (a+x)^3}{b}\right ) \, dx,x,b \sin (c+d x)\right )}{b d}\\ &=\frac {(A b-a B) (a+b \sin (c+d x))^3}{3 b^2 d}+\frac {B (a+b \sin (c+d x))^4}{4 b^2 d}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.07, size = 41, normalized size = 0.76 \[ \frac {(a+b \sin (c+d x))^3 (-a B+4 A b+3 b B \sin (c+d x))}{12 b^2 d} \]

Antiderivative was successfully verified.

[In]

Integrate[Cos[c + d*x]*(a + b*Sin[c + d*x])^2*(A + B*Sin[c + d*x]),x]

[Out]

((a + b*Sin[c + d*x])^3*(4*A*b - a*B + 3*b*B*Sin[c + d*x]))/(12*b^2*d)

________________________________________________________________________________________

fricas [A]  time = 0.44, size = 92, normalized size = 1.70 \[ \frac {3 \, B b^{2} \cos \left (d x + c\right )^{4} - 6 \, {\left (B a^{2} + 2 \, A a b + B b^{2}\right )} \cos \left (d x + c\right )^{2} + 4 \, {\left (3 \, A a^{2} + 2 \, B a b + A b^{2} - {\left (2 \, B a b + A b^{2}\right )} \cos \left (d x + c\right )^{2}\right )} \sin \left (d x + c\right )}{12 \, d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)*(a+b*sin(d*x+c))^2*(A+B*sin(d*x+c)),x, algorithm="fricas")

[Out]

1/12*(3*B*b^2*cos(d*x + c)^4 - 6*(B*a^2 + 2*A*a*b + B*b^2)*cos(d*x + c)^2 + 4*(3*A*a^2 + 2*B*a*b + A*b^2 - (2*
B*a*b + A*b^2)*cos(d*x + c)^2)*sin(d*x + c))/d

________________________________________________________________________________________

giac [A]  time = 0.17, size = 86, normalized size = 1.59 \[ \frac {3 \, B b^{2} \sin \left (d x + c\right )^{4} + 8 \, B a b \sin \left (d x + c\right )^{3} + 4 \, A b^{2} \sin \left (d x + c\right )^{3} + 6 \, B a^{2} \sin \left (d x + c\right )^{2} + 12 \, A a b \sin \left (d x + c\right )^{2} + 12 \, A a^{2} \sin \left (d x + c\right )}{12 \, d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)*(a+b*sin(d*x+c))^2*(A+B*sin(d*x+c)),x, algorithm="giac")

[Out]

1/12*(3*B*b^2*sin(d*x + c)^4 + 8*B*a*b*sin(d*x + c)^3 + 4*A*b^2*sin(d*x + c)^3 + 6*B*a^2*sin(d*x + c)^2 + 12*A
*a*b*sin(d*x + c)^2 + 12*A*a^2*sin(d*x + c))/d

________________________________________________________________________________________

maple [A]  time = 0.24, size = 73, normalized size = 1.35 \[ \frac {\frac {B \,b^{2} \left (\sin ^{4}\left (d x +c \right )\right )}{4}+\frac {\left (A \,b^{2}+2 B a b \right ) \left (\sin ^{3}\left (d x +c \right )\right )}{3}+\frac {\left (2 A a b +B \,a^{2}\right ) \left (\sin ^{2}\left (d x +c \right )\right )}{2}+a^{2} A \sin \left (d x +c \right )}{d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cos(d*x+c)*(a+b*sin(d*x+c))^2*(A+B*sin(d*x+c)),x)

[Out]

1/d*(1/4*B*b^2*sin(d*x+c)^4+1/3*(A*b^2+2*B*a*b)*sin(d*x+c)^3+1/2*(2*A*a*b+B*a^2)*sin(d*x+c)^2+a^2*A*sin(d*x+c)
)

________________________________________________________________________________________

maxima [A]  time = 0.31, size = 74, normalized size = 1.37 \[ \frac {3 \, B b^{2} \sin \left (d x + c\right )^{4} + 12 \, A a^{2} \sin \left (d x + c\right ) + 4 \, {\left (2 \, B a b + A b^{2}\right )} \sin \left (d x + c\right )^{3} + 6 \, {\left (B a^{2} + 2 \, A a b\right )} \sin \left (d x + c\right )^{2}}{12 \, d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)*(a+b*sin(d*x+c))^2*(A+B*sin(d*x+c)),x, algorithm="maxima")

[Out]

1/12*(3*B*b^2*sin(d*x + c)^4 + 12*A*a^2*sin(d*x + c) + 4*(2*B*a*b + A*b^2)*sin(d*x + c)^3 + 6*(B*a^2 + 2*A*a*b
)*sin(d*x + c)^2)/d

________________________________________________________________________________________

mupad [B]  time = 0.07, size = 71, normalized size = 1.31 \[ \frac {{\sin \left (c+d\,x\right )}^2\,\left (\frac {B\,a^2}{2}+A\,b\,a\right )+{\sin \left (c+d\,x\right )}^3\,\left (\frac {A\,b^2}{3}+\frac {2\,B\,a\,b}{3}\right )+\frac {B\,b^2\,{\sin \left (c+d\,x\right )}^4}{4}+A\,a^2\,\sin \left (c+d\,x\right )}{d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cos(c + d*x)*(A + B*sin(c + d*x))*(a + b*sin(c + d*x))^2,x)

[Out]

(sin(c + d*x)^2*((B*a^2)/2 + A*a*b) + sin(c + d*x)^3*((A*b^2)/3 + (2*B*a*b)/3) + (B*b^2*sin(c + d*x)^4)/4 + A*
a^2*sin(c + d*x))/d

________________________________________________________________________________________

sympy [A]  time = 1.02, size = 117, normalized size = 2.17 \[ \begin {cases} \frac {A a^{2} \sin {\left (c + d x \right )}}{d} - \frac {A a b \cos ^{2}{\left (c + d x \right )}}{d} + \frac {A b^{2} \sin ^{3}{\left (c + d x \right )}}{3 d} - \frac {B a^{2} \cos ^{2}{\left (c + d x \right )}}{2 d} + \frac {2 B a b \sin ^{3}{\left (c + d x \right )}}{3 d} + \frac {B b^{2} \sin ^{4}{\left (c + d x \right )}}{4 d} & \text {for}\: d \neq 0 \\x \left (A + B \sin {\relax (c )}\right ) \left (a + b \sin {\relax (c )}\right )^{2} \cos {\relax (c )} & \text {otherwise} \end {cases} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)*(a+b*sin(d*x+c))**2*(A+B*sin(d*x+c)),x)

[Out]

Piecewise((A*a**2*sin(c + d*x)/d - A*a*b*cos(c + d*x)**2/d + A*b**2*sin(c + d*x)**3/(3*d) - B*a**2*cos(c + d*x
)**2/(2*d) + 2*B*a*b*sin(c + d*x)**3/(3*d) + B*b**2*sin(c + d*x)**4/(4*d), Ne(d, 0)), (x*(A + B*sin(c))*(a + b
*sin(c))**2*cos(c), True))

________________________________________________________________________________________