3.1 \(\int \sin ^3(x) (a \cos (x)+b \sin (x)) \, dx\)

Optimal. Leaf size=36 \[ \frac {1}{4} a \sin ^4(x)+\frac {3 b x}{8}-\frac {1}{4} b \sin ^3(x) \cos (x)-\frac {3}{8} b \sin (x) \cos (x) \]

[Out]

3/8*b*x-3/8*b*cos(x)*sin(x)-1/4*b*cos(x)*sin(x)^3+1/4*a*sin(x)^4

________________________________________________________________________________________

Rubi [A]  time = 0.05, antiderivative size = 36, normalized size of antiderivative = 1.00, number of steps used = 7, number of rules used = 5, integrand size = 14, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.357, Rules used = {3089, 2564, 30, 2635, 8} \[ \frac {1}{4} a \sin ^4(x)+\frac {3 b x}{8}-\frac {1}{4} b \sin ^3(x) \cos (x)-\frac {3}{8} b \sin (x) \cos (x) \]

Antiderivative was successfully verified.

[In]

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

[Out]

(3*b*x)/8 - (3*b*Cos[x]*Sin[x])/8 - (b*Cos[x]*Sin[x]^3)/4 + (a*Sin[x]^4)/4

Rule 8

Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]

Rule 30

Int[(x_)^(m_.), x_Symbol] :> Simp[x^(m + 1)/(m + 1), x] /; FreeQ[m, x] && NeQ[m, -1]

Rule 2564

Int[cos[(e_.) + (f_.)*(x_)]^(n_.)*((a_.)*sin[(e_.) + (f_.)*(x_)])^(m_.), x_Symbol] :> Dist[1/(a*f), Subst[Int[
x^m*(1 - x^2/a^2)^((n - 1)/2), x], x, a*Sin[e + f*x]], x] /; FreeQ[{a, e, f, m}, x] && IntegerQ[(n - 1)/2] &&
 !(IntegerQ[(m - 1)/2] && LtQ[0, m, n])

Rule 2635

Int[((b_.)*sin[(c_.) + (d_.)*(x_)])^(n_), x_Symbol] :> -Simp[(b*Cos[c + d*x]*(b*Sin[c + d*x])^(n - 1))/(d*n),
x] + Dist[(b^2*(n - 1))/n, Int[(b*Sin[c + d*x])^(n - 2), x], x] /; FreeQ[{b, c, d}, x] && GtQ[n, 1] && Integer
Q[2*n]

Rule 3089

Int[sin[(c_.) + (d_.)*(x_)]^(m_.)*(cos[(c_.) + (d_.)*(x_)]*(a_.) + (b_.)*sin[(c_.) + (d_.)*(x_)])^(n_.), x_Sym
bol] :> Int[ExpandTrig[sin[c + d*x]^m*(a*cos[c + d*x] + b*sin[c + d*x])^n, x], x] /; FreeQ[{a, b, c, d}, x] &&
 IntegerQ[m] && IGtQ[n, 0]

Rubi steps

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

________________________________________________________________________________________

Mathematica [A]  time = 0.01, size = 34, normalized size = 0.94 \[ \frac {1}{4} a \sin ^4(x)+\frac {3 b x}{8}-\frac {1}{4} b \sin (2 x)+\frac {1}{32} b \sin (4 x) \]

Antiderivative was successfully verified.

[In]

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

[Out]

(3*b*x)/8 + (a*Sin[x]^4)/4 - (b*Sin[2*x])/4 + (b*Sin[4*x])/32

________________________________________________________________________________________

fricas [A]  time = 0.42, size = 36, normalized size = 1.00 \[ \frac {1}{4} \, a \cos \relax (x)^{4} - \frac {1}{2} \, a \cos \relax (x)^{2} + \frac {3}{8} \, b x + \frac {1}{8} \, {\left (2 \, b \cos \relax (x)^{3} - 5 \, b \cos \relax (x)\right )} \sin \relax (x) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

giac [A]  time = 2.73, size = 33, normalized size = 0.92 \[ \frac {3}{8} \, b x + \frac {1}{32} \, a \cos \left (4 \, x\right ) - \frac {1}{8} \, a \cos \left (2 \, x\right ) + \frac {1}{32} \, b \sin \left (4 \, x\right ) - \frac {1}{4} \, b \sin \left (2 \, x\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

3/8*b*x + 1/32*a*cos(4*x) - 1/8*a*cos(2*x) + 1/32*b*sin(4*x) - 1/4*b*sin(2*x)

________________________________________________________________________________________

maple [A]  time = 0.84, size = 28, normalized size = 0.78 \[ b \left (-\frac {\left (\sin ^{3}\relax (x )+\frac {3 \sin \relax (x )}{2}\right ) \cos \relax (x )}{4}+\frac {3 x}{8}\right )+\frac {a \left (\sin ^{4}\relax (x )\right )}{4} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

b*(-1/4*(sin(x)^3+3/2*sin(x))*cos(x)+3/8*x)+1/4*a*sin(x)^4

________________________________________________________________________________________

maxima [A]  time = 0.31, size = 25, normalized size = 0.69 \[ \frac {1}{4} \, a \sin \relax (x)^{4} + \frac {1}{32} \, b {\left (12 \, x + \sin \left (4 \, x\right ) - 8 \, \sin \left (2 \, x\right )\right )} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

1/4*a*sin(x)^4 + 1/32*b*(12*x + sin(4*x) - 8*sin(2*x))

________________________________________________________________________________________

mupad [B]  time = 0.53, size = 35, normalized size = 0.97 \[ \frac {a\,{\cos \relax (x)}^4}{4}+\frac {b\,\sin \relax (x)\,{\cos \relax (x)}^3}{4}-\frac {a\,{\cos \relax (x)}^2}{2}-\frac {5\,b\,\sin \relax (x)\,\cos \relax (x)}{8}+\frac {3\,b\,x}{8} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

(3*b*x)/8 - (a*cos(x)^2)/2 + (a*cos(x)^4)/4 - (5*b*cos(x)*sin(x))/8 + (b*cos(x)^3*sin(x))/4

________________________________________________________________________________________

sympy [B]  time = 0.53, size = 75, normalized size = 2.08 \[ \frac {a \sin ^{4}{\relax (x )}}{4} + \frac {3 b x \sin ^{4}{\relax (x )}}{8} + \frac {3 b x \sin ^{2}{\relax (x )} \cos ^{2}{\relax (x )}}{4} + \frac {3 b x \cos ^{4}{\relax (x )}}{8} - \frac {5 b \sin ^{3}{\relax (x )} \cos {\relax (x )}}{8} - \frac {3 b \sin {\relax (x )} \cos ^{3}{\relax (x )}}{8} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

a*sin(x)**4/4 + 3*b*x*sin(x)**4/8 + 3*b*x*sin(x)**2*cos(x)**2/4 + 3*b*x*cos(x)**4/8 - 5*b*sin(x)**3*cos(x)/8 -
 3*b*sin(x)*cos(x)**3/8

________________________________________________________________________________________