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

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

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

Mathematica [A] (verified)

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

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

Output:

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

Rubi [A] (verified)

Time = 0.56 (sec) , antiderivative size = 170, 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 \sin (e+f x)+a) (c+d \sin (e+f x))^3 \, dx\)

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 3232

\(\displaystyle \frac {1}{4} \int (c+d \sin (e+f x))^2 (a (4 c+3 d)+a (3 c+4 d) \sin (e+f x))dx-\frac {a \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 (a (4 c+3 d)+a (3 c+4 d) \sin (e+f x))dx-\frac {a \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 (a \left (12 c^2+15 d c+8 d^2\right )+a \left (6 c^2+20 d c+9 d^2\right ) \sin (e+f x)\right )dx-\frac {a (3 c+4 d) \cos (e+f x) (c+d \sin (e+f x))^2}{3 f}\right )-\frac {a \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 (a \left (12 c^2+15 d c+8 d^2\right )+a \left (6 c^2+20 d c+9 d^2\right ) \sin (e+f x)\right )dx-\frac {a (3 c+4 d) \cos (e+f x) (c+d \sin (e+f x))^2}{3 f}\right )-\frac {a \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 {a d \left (6 c^2+20 c d+9 d^2\right ) \sin (e+f x) \cos (e+f x)}{2 f}-\frac {2 a \left (3 c^3+16 c^2 d+12 c d^2+4 d^3\right ) \cos (e+f x)}{f}+\frac {3}{2} a x \left (8 c^3+12 c^2 d+12 c d^2+3 d^3\right )\right )-\frac {a (3 c+4 d) \cos (e+f x) (c+d \sin (e+f x))^2}{3 f}\right )-\frac {a \cos (e+f x) (c+d \sin (e+f x))^3}{4 f}\)

Input:

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

Output:

-1/4*(a*Cos[e + f*x]*(c + d*Sin[e + f*x])^3)/f + (-1/3*(a*(3*c + 4*d)*Cos[ 
e + f*x]*(c + d*Sin[e + f*x])^2)/f + ((3*a*(8*c^3 + 12*c^2*d + 12*c*d^2 + 
3*d^3)*x)/2 - (2*a*(3*c^3 + 16*c^2*d + 12*c*d^2 + 4*d^3)*Cos[e + f*x])/f - 
 (a*d*(6*c^2 + 20*c*d + 9*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 = 12.78 (sec) , antiderivative size = 140, normalized size of antiderivative = 0.86

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

Input:

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

Output:

1/32*a*((-24*c^2*d-24*c*d^2-8*d^3)*sin(2*f*x+2*e)+8*d^2*(c+1/3*d)*cos(3*f* 
x+3*e)+d^3*sin(4*f*x+4*e)+(-32*c^3-96*c^2*d-72*c*d^2-24*d^3)*cos(f*x+e)+(1 
2*f*x-64/3)*d^3+(48*f*x-64)*c*d^2+48*c^2*(f*x-2)*d+32*c^3*(f*x-1))/f
 

Fricas [A] (verification not implemented)

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

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

Output:

1/24*(8*(3*a*c*d^2 + a*d^3)*cos(f*x + e)^3 + 3*(8*a*c^3 + 12*a*c^2*d + 12* 
a*c*d^2 + 3*a*d^3)*f*x - 24*(a*c^3 + 3*a*c^2*d + 3*a*c*d^2 + a*d^3)*cos(f* 
x + e) + 3*(2*a*d^3*cos(f*x + e)^3 - (12*a*c^2*d + 12*a*c*d^2 + 5*a*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 (153) = 306\).

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

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

Output:

Piecewise((a*c**3*x - a*c**3*cos(e + f*x)/f + 3*a*c**2*d*x*sin(e + f*x)**2 
/2 + 3*a*c**2*d*x*cos(e + f*x)**2/2 - 3*a*c**2*d*sin(e + f*x)*cos(e + f*x) 
/(2*f) - 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)**2*cos(e + f*x)/f - 3 
*a*c*d**2*sin(e + f*x)*cos(e + f*x)/(2*f) - 2*a*c*d**2*cos(e + f*x)**3/f + 
 3*a*d**3*x*sin(e + f*x)**4/8 + 3*a*d**3*x*sin(e + f*x)**2*cos(e + f*x)**2 
/4 + 3*a*d**3*x*cos(e + f*x)**4/8 - 5*a*d**3*sin(e + f*x)**3*cos(e + f*x)/ 
(8*f) - a*d**3*sin(e + f*x)**2*cos(e + f*x)/f - 3*a*d**3*sin(e + f*x)*cos( 
e + f*x)**3/(8*f) - 2*a*d**3*cos(e + f*x)**3/(3*f), Ne(f, 0)), (x*(c + d*s 
in(e))**3*(a*sin(e) + a), True))
 

Maxima [A] (verification not implemented)

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

integrate((a+a*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))*a*c^2*d + 9 
6*(cos(f*x + e)^3 - 3*cos(f*x + e))*a*c*d^2 + 72*(2*f*x + 2*e - sin(2*f*x 
+ 2*e))*a*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))*a*d^3 - 96*a*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 = 184, normalized size of antiderivative = 1.14 \[ \int (a+a \sin (e+f x)) (c+d \sin (e+f x))^3 \, dx=\frac {a c d^{2} \cos \left (3 \, f x + 3 \, e\right )}{4 \, f} + \frac {a d^{3} \cos \left (3 \, f x + 3 \, e\right )}{12 \, f} + \frac {a d^{3} \sin \left (4 \, f x + 4 \, e\right )}{32 \, f} - \frac {3 \, a c d^{2} \sin \left (2 \, f x + 2 \, e\right )}{4 \, f} + \frac {1}{2} \, {\left (2 \, a c^{3} + 3 \, a c d^{2}\right )} x + \frac {3}{8} \, {\left (4 \, a c^{2} d + a d^{3}\right )} x - \frac {{\left (4 \, a c^{3} + 9 \, a c d^{2}\right )} \cos \left (f x + e\right )}{4 \, f} - \frac {3 \, {\left (4 \, a c^{2} d + a d^{3}\right )} \cos \left (f x + e\right )}{4 \, f} - \frac {{\left (3 \, a c^{2} d + a d^{3}\right )} \sin \left (2 \, f x + 2 \, e\right )}{4 \, f} \] Input:

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

Output:

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

Mupad [B] (verification not implemented)

Time = 17.33 (sec) , antiderivative size = 460, normalized size of antiderivative = 2.84 \[ \int (a+a \sin (e+f x)) (c+d \sin (e+f x))^3 \, dx=\frac {a\,\mathrm {atan}\left (\frac {a\,\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )\,\left (8\,c^3+12\,c^2\,d+12\,c\,d^2+3\,d^3\right )}{4\,\left (2\,a\,c^3+3\,a\,c^2\,d+3\,a\,c\,d^2+\frac {3\,a\,d^3}{4}\right )}\right )\,\left (8\,c^3+12\,c^2\,d+12\,c\,d^2+3\,d^3\right )}{4\,f}-\frac {a\,\left (\mathrm {atan}\left (\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )\right )-\frac {f\,x}{2}\right )\,\left (8\,c^3+12\,c^2\,d+12\,c\,d^2+3\,d^3\right )}{4\,f}-\frac {{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^3\,\left (3\,a\,c^2\,d+3\,a\,c\,d^2+\frac {11\,a\,d^3}{4}\right )-{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^7\,\left (3\,a\,c^2\,d+3\,a\,c\,d^2+\frac {3\,a\,d^3}{4}\right )-{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^5\,\left (3\,a\,c^2\,d+3\,a\,c\,d^2+\frac {11\,a\,d^3}{4}\right )+{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^6\,\left (2\,a\,c^3+6\,a\,d\,c^2\right )+2\,a\,c^3+\frac {4\,a\,d^3}{3}+{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^4\,\left (6\,a\,c^3+18\,a\,c^2\,d+12\,a\,c\,d^2+4\,a\,d^3\right )+{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^2\,\left (6\,a\,c^3+18\,a\,c^2\,d+16\,a\,c\,d^2+\frac {16\,a\,d^3}{3}\right )+\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )\,\left (3\,a\,c^2\,d+3\,a\,c\,d^2+\frac {3\,a\,d^3}{4}\right )+4\,a\,c\,d^2+6\,a\,c^2\,d}{f\,\left ({\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^8+4\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^6+6\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^4+4\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^2+1\right )} \] Input:

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

Output:

(a*atan((a*tan(e/2 + (f*x)/2)*(12*c*d^2 + 12*c^2*d + 8*c^3 + 3*d^3))/(4*(2 
*a*c^3 + (3*a*d^3)/4 + 3*a*c*d^2 + 3*a*c^2*d)))*(12*c*d^2 + 12*c^2*d + 8*c 
^3 + 3*d^3))/(4*f) - (a*(atan(tan(e/2 + (f*x)/2)) - (f*x)/2)*(12*c*d^2 + 1 
2*c^2*d + 8*c^3 + 3*d^3))/(4*f) - (tan(e/2 + (f*x)/2)^3*((11*a*d^3)/4 + 3* 
a*c*d^2 + 3*a*c^2*d) - tan(e/2 + (f*x)/2)^7*((3*a*d^3)/4 + 3*a*c*d^2 + 3*a 
*c^2*d) - tan(e/2 + (f*x)/2)^5*((11*a*d^3)/4 + 3*a*c*d^2 + 3*a*c^2*d) + ta 
n(e/2 + (f*x)/2)^6*(2*a*c^3 + 6*a*c^2*d) + 2*a*c^3 + (4*a*d^3)/3 + tan(e/2 
 + (f*x)/2)^4*(6*a*c^3 + 4*a*d^3 + 12*a*c*d^2 + 18*a*c^2*d) + tan(e/2 + (f 
*x)/2)^2*(6*a*c^3 + (16*a*d^3)/3 + 16*a*c*d^2 + 18*a*c^2*d) + tan(e/2 + (f 
*x)/2)*((3*a*d^3)/4 + 3*a*c*d^2 + 3*a*c^2*d) + 4*a*c*d^2 + 6*a*c^2*d)/(f*( 
4*tan(e/2 + (f*x)/2)^2 + 6*tan(e/2 + (f*x)/2)^4 + 4*tan(e/2 + (f*x)/2)^6 + 
 tan(e/2 + (f*x)/2)^8 + 1))
 

Reduce [B] (verification not implemented)

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

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

Output:

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