3.388 \(\int \cos ^3(c+d x) (a+b \sin (c+d x))^2 \, dx\)

Optimal. Leaf size=77 \[ -\frac {\left (a^2-b^2\right ) (a+b \sin (c+d x))^3}{3 b^3 d}-\frac {(a+b \sin (c+d x))^5}{5 b^3 d}+\frac {a (a+b \sin (c+d x))^4}{2 b^3 d} \]

[Out]

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

________________________________________________________________________________________

Rubi [A]  time = 0.07, antiderivative size = 77, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.095, Rules used = {2668, 697} \[ -\frac {\left (a^2-b^2\right ) (a+b \sin (c+d x))^3}{3 b^3 d}-\frac {(a+b \sin (c+d x))^5}{5 b^3 d}+\frac {a (a+b \sin (c+d x))^4}{2 b^3 d} \]

Antiderivative was successfully verified.

[In]

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

[Out]

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

Rule 697

Int[((d_) + (e_.)*(x_))^(m_)*((a_) + (c_.)*(x_)^2)^(p_.), x_Symbol] :> Int[ExpandIntegrand[(d + e*x)^m*(a + c*
x^2)^p, x], x] /; FreeQ[{a, c, d, e, m}, x] && NeQ[c*d^2 + a*e^2, 0] && IGtQ[p, 0]

Rule 2668

Int[cos[(e_.) + (f_.)*(x_)]^(p_.)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.), x_Symbol] :> Dist[1/(b^p*f), S
ubst[Int[(a + x)^m*(b^2 - x^2)^((p - 1)/2), x], x, b*Sin[e + f*x]], x] /; FreeQ[{a, b, e, f, m}, x] && Integer
Q[(p - 1)/2] && NeQ[a^2 - b^2, 0]

Rubi steps

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

________________________________________________________________________________________

Mathematica [A]  time = 0.12, size = 56, normalized size = 0.73 \[ \frac {(a+b \sin (c+d x))^3 \left (-a^2+3 a b \sin (c+d x)+3 b^2 \cos (2 (c+d x))+7 b^2\right )}{30 b^3 d} \]

Antiderivative was successfully verified.

[In]

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

[Out]

((a + b*Sin[c + d*x])^3*(-a^2 + 7*b^2 + 3*b^2*Cos[2*(c + d*x)] + 3*a*b*Sin[c + d*x]))/(30*b^3*d)

________________________________________________________________________________________

fricas [A]  time = 0.48, size = 69, normalized size = 0.90 \[ -\frac {15 \, a b \cos \left (d x + c\right )^{4} + 2 \, {\left (3 \, b^{2} \cos \left (d x + c\right )^{4} - {\left (5 \, a^{2} + b^{2}\right )} \cos \left (d x + c\right )^{2} - 10 \, a^{2} - 2 \, b^{2}\right )} \sin \left (d x + c\right )}{30 \, d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-1/30*(15*a*b*cos(d*x + c)^4 + 2*(3*b^2*cos(d*x + c)^4 - (5*a^2 + b^2)*cos(d*x + c)^2 - 10*a^2 - 2*b^2)*sin(d*
x + c))/d

________________________________________________________________________________________

giac [A]  time = 0.63, size = 80, normalized size = 1.04 \[ -\frac {6 \, b^{2} \sin \left (d x + c\right )^{5} + 15 \, a b \sin \left (d x + c\right )^{4} + 10 \, a^{2} \sin \left (d x + c\right )^{3} - 10 \, b^{2} \sin \left (d x + c\right )^{3} - 30 \, a b \sin \left (d x + c\right )^{2} - 30 \, a^{2} \sin \left (d x + c\right )}{30 \, d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-1/30*(6*b^2*sin(d*x + c)^5 + 15*a*b*sin(d*x + c)^4 + 10*a^2*sin(d*x + c)^3 - 10*b^2*sin(d*x + c)^3 - 30*a*b*s
in(d*x + c)^2 - 30*a^2*sin(d*x + c))/d

________________________________________________________________________________________

maple [A]  time = 0.20, size = 78, normalized size = 1.01 \[ \frac {b^{2} \left (-\frac {\sin \left (d x +c \right ) \left (\cos ^{4}\left (d x +c \right )\right )}{5}+\frac {\left (2+\cos ^{2}\left (d x +c \right )\right ) \sin \left (d x +c \right )}{15}\right )-\frac {a b \left (\cos ^{4}\left (d x +c \right )\right )}{2}+\frac {a^{2} \left (2+\cos ^{2}\left (d x +c \right )\right ) \sin \left (d x +c \right )}{3}}{d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

1/d*(b^2*(-1/5*sin(d*x+c)*cos(d*x+c)^4+1/15*(2+cos(d*x+c)^2)*sin(d*x+c))-1/2*a*b*cos(d*x+c)^4+1/3*a^2*(2+cos(d
*x+c)^2)*sin(d*x+c))

________________________________________________________________________________________

maxima [A]  time = 0.32, size = 73, normalized size = 0.95 \[ -\frac {6 \, b^{2} \sin \left (d x + c\right )^{5} + 15 \, a b \sin \left (d x + c\right )^{4} - 30 \, a b \sin \left (d x + c\right )^{2} + 10 \, {\left (a^{2} - b^{2}\right )} \sin \left (d x + c\right )^{3} - 30 \, a^{2} \sin \left (d x + c\right )}{30 \, d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-1/30*(6*b^2*sin(d*x + c)^5 + 15*a*b*sin(d*x + c)^4 - 30*a*b*sin(d*x + c)^2 + 10*(a^2 - b^2)*sin(d*x + c)^3 -
30*a^2*sin(d*x + c))/d

________________________________________________________________________________________

mupad [B]  time = 0.05, size = 74, normalized size = 0.96 \[ -\frac {{\sin \left (c+d\,x\right )}^3\,\left (\frac {a^2}{3}-\frac {b^2}{3}\right )-a^2\,\sin \left (c+d\,x\right )+\frac {b^2\,{\sin \left (c+d\,x\right )}^5}{5}-a\,b\,{\sin \left (c+d\,x\right )}^2+\frac {a\,b\,{\sin \left (c+d\,x\right )}^4}{2}}{d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________