\(\int \sin ^3(e+f x) (a+b \sin (e+f x)) \, dx\) [149]

Optimal result
Mathematica [A] (verified)
Rubi [A] (verified)
Maple [A] (verified)
Fricas [A] (verification not implemented)
Sympy [B] (verification not implemented)
Maxima [A] (verification not implemented)
Giac [A] (verification not implemented)
Mupad [B] (verification not implemented)
Reduce [B] (verification not implemented)

Optimal result

Integrand size = 19, antiderivative size = 77 \[ \int \sin ^3(e+f x) (a+b \sin (e+f x)) \, dx=\frac {3 b x}{8}-\frac {a \cos (e+f x)}{f}+\frac {a \cos ^3(e+f x)}{3 f}-\frac {3 b \cos (e+f x) \sin (e+f x)}{8 f}-\frac {b \cos (e+f x) \sin ^3(e+f x)}{4 f} \] Output:

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

Mathematica [A] (verified)

Time = 0.27 (sec) , antiderivative size = 76, normalized size of antiderivative = 0.99 \[ \int \sin ^3(e+f x) (a+b \sin (e+f x)) \, dx=\frac {3 b (e+f x)}{8 f}-\frac {3 a \cos (e+f x)}{4 f}+\frac {a \cos (3 (e+f x))}{12 f}-\frac {b \sin (2 (e+f x))}{4 f}+\frac {b \sin (4 (e+f x))}{32 f} \] Input:

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

Output:

(3*b*(e + f*x))/(8*f) - (3*a*Cos[e + f*x])/(4*f) + (a*Cos[3*(e + f*x)])/(1 
2*f) - (b*Sin[2*(e + f*x)])/(4*f) + (b*Sin[4*(e + f*x)])/(32*f)
 

Rubi [A] (verified)

Time = 0.39 (sec) , antiderivative size = 79, normalized size of antiderivative = 1.03, number of steps used = 10, number of rules used = 9, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.474, Rules used = {3042, 3227, 3042, 3113, 2009, 3115, 3042, 3115, 24}

Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.

\(\displaystyle \int \sin ^3(e+f x) (a+b \sin (e+f x)) \, dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \int \sin (e+f x)^3 (a+b \sin (e+f x))dx\)

\(\Big \downarrow \) 3227

\(\displaystyle a \int \sin ^3(e+f x)dx+b \int \sin ^4(e+f x)dx\)

\(\Big \downarrow \) 3042

\(\displaystyle a \int \sin (e+f x)^3dx+b \int \sin (e+f x)^4dx\)

\(\Big \downarrow \) 3113

\(\displaystyle b \int \sin (e+f x)^4dx-\frac {a \int \left (1-\cos ^2(e+f x)\right )d\cos (e+f x)}{f}\)

\(\Big \downarrow \) 2009

\(\displaystyle b \int \sin (e+f x)^4dx-\frac {a \left (\cos (e+f x)-\frac {1}{3} \cos ^3(e+f x)\right )}{f}\)

\(\Big \downarrow \) 3115

\(\displaystyle b \left (\frac {3}{4} \int \sin ^2(e+f x)dx-\frac {\sin ^3(e+f x) \cos (e+f x)}{4 f}\right )-\frac {a \left (\cos (e+f x)-\frac {1}{3} \cos ^3(e+f x)\right )}{f}\)

\(\Big \downarrow \) 3042

\(\displaystyle b \left (\frac {3}{4} \int \sin (e+f x)^2dx-\frac {\sin ^3(e+f x) \cos (e+f x)}{4 f}\right )-\frac {a \left (\cos (e+f x)-\frac {1}{3} \cos ^3(e+f x)\right )}{f}\)

\(\Big \downarrow \) 3115

\(\displaystyle b \left (\frac {3}{4} \left (\frac {\int 1dx}{2}-\frac {\sin (e+f x) \cos (e+f x)}{2 f}\right )-\frac {\sin ^3(e+f x) \cos (e+f x)}{4 f}\right )-\frac {a \left (\cos (e+f x)-\frac {1}{3} \cos ^3(e+f x)\right )}{f}\)

\(\Big \downarrow \) 24

\(\displaystyle b \left (\frac {3}{4} \left (\frac {x}{2}-\frac {\sin (e+f x) \cos (e+f x)}{2 f}\right )-\frac {\sin ^3(e+f x) \cos (e+f x)}{4 f}\right )-\frac {a \left (\cos (e+f x)-\frac {1}{3} \cos ^3(e+f x)\right )}{f}\)

Input:

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

Output:

-((a*(Cos[e + f*x] - Cos[e + f*x]^3/3))/f) + b*(-1/4*(Cos[e + f*x]*Sin[e + 
 f*x]^3)/f + (3*(x/2 - (Cos[e + f*x]*Sin[e + f*x])/(2*f)))/4)
 

Defintions of rubi rules used

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

rule 2009
Int[u_, x_Symbol] :> Simp[IntSum[u, x], x] /; SumQ[u]
 

rule 3042
Int[u_, x_Symbol] :> Int[DeactivateTrig[u, x], x] /; FunctionOfTrigOfLinear 
Q[u, x]
 

rule 3113
Int[sin[(c_.) + (d_.)*(x_)]^(n_), x_Symbol] :> Simp[-d^(-1)   Subst[Int[Exp 
and[(1 - x^2)^((n - 1)/2), x], x], x, Cos[c + d*x]], x] /; FreeQ[{c, d}, x] 
 && IGtQ[(n - 1)/2, 0]
 

rule 3115
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] + Simp[b^2*((n - 1)/n)   Int[(b*Sin 
[c + d*x])^(n - 2), x], x] /; FreeQ[{b, c, d}, x] && GtQ[n, 1] && IntegerQ[ 
2*n]
 

rule 3227
Int[((b_.)*sin[(e_.) + (f_.)*(x_)])^(m_)*((c_) + (d_.)*sin[(e_.) + (f_.)*(x 
_)]), x_Symbol] :> Simp[c   Int[(b*Sin[e + f*x])^m, x], x] + Simp[d/b   Int 
[(b*Sin[e + f*x])^(m + 1), x], x] /; FreeQ[{b, c, d, e, f, m}, x]
 
Maple [A] (verified)

Time = 2.51 (sec) , antiderivative size = 60, normalized size of antiderivative = 0.78

method result size
derivativedivides \(\frac {b \left (-\frac {\left (\sin \left (f x +e \right )^{3}+\frac {3 \sin \left (f x +e \right )}{2}\right ) \cos \left (f x +e \right )}{4}+\frac {3 f x}{8}+\frac {3 e}{8}\right )-\frac {a \left (2+\sin \left (f x +e \right )^{2}\right ) \cos \left (f x +e \right )}{3}}{f}\) \(60\)
default \(\frac {b \left (-\frac {\left (\sin \left (f x +e \right )^{3}+\frac {3 \sin \left (f x +e \right )}{2}\right ) \cos \left (f x +e \right )}{4}+\frac {3 f x}{8}+\frac {3 e}{8}\right )-\frac {a \left (2+\sin \left (f x +e \right )^{2}\right ) \cos \left (f x +e \right )}{3}}{f}\) \(60\)
parallelrisch \(\frac {36 b x f +3 b \sin \left (4 f x +4 e \right )+8 a \cos \left (3 f x +3 e \right )-24 b \sin \left (2 f x +2 e \right )-72 \cos \left (f x +e \right ) a -64 a}{96 f}\) \(60\)
parts \(-\frac {a \left (2+\sin \left (f x +e \right )^{2}\right ) \cos \left (f x +e \right )}{3 f}+\frac {b \left (-\frac {\left (\sin \left (f x +e \right )^{3}+\frac {3 \sin \left (f x +e \right )}{2}\right ) \cos \left (f x +e \right )}{4}+\frac {3 f x}{8}+\frac {3 e}{8}\right )}{f}\) \(62\)
risch \(\frac {3 b x}{8}-\frac {3 a \cos \left (f x +e \right )}{4 f}+\frac {b \sin \left (4 f x +4 e \right )}{32 f}+\frac {a \cos \left (3 f x +3 e \right )}{12 f}-\frac {b \sin \left (2 f x +2 e \right )}{4 f}\) \(63\)
norman \(\frac {\frac {3 b x}{8}-\frac {4 a}{3 f}-\frac {3 b \tan \left (\frac {f x}{2}+\frac {e}{2}\right )}{4 f}-\frac {11 b \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{3}}{4 f}+\frac {11 b \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{5}}{4 f}+\frac {3 b \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{7}}{4 f}+\frac {3 b x \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{2}}{2}+\frac {9 b x \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{4}}{4}+\frac {3 b x \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{6}}{2}+\frac {3 b x \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{8}}{8}-\frac {4 a \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{4}}{f}-\frac {16 a \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{2}}{3 f}}{\left (1+\tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{2}\right )^{4}}\) \(188\)
orering \(x \sin \left (f x +e \right )^{3} \left (a +b \sin \left (f x +e \right )\right )-\frac {205 \left (3 \sin \left (f x +e \right )^{2} \left (a +b \sin \left (f x +e \right )\right ) f \cos \left (f x +e \right )+\sin \left (f x +e \right )^{3} b f \cos \left (f x +e \right )\right )}{144 f^{2}}+\frac {205 x \left (6 \sin \left (f x +e \right ) \left (a +b \sin \left (f x +e \right )\right ) f^{2} \cos \left (f x +e \right )^{2}+6 \sin \left (f x +e \right )^{2} b \,f^{2} \cos \left (f x +e \right )^{2}-3 \sin \left (f x +e \right )^{3} \left (a +b \sin \left (f x +e \right )\right ) f^{2}-\sin \left (f x +e \right )^{4} b \,f^{2}\right )}{144 f^{2}}-\frac {91 \left (6 f^{3} \cos \left (f x +e \right )^{3} \left (a +b \sin \left (f x +e \right )\right )+18 \sin \left (f x +e \right ) b \,f^{3} \cos \left (f x +e \right )^{3}-21 \sin \left (f x +e \right )^{2} \left (a +b \sin \left (f x +e \right )\right ) f^{3} \cos \left (f x +e \right )-19 \sin \left (f x +e \right )^{3} b \,f^{3} \cos \left (f x +e \right )\right )}{192 f^{4}}+\frac {91 x \left (-60 f^{4} \cos \left (f x +e \right )^{2} \left (a +b \sin \left (f x +e \right )\right ) \sin \left (f x +e \right )+24 \cos \left (f x +e \right )^{4} b \,f^{4}-132 \sin \left (f x +e \right )^{2} \cos \left (f x +e \right )^{2} b \,f^{4}+21 \sin \left (f x +e \right )^{3} \left (a +b \sin \left (f x +e \right )\right ) f^{4}+19 \sin \left (f x +e \right )^{4} b \,f^{4}\right )}{192 f^{4}}-\frac {5 \left (183 f^{5} \cos \left (f x +e \right ) \left (a +b \sin \left (f x +e \right )\right ) \sin \left (f x +e \right )^{2}-420 f^{5} \cos \left (f x +e \right )^{3} b \sin \left (f x +e \right )-60 f^{5} \cos \left (f x +e \right )^{3} \left (a +b \sin \left (f x +e \right )\right )+361 \sin \left (f x +e \right )^{3} \cos \left (f x +e \right ) b \,f^{5}\right )}{96 f^{6}}+\frac {5 x \left (-183 f^{6} \sin \left (f x +e \right )^{3} \left (a +b \sin \left (f x +e \right )\right )+2526 f^{6} \cos \left (f x +e \right )^{2} b \sin \left (f x +e \right )^{2}+546 f^{6} \cos \left (f x +e \right )^{2} \left (a +b \sin \left (f x +e \right )\right ) \sin \left (f x +e \right )-480 f^{6} \cos \left (f x +e \right )^{4} b -361 \sin \left (f x +e \right )^{4} f^{6} b \right )}{96 f^{6}}-\frac {-1641 f^{7} \sin \left (f x +e \right )^{2} \left (a +b \sin \left (f x +e \right )\right ) \cos \left (f x +e \right )-6679 f^{7} \sin \left (f x +e \right )^{3} b \cos \left (f x +e \right )+7518 f^{7} \cos \left (f x +e \right )^{3} b \sin \left (f x +e \right )+546 f^{7} \cos \left (f x +e \right )^{3} \left (a +b \sin \left (f x +e \right )\right )}{576 f^{8}}+\frac {x \left (-4920 f^{8} \sin \left (f x +e \right ) \left (a +b \sin \left (f x +e \right )\right ) \cos \left (f x +e \right )^{2}-44232 f^{8} \sin \left (f x +e \right )^{2} b \cos \left (f x +e \right )^{2}+1641 f^{8} \sin \left (f x +e \right )^{3} \left (a +b \sin \left (f x +e \right )\right )+6679 f^{8} \sin \left (f x +e \right )^{4} b +8064 f^{8} \cos \left (f x +e \right )^{4} b \right )}{576 f^{8}}\) \(788\)

Input:

int(sin(f*x+e)^3*(a+b*sin(f*x+e)),x,method=_RETURNVERBOSE)
 

Output:

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

Fricas [A] (verification not implemented)

Time = 0.08 (sec) , antiderivative size = 60, normalized size of antiderivative = 0.78 \[ \int \sin ^3(e+f x) (a+b \sin (e+f x)) \, dx=\frac {8 \, a \cos \left (f x + e\right )^{3} + 9 \, b f x - 24 \, a \cos \left (f x + e\right ) + 3 \, {\left (2 \, b \cos \left (f x + e\right )^{3} - 5 \, b \cos \left (f x + e\right )\right )} \sin \left (f x + e\right )}{24 \, f} \] Input:

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

Output:

1/24*(8*a*cos(f*x + e)^3 + 9*b*f*x - 24*a*cos(f*x + e) + 3*(2*b*cos(f*x + 
e)^3 - 5*b*cos(f*x + e))*sin(f*x + e))/f
 

Sympy [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 144 vs. \(2 (70) = 140\).

Time = 0.16 (sec) , antiderivative size = 144, normalized size of antiderivative = 1.87 \[ \int \sin ^3(e+f x) (a+b \sin (e+f x)) \, dx=\begin {cases} - \frac {a \sin ^{2}{\left (e + f x \right )} \cos {\left (e + f x \right )}}{f} - \frac {2 a \cos ^{3}{\left (e + f x \right )}}{3 f} + \frac {3 b x \sin ^{4}{\left (e + f x \right )}}{8} + \frac {3 b x \sin ^{2}{\left (e + f x \right )} \cos ^{2}{\left (e + f x \right )}}{4} + \frac {3 b x \cos ^{4}{\left (e + f x \right )}}{8} - \frac {5 b \sin ^{3}{\left (e + f x \right )} \cos {\left (e + f x \right )}}{8 f} - \frac {3 b \sin {\left (e + f x \right )} \cos ^{3}{\left (e + f x \right )}}{8 f} & \text {for}\: f \neq 0 \\x \left (a + b \sin {\left (e \right )}\right ) \sin ^{3}{\left (e \right )} & \text {otherwise} \end {cases} \] Input:

integrate(sin(f*x+e)**3*(a+b*sin(f*x+e)),x)
 

Output:

Piecewise((-a*sin(e + f*x)**2*cos(e + f*x)/f - 2*a*cos(e + f*x)**3/(3*f) + 
 3*b*x*sin(e + f*x)**4/8 + 3*b*x*sin(e + f*x)**2*cos(e + f*x)**2/4 + 3*b*x 
*cos(e + f*x)**4/8 - 5*b*sin(e + f*x)**3*cos(e + f*x)/(8*f) - 3*b*sin(e + 
f*x)*cos(e + f*x)**3/(8*f), Ne(f, 0)), (x*(a + b*sin(e))*sin(e)**3, True))
 

Maxima [A] (verification not implemented)

Time = 0.03 (sec) , antiderivative size = 57, normalized size of antiderivative = 0.74 \[ \int \sin ^3(e+f x) (a+b \sin (e+f x)) \, dx=\frac {32 \, {\left (\cos \left (f x + e\right )^{3} - 3 \, \cos \left (f x + e\right )\right )} a + 3 \, {\left (12 \, f x + 12 \, e + \sin \left (4 \, f x + 4 \, e\right ) - 8 \, \sin \left (2 \, f x + 2 \, e\right )\right )} b}{96 \, f} \] Input:

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

Output:

1/96*(32*(cos(f*x + e)^3 - 3*cos(f*x + e))*a + 3*(12*f*x + 12*e + sin(4*f* 
x + 4*e) - 8*sin(2*f*x + 2*e))*b)/f
 

Giac [A] (verification not implemented)

Time = 0.12 (sec) , antiderivative size = 62, normalized size of antiderivative = 0.81 \[ \int \sin ^3(e+f x) (a+b \sin (e+f x)) \, dx=\frac {3}{8} \, b x + \frac {a \cos \left (3 \, f x + 3 \, e\right )}{12 \, f} - \frac {3 \, a \cos \left (f x + e\right )}{4 \, f} + \frac {b \sin \left (4 \, f x + 4 \, e\right )}{32 \, f} - \frac {b \sin \left (2 \, f x + 2 \, e\right )}{4 \, f} \] Input:

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

Output:

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

Mupad [B] (verification not implemented)

Time = 19.64 (sec) , antiderivative size = 111, normalized size of antiderivative = 1.44 \[ \int \sin ^3(e+f x) (a+b \sin (e+f x)) \, dx=\frac {3\,b\,x}{8}-\frac {-\frac {3\,b\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^7}{4}-\frac {11\,b\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^5}{4}+4\,a\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^4+\frac {11\,b\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^3}{4}+\frac {16\,a\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^2}{3}+\frac {3\,b\,\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}{4}+\frac {4\,a}{3}}{f\,{\left ({\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^2+1\right )}^4} \] Input:

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

Output:

(3*b*x)/8 - ((4*a)/3 + (3*b*tan(e/2 + (f*x)/2))/4 + (16*a*tan(e/2 + (f*x)/ 
2)^2)/3 + 4*a*tan(e/2 + (f*x)/2)^4 + (11*b*tan(e/2 + (f*x)/2)^3)/4 - (11*b 
*tan(e/2 + (f*x)/2)^5)/4 - (3*b*tan(e/2 + (f*x)/2)^7)/4)/(f*(tan(e/2 + (f* 
x)/2)^2 + 1)^4)
 

Reduce [B] (verification not implemented)

Time = 0.17 (sec) , antiderivative size = 72, normalized size of antiderivative = 0.94 \[ \int \sin ^3(e+f x) (a+b \sin (e+f x)) \, dx=\frac {-6 \cos \left (f x +e \right ) \sin \left (f x +e \right )^{3} b -8 \cos \left (f x +e \right ) \sin \left (f x +e \right )^{2} a -9 \cos \left (f x +e \right ) \sin \left (f x +e \right ) b -16 \cos \left (f x +e \right ) a +16 a +9 b f x}{24 f} \] Input:

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

Output:

( - 6*cos(e + f*x)*sin(e + f*x)**3*b - 8*cos(e + f*x)*sin(e + f*x)**2*a - 
9*cos(e + f*x)*sin(e + f*x)*b - 16*cos(e + f*x)*a + 16*a + 9*b*f*x)/(24*f)