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

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

[Out]

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

________________________________________________________________________________________

Rubi [A]  time = 0.05, antiderivative size = 52, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, integrand size = 27, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.074, Rules used = {2833, 43} \[ \frac {(a B+A b) \sin ^2(c+d x)}{2 d}+\frac {a A \sin (c+d x)}{d}+\frac {b B \sin ^3(c+d x)}{3 d} \]

Antiderivative was successfully verified.

[In]

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

[Out]

(a*A*Sin[c + d*x])/d + ((A*b + a*B)*Sin[c + d*x]^2)/(2*d) + (b*B*Sin[c + d*x]^3)/(3*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)) (A+B \sin (c+d x)) \, dx &=\frac {\operatorname {Subst}\left (\int (a+x) \left (A+\frac {B x}{b}\right ) \, dx,x,b \sin (c+d x)\right )}{b d}\\ &=\frac {\operatorname {Subst}\left (\int \left (a A+\frac {(A b+a B) x}{b}+\frac {B x^2}{b}\right ) \, dx,x,b \sin (c+d x)\right )}{b d}\\ &=\frac {a A \sin (c+d x)}{d}+\frac {(A b+a B) \sin ^2(c+d x)}{2 d}+\frac {b B \sin ^3(c+d x)}{3 d}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.08, size = 45, normalized size = 0.87 \[ \frac {\sin (c+d x) \left (3 (a B+A b) \sin (c+d x)+6 a A+2 b B \sin ^2(c+d x)\right )}{6 d} \]

Antiderivative was successfully verified.

[In]

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

[Out]

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

________________________________________________________________________________________

fricas [A]  time = 0.43, size = 51, normalized size = 0.98 \[ -\frac {3 \, {\left (B a + A b\right )} \cos \left (d x + c\right )^{2} + 2 \, {\left (B b \cos \left (d x + c\right )^{2} - 3 \, A a - B b\right )} \sin \left (d x + c\right )}{6 \, d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

giac [A]  time = 0.16, size = 52, normalized size = 1.00 \[ \frac {2 \, B b \sin \left (d x + c\right )^{3} + 3 \, B a \sin \left (d x + c\right )^{2} + 3 \, A b \sin \left (d x + c\right )^{2} + 6 \, A a \sin \left (d x + c\right )}{6 \, d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

maxima [A]  time = 0.32, size = 45, normalized size = 0.87 \[ \frac {2 \, B b \sin \left (d x + c\right )^{3} + 6 \, A a \sin \left (d x + c\right ) + 3 \, {\left (B a + A b\right )} \sin \left (d x + c\right )^{2}}{6 \, d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

mupad [B]  time = 12.04, size = 44, normalized size = 0.85 \[ \frac {\frac {B\,b\,{\sin \left (c+d\,x\right )}^3}{3}+\left (\frac {A\,b}{2}+\frac {B\,a}{2}\right )\,{\sin \left (c+d\,x\right )}^2+A\,a\,\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)),x)

[Out]

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

________________________________________________________________________________________

sympy [A]  time = 0.48, size = 75, normalized size = 1.44 \[ \begin {cases} \frac {A a \sin {\left (c + d x \right )}}{d} - \frac {A b \cos ^{2}{\left (c + d x \right )}}{2 d} - \frac {B a \cos ^{2}{\left (c + d x \right )}}{2 d} + \frac {B b \sin ^{3}{\left (c + d x \right )}}{3 d} & \text {for}\: d \neq 0 \\x \left (A + B \sin {\relax (c )}\right ) \left (a + b \sin {\relax (c )}\right ) \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))*(A+B*sin(d*x+c)),x)

[Out]

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

________________________________________________________________________________________