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

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 = 23, antiderivative size = 171 \[ \int (a+b \sin (e+f x)) (c+d \sin (e+f x))^3 \, dx=\frac {1}{8} \left (8 a c^3+12 b c^2 d+12 a c d^2+3 b d^3\right ) x-\frac {\left (4 a d \left (4 c^2+d^2\right )+3 b \left (c^3+4 c d^2\right )\right ) \cos (e+f x)}{6 f}-\frac {d \left (6 b c^2+20 a c d+9 b d^2\right ) \cos (e+f x) \sin (e+f x)}{24 f}-\frac {(3 b c+4 a d) \cos (e+f x) (c+d \sin (e+f x))^2}{12 f}-\frac {b \cos (e+f x) (c+d \sin (e+f x))^3}{4 f} \] Output:

1/8*(8*a*c^3+12*a*c*d^2+12*b*c^2*d+3*b*d^3)*x-1/6*(4*a*d*(4*c^2+d^2)+3*b*( 
c^3+4*c*d^2))*cos(f*x+e)/f-1/24*d*(20*a*c*d+6*b*c^2+9*b*d^2)*cos(f*x+e)*si 
n(f*x+e)/f-1/12*(4*a*d+3*b*c)*cos(f*x+e)*(c+d*sin(f*x+e))^2/f-1/4*b*cos(f* 
x+e)*(c+d*sin(f*x+e))^3/f
 

Mathematica [A] (verified)

Time = 1.77 (sec) , antiderivative size = 143, normalized size of antiderivative = 0.84 \[ \int (a+b \sin (e+f x)) (c+d \sin (e+f x))^3 \, dx=\frac {-24 \left (3 a d \left (4 c^2+d^2\right )+b \left (4 c^3+9 c d^2\right )\right ) \cos (e+f x)+8 d^2 (3 b c+a d) \cos (3 (e+f x))+3 \left (4 \left (8 a c^3+12 b c^2 d+12 a c d^2+3 b d^3\right ) (e+f x)-8 d \left (3 a c d+b \left (3 c^2+d^2\right )\right ) \sin (2 (e+f x))+b d^3 \sin (4 (e+f x))\right )}{96 f} \] Input:

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

Output:

(-24*(3*a*d*(4*c^2 + d^2) + b*(4*c^3 + 9*c*d^2))*Cos[e + f*x] + 8*d^2*(3*b 
*c + a*d)*Cos[3*(e + f*x)] + 3*(4*(8*a*c^3 + 12*b*c^2*d + 12*a*c*d^2 + 3*b 
*d^3)*(e + f*x) - 8*d*(3*a*c*d + b*(3*c^2 + d^2))*Sin[2*(e + f*x)] + b*d^3 
*Sin[4*(e + f*x)]))/(96*f)
 

Rubi [A] (verified)

Time = 0.58 (sec) , antiderivative size = 179, normalized size of antiderivative = 1.05, number of steps used = 6, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.261, Rules used = {3042, 3232, 3042, 3232, 3042, 3213}

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 (a+b \sin (e+f x)) (c+d \sin (e+f x))^3 \, dx\)

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 3232

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

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 3232

\(\displaystyle \frac {1}{4} \left (\frac {1}{3} \int (c+d \sin (e+f x)) \left (12 a c^2+15 b d c+8 a d^2+\left (6 b c^2+20 a d c+9 b d^2\right ) \sin (e+f x)\right )dx-\frac {(4 a d+3 b c) \cos (e+f x) (c+d \sin (e+f x))^2}{3 f}\right )-\frac {b \cos (e+f x) (c+d \sin (e+f x))^3}{4 f}\)

\(\Big \downarrow \) 3042

\(\displaystyle \frac {1}{4} \left (\frac {1}{3} \int (c+d \sin (e+f x)) \left (12 a c^2+15 b d c+8 a d^2+\left (6 b c^2+20 a d c+9 b d^2\right ) \sin (e+f x)\right )dx-\frac {(4 a d+3 b c) \cos (e+f x) (c+d \sin (e+f x))^2}{3 f}\right )-\frac {b \cos (e+f x) (c+d \sin (e+f x))^3}{4 f}\)

\(\Big \downarrow \) 3213

\(\displaystyle \frac {1}{4} \left (\frac {1}{3} \left (-\frac {d \left (20 a c d+6 b c^2+9 b d^2\right ) \sin (e+f x) \cos (e+f x)}{2 f}-\frac {2 \left (4 a d \left (4 c^2+d^2\right )+3 b \left (c^3+4 c d^2\right )\right ) \cos (e+f x)}{f}+\frac {3}{2} x \left (8 a c^3+12 a c d^2+12 b c^2 d+3 b d^3\right )\right )-\frac {(4 a d+3 b c) \cos (e+f x) (c+d \sin (e+f x))^2}{3 f}\right )-\frac {b \cos (e+f x) (c+d \sin (e+f x))^3}{4 f}\)

Input:

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

Output:

-1/4*(b*Cos[e + f*x]*(c + d*Sin[e + f*x])^3)/f + (-1/3*((3*b*c + 4*a*d)*Co 
s[e + f*x]*(c + d*Sin[e + f*x])^2)/f + ((3*(8*a*c^3 + 12*b*c^2*d + 12*a*c* 
d^2 + 3*b*d^3)*x)/2 - (2*(4*a*d*(4*c^2 + d^2) + 3*b*(c^3 + 4*c*d^2))*Cos[e 
 + f*x])/f - (d*(6*b*c^2 + 20*a*c*d + 9*b*d^2)*Cos[e + f*x]*Sin[e + f*x])/ 
(2*f))/3)/4
 

Defintions of rubi rules used

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

rule 3213
Int[((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])*((c_.) + (d_.)*sin[(e_.) + (f_.) 
*(x_)]), x_Symbol] :> Simp[(2*a*c + b*d)*(x/2), x] + (-Simp[(b*c + a*d)*(Co 
s[e + f*x]/f), x] - Simp[b*d*Cos[e + f*x]*(Sin[e + f*x]/(2*f)), x]) /; Free 
Q[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d, 0]
 

rule 3232
Int[((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*sin[(e_.) + 
(f_.)*(x_)]), x_Symbol] :> Simp[(-d)*Cos[e + f*x]*((a + b*Sin[e + f*x])^m/( 
f*(m + 1))), x] + Simp[1/(m + 1)   Int[(a + b*Sin[e + f*x])^(m - 1)*Simp[b* 
d*m + a*c*(m + 1) + (a*d*m + b*c*(m + 1))*Sin[e + f*x], x], x], x] /; FreeQ 
[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d, 0] && NeQ[a^2 - b^2, 0] && GtQ[m, 
 0] && IntegerQ[2*m]
 
Maple [A] (verified)

Time = 24.22 (sec) , antiderivative size = 148, normalized size of antiderivative = 0.87

method result size
parts \(a \,c^{3} x -\frac {\left (a \,d^{3}+3 b c \,d^{2}\right ) \left (2+\sin \left (f x +e \right )^{2}\right ) \cos \left (f x +e \right )}{3 f}+\frac {\left (3 a c \,d^{2}+3 b \,c^{2} d \right ) \left (-\frac {\sin \left (f x +e \right ) \cos \left (f x +e \right )}{2}+\frac {f x}{2}+\frac {e}{2}\right )}{f}-\frac {\left (3 a d \,c^{2}+b \,c^{3}\right ) \cos \left (f x +e \right )}{f}+\frac {b \,d^{3} \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}\) \(148\)
parallelrisch \(\frac {\left (-72 a c \,d^{2}-72 b \,c^{2} d -24 b \,d^{3}\right ) \sin \left (2 f x +2 e \right )+\left (8 a \,d^{3}+24 b c \,d^{2}\right ) \cos \left (3 f x +3 e \right )+3 b \,d^{3} \sin \left (4 f x +4 e \right )+\left (-288 a d \,c^{2}-72 a \,d^{3}-96 b \,c^{3}-216 b c \,d^{2}\right ) \cos \left (f x +e \right )+\left (36 b f x -64 a \right ) d^{3}+144 c \left (a f x -\frac {4 b}{3}\right ) d^{2}-288 c^{2} \left (-\frac {b f x}{2}+a \right ) d +96 c^{3} \left (a f x -b \right )}{96 f}\) \(164\)
derivativedivides \(\frac {a \,c^{3} \left (f x +e \right )-3 a d \,c^{2} \cos \left (f x +e \right )+3 a c \,d^{2} \left (-\frac {\sin \left (f x +e \right ) \cos \left (f x +e \right )}{2}+\frac {f x}{2}+\frac {e}{2}\right )-\frac {a \,d^{3} \left (2+\sin \left (f x +e \right )^{2}\right ) \cos \left (f x +e \right )}{3}-b \,c^{3} \cos \left (f x +e \right )+3 b \,c^{2} d \left (-\frac {\sin \left (f x +e \right ) \cos \left (f x +e \right )}{2}+\frac {f x}{2}+\frac {e}{2}\right )-b c \,d^{2} \left (2+\sin \left (f x +e \right )^{2}\right ) \cos \left (f x +e \right )+b \,d^{3} \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}\) \(182\)
default \(\frac {a \,c^{3} \left (f x +e \right )-3 a d \,c^{2} \cos \left (f x +e \right )+3 a c \,d^{2} \left (-\frac {\sin \left (f x +e \right ) \cos \left (f x +e \right )}{2}+\frac {f x}{2}+\frac {e}{2}\right )-\frac {a \,d^{3} \left (2+\sin \left (f x +e \right )^{2}\right ) \cos \left (f x +e \right )}{3}-b \,c^{3} \cos \left (f x +e \right )+3 b \,c^{2} d \left (-\frac {\sin \left (f x +e \right ) \cos \left (f x +e \right )}{2}+\frac {f x}{2}+\frac {e}{2}\right )-b c \,d^{2} \left (2+\sin \left (f x +e \right )^{2}\right ) \cos \left (f x +e \right )+b \,d^{3} \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}\) \(182\)
risch \(a \,c^{3} x +\frac {3 x a c \,d^{2}}{2}+\frac {3 x b \,c^{2} d}{2}+\frac {3 x b \,d^{3}}{8}-\frac {3 \cos \left (f x +e \right ) a d \,c^{2}}{f}-\frac {3 \cos \left (f x +e \right ) a \,d^{3}}{4 f}-\frac {\cos \left (f x +e \right ) b \,c^{3}}{f}-\frac {9 \cos \left (f x +e \right ) b c \,d^{2}}{4 f}+\frac {b \,d^{3} \sin \left (4 f x +4 e \right )}{32 f}+\frac {d^{3} \cos \left (3 f x +3 e \right ) a}{12 f}+\frac {d^{2} \cos \left (3 f x +3 e \right ) b c}{4 f}-\frac {3 \sin \left (2 f x +2 e \right ) a c \,d^{2}}{4 f}-\frac {3 \sin \left (2 f x +2 e \right ) b \,c^{2} d}{4 f}-\frac {\sin \left (2 f x +2 e \right ) b \,d^{3}}{4 f}\) \(204\)
norman \(\frac {\left (a \,c^{3}+\frac {3}{2} a c \,d^{2}+\frac {3}{2} b \,c^{2} d +\frac {3}{8} b \,d^{3}\right ) x +\left (a \,c^{3}+\frac {3}{2} a c \,d^{2}+\frac {3}{2} b \,c^{2} d +\frac {3}{8} b \,d^{3}\right ) x \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{8}+\left (4 a \,c^{3}+6 a c \,d^{2}+6 b \,c^{2} d +\frac {3}{2} b \,d^{3}\right ) x \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{2}+\left (4 a \,c^{3}+6 a c \,d^{2}+6 b \,c^{2} d +\frac {3}{2} b \,d^{3}\right ) x \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{6}+\left (6 a \,c^{3}+9 a c \,d^{2}+9 b \,c^{2} d +\frac {9}{4} b \,d^{3}\right ) x \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{4}-\frac {18 a d \,c^{2}+4 a \,d^{3}+6 b \,c^{3}+12 b c \,d^{2}}{3 f}-\frac {2 \left (3 a d \,c^{2}+b \,c^{3}\right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{6}}{f}-\frac {2 \left (9 a d \,c^{2}+2 a \,d^{3}+3 b \,c^{3}+6 b c \,d^{2}\right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{4}}{f}-\frac {2 \left (27 a d \,c^{2}+8 a \,d^{3}+9 b \,c^{3}+24 b c \,d^{2}\right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{2}}{3 f}-\frac {3 d \left (4 a c d +4 b \,c^{2}+b \,d^{2}\right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )}{4 f}+\frac {3 d \left (4 a c d +4 b \,c^{2}+b \,d^{2}\right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{7}}{4 f}-\frac {d \left (12 a c d +12 b \,c^{2}+11 b \,d^{2}\right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{3}}{4 f}+\frac {d \left (12 a c d +12 b \,c^{2}+11 b \,d^{2}\right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{5}}{4 f}}{\left (1+\tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{2}\right )^{4}}\) \(488\)

Input:

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

Output:

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

Fricas [A] (verification not implemented)

Time = 0.09 (sec) , antiderivative size = 145, normalized size of antiderivative = 0.85 \[ \int (a+b \sin (e+f x)) (c+d \sin (e+f x))^3 \, dx=\frac {8 \, {\left (3 \, b c d^{2} + a d^{3}\right )} \cos \left (f x + e\right )^{3} + 3 \, {\left (8 \, a c^{3} + 12 \, b c^{2} d + 12 \, a c d^{2} + 3 \, b d^{3}\right )} f x - 24 \, {\left (b c^{3} + 3 \, a c^{2} d + 3 \, b c d^{2} + a d^{3}\right )} \cos \left (f x + e\right ) + 3 \, {\left (2 \, b d^{3} \cos \left (f x + e\right )^{3} - {\left (12 \, b c^{2} d + 12 \, a c d^{2} + 5 \, b d^{3}\right )} \cos \left (f x + e\right )\right )} \sin \left (f x + e\right )}{24 \, f} \] Input:

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

Output:

1/24*(8*(3*b*c*d^2 + a*d^3)*cos(f*x + e)^3 + 3*(8*a*c^3 + 12*b*c^2*d + 12* 
a*c*d^2 + 3*b*d^3)*f*x - 24*(b*c^3 + 3*a*c^2*d + 3*b*c*d^2 + a*d^3)*cos(f* 
x + e) + 3*(2*b*d^3*cos(f*x + e)^3 - (12*b*c^2*d + 12*a*c*d^2 + 5*b*d^3)*c 
os(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. 386 vs. \(2 (165) = 330\).

Time = 0.23 (sec) , antiderivative size = 386, normalized size of antiderivative = 2.26 \[ \int (a+b \sin (e+f x)) (c+d \sin (e+f x))^3 \, dx=\begin {cases} a c^{3} x - \frac {3 a c^{2} d \cos {\left (e + f x \right )}}{f} + \frac {3 a c d^{2} x \sin ^{2}{\left (e + f x \right )}}{2} + \frac {3 a c d^{2} x \cos ^{2}{\left (e + f x \right )}}{2} - \frac {3 a c d^{2} \sin {\left (e + f x \right )} \cos {\left (e + f x \right )}}{2 f} - \frac {a d^{3} \sin ^{2}{\left (e + f x \right )} \cos {\left (e + f x \right )}}{f} - \frac {2 a d^{3} \cos ^{3}{\left (e + f x \right )}}{3 f} - \frac {b c^{3} \cos {\left (e + f x \right )}}{f} + \frac {3 b c^{2} d x \sin ^{2}{\left (e + f x \right )}}{2} + \frac {3 b c^{2} d x \cos ^{2}{\left (e + f x \right )}}{2} - \frac {3 b c^{2} d \sin {\left (e + f x \right )} \cos {\left (e + f x \right )}}{2 f} - \frac {3 b c d^{2} \sin ^{2}{\left (e + f x \right )} \cos {\left (e + f x \right )}}{f} - \frac {2 b c d^{2} \cos ^{3}{\left (e + f x \right )}}{f} + \frac {3 b d^{3} x \sin ^{4}{\left (e + f x \right )}}{8} + \frac {3 b d^{3} x \sin ^{2}{\left (e + f x \right )} \cos ^{2}{\left (e + f x \right )}}{4} + \frac {3 b d^{3} x \cos ^{4}{\left (e + f x \right )}}{8} - \frac {5 b d^{3} \sin ^{3}{\left (e + f x \right )} \cos {\left (e + f x \right )}}{8 f} - \frac {3 b d^{3} \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 ) \left (c + d \sin {\left (e \right )}\right )^{3} & \text {otherwise} \end {cases} \] Input:

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

Output:

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

Maxima [A] (verification not implemented)

Time = 0.04 (sec) , antiderivative size = 175, normalized size of antiderivative = 1.02 \[ \int (a+b \sin (e+f x)) (c+d \sin (e+f x))^3 \, dx=\frac {96 \, {\left (f x + e\right )} a c^{3} + 72 \, {\left (2 \, f x + 2 \, e - \sin \left (2 \, f x + 2 \, e\right )\right )} b c^{2} d + 72 \, {\left (2 \, f x + 2 \, e - \sin \left (2 \, f x + 2 \, e\right )\right )} a c d^{2} + 96 \, {\left (\cos \left (f x + e\right )^{3} - 3 \, \cos \left (f x + e\right )\right )} b c d^{2} + 32 \, {\left (\cos \left (f x + e\right )^{3} - 3 \, \cos \left (f x + e\right )\right )} a d^{3} + 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 d^{3} - 96 \, b c^{3} \cos \left (f x + e\right ) - 288 \, a c^{2} d \cos \left (f x + e\right )}{96 \, f} \] Input:

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

Output:

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

Giac [A] (verification not implemented)

Time = 0.13 (sec) , antiderivative size = 148, normalized size of antiderivative = 0.87 \[ \int (a+b \sin (e+f x)) (c+d \sin (e+f x))^3 \, dx=\frac {b d^{3} \sin \left (4 \, f x + 4 \, e\right )}{32 \, f} + \frac {1}{8} \, {\left (8 \, a c^{3} + 12 \, b c^{2} d + 12 \, a c d^{2} + 3 \, b d^{3}\right )} x + \frac {{\left (3 \, b c d^{2} + a d^{3}\right )} \cos \left (3 \, f x + 3 \, e\right )}{12 \, f} - \frac {{\left (4 \, b c^{3} + 12 \, a c^{2} d + 9 \, b c d^{2} + 3 \, a d^{3}\right )} \cos \left (f x + e\right )}{4 \, f} - \frac {{\left (3 \, b c^{2} d + 3 \, a c d^{2} + b d^{3}\right )} \sin \left (2 \, f x + 2 \, e\right )}{4 \, f} \] Input:

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

Output:

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

Mupad [B] (verification not implemented)

Time = 17.81 (sec) , antiderivative size = 183, normalized size of antiderivative = 1.07 \[ \int (a+b \sin (e+f x)) (c+d \sin (e+f x))^3 \, dx=\frac {2\,a\,d^3\,\cos \left (3\,e+3\,f\,x\right )-6\,b\,d^3\,\sin \left (2\,e+2\,f\,x\right )+\frac {3\,b\,d^3\,\sin \left (4\,e+4\,f\,x\right )}{4}-18\,a\,d^3\,\cos \left (e+f\,x\right )-24\,b\,c^3\,\cos \left (e+f\,x\right )-72\,a\,c^2\,d\,\cos \left (e+f\,x\right )-54\,b\,c\,d^2\,\cos \left (e+f\,x\right )+24\,a\,c^3\,f\,x+9\,b\,d^3\,f\,x+6\,b\,c\,d^2\,\cos \left (3\,e+3\,f\,x\right )-18\,a\,c\,d^2\,\sin \left (2\,e+2\,f\,x\right )-18\,b\,c^2\,d\,\sin \left (2\,e+2\,f\,x\right )+36\,a\,c\,d^2\,f\,x+36\,b\,c^2\,d\,f\,x}{24\,f} \] Input:

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

Output:

(2*a*d^3*cos(3*e + 3*f*x) - 6*b*d^3*sin(2*e + 2*f*x) + (3*b*d^3*sin(4*e + 
4*f*x))/4 - 18*a*d^3*cos(e + f*x) - 24*b*c^3*cos(e + f*x) - 72*a*c^2*d*cos 
(e + f*x) - 54*b*c*d^2*cos(e + f*x) + 24*a*c^3*f*x + 9*b*d^3*f*x + 6*b*c*d 
^2*cos(3*e + 3*f*x) - 18*a*c*d^2*sin(2*e + 2*f*x) - 18*b*c^2*d*sin(2*e + 2 
*f*x) + 36*a*c*d^2*f*x + 36*b*c^2*d*f*x)/(24*f)
 

Reduce [B] (verification not implemented)

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

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

Output:

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