\(\int (a+a \sin (e+f x))^3 (A+B \sin (e+f x)) (c+d \sin (e+f x))^2 \, dx\) [259]

Optimal result
Mathematica [A] (warning: unable to verify)
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 = 35, antiderivative size = 463 \[ \int (a+a \sin (e+f x))^3 (A+B \sin (e+f x)) (c+d \sin (e+f x))^2 \, dx=\frac {1}{16} a^3 \left (B \left (30 c^2+52 c d+23 d^2\right )+A \left (40 c^2+60 c d+26 d^2\right )\right ) x-\frac {a^3 \left (2 A d \left (2 c^4-15 c^3 d+72 c^2 d^2+180 c d^3+76 d^4\right )-B \left (2 c^5-12 c^4 d+37 c^3 d^2-112 c^2 d^3-304 c d^4-136 d^5\right )\right ) \cos (e+f x)}{60 d^3 f}-\frac {a^3 \left (2 A d \left (4 c^3-30 c^2 d+146 c d^2+195 d^3\right )-B \left (4 c^4-24 c^3 d+76 c^2 d^2-236 c d^3-345 d^4\right )\right ) \cos (e+f x) \sin (e+f x)}{240 d^2 f}-\frac {a^3 \left (2 A d \left (2 c^2-15 c d+76 d^2\right )-B \left (2 c^3-12 c^2 d+41 c d^2-136 d^3\right )\right ) \cos (e+f x) (c+d \sin (e+f x))^2}{120 d^3 f}+\frac {a^3 \left (2 A (2 c-11 d) d-B \left (2 c^2-8 c d+21 d^2\right )\right ) \cos (e+f x) (c+d \sin (e+f x))^3}{40 d^3 f}-\frac {a B \cos (e+f x) (a+a \sin (e+f x))^2 (c+d \sin (e+f x))^3}{6 d f}+\frac {(3 B c-6 A d-8 B d) \cos (e+f x) \left (a^3+a^3 \sin (e+f x)\right ) (c+d \sin (e+f x))^3}{30 d^2 f} \] Output:

1/16*a^3*(B*(30*c^2+52*c*d+23*d^2)+A*(40*c^2+60*c*d+26*d^2))*x-1/60*a^3*(2 
*A*d*(2*c^4-15*c^3*d+72*c^2*d^2+180*c*d^3+76*d^4)-B*(2*c^5-12*c^4*d+37*c^3 
*d^2-112*c^2*d^3-304*c*d^4-136*d^5))*cos(f*x+e)/d^3/f-1/240*a^3*(2*A*d*(4* 
c^3-30*c^2*d+146*c*d^2+195*d^3)-B*(4*c^4-24*c^3*d+76*c^2*d^2-236*c*d^3-345 
*d^4))*cos(f*x+e)*sin(f*x+e)/d^2/f-1/120*a^3*(2*A*d*(2*c^2-15*c*d+76*d^2)- 
B*(2*c^3-12*c^2*d+41*c*d^2-136*d^3))*cos(f*x+e)*(c+d*sin(f*x+e))^2/d^3/f+1 
/40*a^3*(2*A*(2*c-11*d)*d-B*(2*c^2-8*c*d+21*d^2))*cos(f*x+e)*(c+d*sin(f*x+ 
e))^3/d^3/f-1/6*a*B*cos(f*x+e)*(a+a*sin(f*x+e))^2*(c+d*sin(f*x+e))^3/d/f+1 
/30*(-6*A*d+3*B*c-8*B*d)*cos(f*x+e)*(a^3+a^3*sin(f*x+e))*(c+d*sin(f*x+e))^ 
3/d^2/f
 

Mathematica [A] (warning: unable to verify)

Time = 2.98 (sec) , antiderivative size = 355, normalized size of antiderivative = 0.77 \[ \int (a+a \sin (e+f x))^3 (A+B \sin (e+f x)) (c+d \sin (e+f x))^2 \, dx=-\frac {a^3 \cos (e+f x) \left (60 \left (B \left (30 c^2+52 c d+23 d^2\right )+A \left (40 c^2+60 c d+26 d^2\right )\right ) \arcsin \left (\frac {\sqrt {1-\sin (e+f x)}}{\sqrt {2}}\right )+\sqrt {\cos ^2(e+f x)} \left (1840 A c^2+1680 B c^2+3360 A c d+3112 B c d+1556 A d^2+1468 B d^2-16 \left (A \left (5 c^2+30 c d+22 d^2\right )+B \left (15 c^2+44 c d+26 d^2\right )\right ) \cos (2 (e+f x))+12 d (2 B c+A d+3 B d) \cos (4 (e+f x))+720 A c^2 \sin (e+f x)+990 B c^2 \sin (e+f x)+1980 A c d \sin (e+f x)+2100 B c d \sin (e+f x)+1050 A d^2 \sin (e+f x)+1085 B d^2 \sin (e+f x)-30 B c^2 \sin (3 (e+f x))-60 A c d \sin (3 (e+f x))-180 B c d \sin (3 (e+f x))-90 A d^2 \sin (3 (e+f x))-140 B d^2 \sin (3 (e+f x))+5 B d^2 \sin (5 (e+f x))\right )\right )}{480 f \sqrt {\cos ^2(e+f x)}} \] Input:

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

Output:

-1/480*(a^3*Cos[e + f*x]*(60*(B*(30*c^2 + 52*c*d + 23*d^2) + A*(40*c^2 + 6 
0*c*d + 26*d^2))*ArcSin[Sqrt[1 - Sin[e + f*x]]/Sqrt[2]] + Sqrt[Cos[e + f*x 
]^2]*(1840*A*c^2 + 1680*B*c^2 + 3360*A*c*d + 3112*B*c*d + 1556*A*d^2 + 146 
8*B*d^2 - 16*(A*(5*c^2 + 30*c*d + 22*d^2) + B*(15*c^2 + 44*c*d + 26*d^2))* 
Cos[2*(e + f*x)] + 12*d*(2*B*c + A*d + 3*B*d)*Cos[4*(e + f*x)] + 720*A*c^2 
*Sin[e + f*x] + 990*B*c^2*Sin[e + f*x] + 1980*A*c*d*Sin[e + f*x] + 2100*B* 
c*d*Sin[e + f*x] + 1050*A*d^2*Sin[e + f*x] + 1085*B*d^2*Sin[e + f*x] - 30* 
B*c^2*Sin[3*(e + f*x)] - 60*A*c*d*Sin[3*(e + f*x)] - 180*B*c*d*Sin[3*(e + 
f*x)] - 90*A*d^2*Sin[3*(e + f*x)] - 140*B*d^2*Sin[3*(e + f*x)] + 5*B*d^2*S 
in[5*(e + f*x)])))/(f*Sqrt[Cos[e + f*x]^2])
 

Rubi [A] (verified)

Time = 2.04 (sec) , antiderivative size = 485, normalized size of antiderivative = 1.05, number of steps used = 14, number of rules used = 14, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.400, Rules used = {3042, 3455, 3042, 3455, 27, 3042, 3447, 3042, 3502, 25, 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)^3 (A+B \sin (e+f x)) (c+d \sin (e+f x))^2 \, dx\)

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 3455

\(\displaystyle \frac {\int (\sin (e+f x) a+a)^2 (c+d \sin (e+f x))^2 (a (2 B c+6 A d+3 B d)-a (3 B c-6 A d-8 B d) \sin (e+f x))dx}{6 d}-\frac {a B \cos (e+f x) (a \sin (e+f x)+a)^2 (c+d \sin (e+f x))^3}{6 d f}\)

\(\Big \downarrow \) 3042

\(\displaystyle \frac {\int (\sin (e+f x) a+a)^2 (c+d \sin (e+f x))^2 (a (2 B c+6 A d+3 B d)-a (3 B c-6 A d-8 B d) \sin (e+f x))dx}{6 d}-\frac {a B \cos (e+f x) (a \sin (e+f x)+a)^2 (c+d \sin (e+f x))^3}{6 d f}\)

\(\Big \downarrow \) 3455

\(\displaystyle \frac {\frac {\int 3 (\sin (e+f x) a+a) (c+d \sin (e+f x))^2 \left (a^2 \left (2 A d (c+8 d)-B \left (c^2-3 d c-13 d^2\right )\right )-a^2 \left (2 A (2 c-11 d) d-B \left (2 c^2-8 d c+21 d^2\right )\right ) \sin (e+f x)\right )dx}{5 d}+\frac {(-6 A d+3 B c-8 B d) \cos (e+f x) \left (a^3 \sin (e+f x)+a^3\right ) (c+d \sin (e+f x))^3}{5 d f}}{6 d}-\frac {a B \cos (e+f x) (a \sin (e+f x)+a)^2 (c+d \sin (e+f x))^3}{6 d f}\)

\(\Big \downarrow \) 27

\(\displaystyle \frac {\frac {3 \int (\sin (e+f x) a+a) (c+d \sin (e+f x))^2 \left (a^2 \left (2 A d (c+8 d)-B \left (c^2-3 d c-13 d^2\right )\right )-a^2 \left (2 A (2 c-11 d) d-B \left (2 c^2-8 d c+21 d^2\right )\right ) \sin (e+f x)\right )dx}{5 d}+\frac {(-6 A d+3 B c-8 B d) \cos (e+f x) \left (a^3 \sin (e+f x)+a^3\right ) (c+d \sin (e+f x))^3}{5 d f}}{6 d}-\frac {a B \cos (e+f x) (a \sin (e+f x)+a)^2 (c+d \sin (e+f x))^3}{6 d f}\)

\(\Big \downarrow \) 3042

\(\displaystyle \frac {\frac {3 \int (\sin (e+f x) a+a) (c+d \sin (e+f x))^2 \left (a^2 \left (2 A d (c+8 d)-B \left (c^2-3 d c-13 d^2\right )\right )-a^2 \left (2 A (2 c-11 d) d-B \left (2 c^2-8 d c+21 d^2\right )\right ) \sin (e+f x)\right )dx}{5 d}+\frac {(-6 A d+3 B c-8 B d) \cos (e+f x) \left (a^3 \sin (e+f x)+a^3\right ) (c+d \sin (e+f x))^3}{5 d f}}{6 d}-\frac {a B \cos (e+f x) (a \sin (e+f x)+a)^2 (c+d \sin (e+f x))^3}{6 d f}\)

\(\Big \downarrow \) 3447

\(\displaystyle \frac {\frac {3 \int (c+d \sin (e+f x))^2 \left (-\left (\left (2 A (2 c-11 d) d-B \left (2 c^2-8 d c+21 d^2\right )\right ) \sin ^2(e+f x) a^3\right )+\left (2 A d (c+8 d)-B \left (c^2-3 d c-13 d^2\right )\right ) a^3+\left (a^3 \left (2 A d (c+8 d)-B \left (c^2-3 d c-13 d^2\right )\right )-a^3 \left (2 A (2 c-11 d) d-B \left (2 c^2-8 d c+21 d^2\right )\right )\right ) \sin (e+f x)\right )dx}{5 d}+\frac {(-6 A d+3 B c-8 B d) \cos (e+f x) \left (a^3 \sin (e+f x)+a^3\right ) (c+d \sin (e+f x))^3}{5 d f}}{6 d}-\frac {a B \cos (e+f x) (a \sin (e+f x)+a)^2 (c+d \sin (e+f x))^3}{6 d f}\)

\(\Big \downarrow \) 3042

\(\displaystyle \frac {\frac {3 \int (c+d \sin (e+f x))^2 \left (-\left (\left (2 A (2 c-11 d) d-B \left (2 c^2-8 d c+21 d^2\right )\right ) \sin (e+f x)^2 a^3\right )+\left (2 A d (c+8 d)-B \left (c^2-3 d c-13 d^2\right )\right ) a^3+\left (a^3 \left (2 A d (c+8 d)-B \left (c^2-3 d c-13 d^2\right )\right )-a^3 \left (2 A (2 c-11 d) d-B \left (2 c^2-8 d c+21 d^2\right )\right )\right ) \sin (e+f x)\right )dx}{5 d}+\frac {(-6 A d+3 B c-8 B d) \cos (e+f x) \left (a^3 \sin (e+f x)+a^3\right ) (c+d \sin (e+f x))^3}{5 d f}}{6 d}-\frac {a B \cos (e+f x) (a \sin (e+f x)+a)^2 (c+d \sin (e+f x))^3}{6 d f}\)

\(\Big \downarrow \) 3502

\(\displaystyle \frac {\frac {3 \left (\frac {\int -(c+d \sin (e+f x))^2 \left (a^3 d \left (2 A (2 c-65 d) d-B \left (2 c^2-12 d c+115 d^2\right )\right )-a^3 \left (2 A d \left (2 c^2-15 d c+76 d^2\right )-B \left (2 c^3-12 d c^2+41 d^2 c-136 d^3\right )\right ) \sin (e+f x)\right )dx}{4 d}+\frac {a^3 \left (2 A d (2 c-11 d)-B \left (2 c^2-8 c d+21 d^2\right )\right ) \cos (e+f x) (c+d \sin (e+f x))^3}{4 d f}\right )}{5 d}+\frac {(-6 A d+3 B c-8 B d) \cos (e+f x) \left (a^3 \sin (e+f x)+a^3\right ) (c+d \sin (e+f x))^3}{5 d f}}{6 d}-\frac {a B \cos (e+f x) (a \sin (e+f x)+a)^2 (c+d \sin (e+f x))^3}{6 d f}\)

\(\Big \downarrow \) 25

\(\displaystyle \frac {\frac {3 \left (\frac {a^3 \left (2 A d (2 c-11 d)-B \left (2 c^2-8 c d+21 d^2\right )\right ) \cos (e+f x) (c+d \sin (e+f x))^3}{4 d f}-\frac {\int (c+d \sin (e+f x))^2 \left (a^3 d \left (2 A (2 c-65 d) d-B \left (2 c^2-12 d c+115 d^2\right )\right )-a^3 \left (2 A d \left (2 c^2-15 d c+76 d^2\right )-B \left (2 c^3-12 d c^2+41 d^2 c-136 d^3\right )\right ) \sin (e+f x)\right )dx}{4 d}\right )}{5 d}+\frac {(-6 A d+3 B c-8 B d) \cos (e+f x) \left (a^3 \sin (e+f x)+a^3\right ) (c+d \sin (e+f x))^3}{5 d f}}{6 d}-\frac {a B \cos (e+f x) (a \sin (e+f x)+a)^2 (c+d \sin (e+f x))^3}{6 d f}\)

\(\Big \downarrow \) 3042

\(\displaystyle \frac {\frac {3 \left (\frac {a^3 \left (2 A d (2 c-11 d)-B \left (2 c^2-8 c d+21 d^2\right )\right ) \cos (e+f x) (c+d \sin (e+f x))^3}{4 d f}-\frac {\int (c+d \sin (e+f x))^2 \left (a^3 d \left (2 A (2 c-65 d) d-B \left (2 c^2-12 d c+115 d^2\right )\right )-a^3 \left (2 A d \left (2 c^2-15 d c+76 d^2\right )-B \left (2 c^3-12 d c^2+41 d^2 c-136 d^3\right )\right ) \sin (e+f x)\right )dx}{4 d}\right )}{5 d}+\frac {(-6 A d+3 B c-8 B d) \cos (e+f x) \left (a^3 \sin (e+f x)+a^3\right ) (c+d \sin (e+f x))^3}{5 d f}}{6 d}-\frac {a B \cos (e+f x) (a \sin (e+f x)+a)^2 (c+d \sin (e+f x))^3}{6 d f}\)

\(\Big \downarrow \) 3232

\(\displaystyle \frac {\frac {3 \left (\frac {a^3 \left (2 A d (2 c-11 d)-B \left (2 c^2-8 c d+21 d^2\right )\right ) \cos (e+f x) (c+d \sin (e+f x))^3}{4 d f}-\frac {\frac {1}{3} \int (c+d \sin (e+f x)) \left (a^3 d \left (2 A d \left (2 c^2-165 d c-152 d^2\right )-B \left (2 c^3-12 d c^2+263 d^2 c+272 d^3\right )\right )-a^3 \left (2 A d \left (4 c^3-30 d c^2+146 d^2 c+195 d^3\right )-B \left (4 c^4-24 d c^3+76 d^2 c^2-236 d^3 c-345 d^4\right )\right ) \sin (e+f x)\right )dx+\frac {a^3 \left (2 A d \left (2 c^2-15 c d+76 d^2\right )-B \left (2 c^3-12 c^2 d+41 c d^2-136 d^3\right )\right ) \cos (e+f x) (c+d \sin (e+f x))^2}{3 f}}{4 d}\right )}{5 d}+\frac {(-6 A d+3 B c-8 B d) \cos (e+f x) \left (a^3 \sin (e+f x)+a^3\right ) (c+d \sin (e+f x))^3}{5 d f}}{6 d}-\frac {a B \cos (e+f x) (a \sin (e+f x)+a)^2 (c+d \sin (e+f x))^3}{6 d f}\)

\(\Big \downarrow \) 3042

\(\displaystyle \frac {\frac {3 \left (\frac {a^3 \left (2 A d (2 c-11 d)-B \left (2 c^2-8 c d+21 d^2\right )\right ) \cos (e+f x) (c+d \sin (e+f x))^3}{4 d f}-\frac {\frac {1}{3} \int (c+d \sin (e+f x)) \left (a^3 d \left (2 A d \left (2 c^2-165 d c-152 d^2\right )-B \left (2 c^3-12 d c^2+263 d^2 c+272 d^3\right )\right )-a^3 \left (2 A d \left (4 c^3-30 d c^2+146 d^2 c+195 d^3\right )-B \left (4 c^4-24 d c^3+76 d^2 c^2-236 d^3 c-345 d^4\right )\right ) \sin (e+f x)\right )dx+\frac {a^3 \left (2 A d \left (2 c^2-15 c d+76 d^2\right )-B \left (2 c^3-12 c^2 d+41 c d^2-136 d^3\right )\right ) \cos (e+f x) (c+d \sin (e+f x))^2}{3 f}}{4 d}\right )}{5 d}+\frac {(-6 A d+3 B c-8 B d) \cos (e+f x) \left (a^3 \sin (e+f x)+a^3\right ) (c+d \sin (e+f x))^3}{5 d f}}{6 d}-\frac {a B \cos (e+f x) (a \sin (e+f x)+a)^2 (c+d \sin (e+f x))^3}{6 d f}\)

\(\Big \downarrow \) 3213

\(\displaystyle \frac {\frac {3 \left (\frac {a^3 \left (2 A d (2 c-11 d)-B \left (2 c^2-8 c d+21 d^2\right )\right ) \cos (e+f x) (c+d \sin (e+f x))^3}{4 d f}-\frac {\frac {a^3 \left (2 A d \left (2 c^2-15 c d+76 d^2\right )-B \left (2 c^3-12 c^2 d+41 c d^2-136 d^3\right )\right ) \cos (e+f x) (c+d \sin (e+f x))^2}{3 f}+\frac {1}{3} \left (-\frac {15}{2} a^3 d^3 x \left (A \left (40 c^2+60 c d+26 d^2\right )+B \left (30 c^2+52 c d+23 d^2\right )\right )+\frac {a^3 d \left (2 A d \left (4 c^3-30 c^2 d+146 c d^2+195 d^3\right )-B \left (4 c^4-24 c^3 d+76 c^2 d^2-236 c d^3-345 d^4\right )\right ) \sin (e+f x) \cos (e+f x)}{2 f}+\frac {2 a^3 \left (2 A d \left (2 c^4-15 c^3 d+72 c^2 d^2+180 c d^3+76 d^4\right )-B \left (2 c^5-12 c^4 d+37 c^3 d^2-112 c^2 d^3-304 c d^4-136 d^5\right )\right ) \cos (e+f x)}{f}\right )}{4 d}\right )}{5 d}+\frac {(-6 A d+3 B c-8 B d) \cos (e+f x) \left (a^3 \sin (e+f x)+a^3\right ) (c+d \sin (e+f x))^3}{5 d f}}{6 d}-\frac {a B \cos (e+f x) (a \sin (e+f x)+a)^2 (c+d \sin (e+f x))^3}{6 d f}\)

Input:

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

Output:

-1/6*(a*B*Cos[e + f*x]*(a + a*Sin[e + f*x])^2*(c + d*Sin[e + f*x])^3)/(d*f 
) + (((3*B*c - 6*A*d - 8*B*d)*Cos[e + f*x]*(a^3 + a^3*Sin[e + f*x])*(c + d 
*Sin[e + f*x])^3)/(5*d*f) + (3*((a^3*(2*A*(2*c - 11*d)*d - B*(2*c^2 - 8*c* 
d + 21*d^2))*Cos[e + f*x]*(c + d*Sin[e + f*x])^3)/(4*d*f) - ((a^3*(2*A*d*( 
2*c^2 - 15*c*d + 76*d^2) - B*(2*c^3 - 12*c^2*d + 41*c*d^2 - 136*d^3))*Cos[ 
e + f*x]*(c + d*Sin[e + f*x])^2)/(3*f) + ((-15*a^3*d^3*(B*(30*c^2 + 52*c*d 
 + 23*d^2) + A*(40*c^2 + 60*c*d + 26*d^2))*x)/2 + (2*a^3*(2*A*d*(2*c^4 - 1 
5*c^3*d + 72*c^2*d^2 + 180*c*d^3 + 76*d^4) - B*(2*c^5 - 12*c^4*d + 37*c^3* 
d^2 - 112*c^2*d^3 - 304*c*d^4 - 136*d^5))*Cos[e + f*x])/f + (a^3*d*(2*A*d* 
(4*c^3 - 30*c^2*d + 146*c*d^2 + 195*d^3) - B*(4*c^4 - 24*c^3*d + 76*c^2*d^ 
2 - 236*c*d^3 - 345*d^4))*Cos[e + f*x]*Sin[e + f*x])/(2*f))/3)/(4*d)))/(5* 
d))/(6*d)
 

Defintions of rubi rules used

rule 25
Int[-(Fx_), x_Symbol] :> Simp[Identity[-1]   Int[Fx, x], x]
 

rule 27
Int[(a_)*(Fx_), x_Symbol] :> Simp[a   Int[Fx, x], x] /; FreeQ[a, x] &&  !Ma 
tchQ[Fx, (b_)*(Gx_) /; FreeQ[b, x]]
 

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]
 

rule 3447
Int[((a_.) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)*((A_.) + (B_.)*sin[(e_.) 
+ (f_.)*(x_)])*((c_.) + (d_.)*sin[(e_.) + (f_.)*(x_)]), x_Symbol] :> Int[(a 
 + b*Sin[e + f*x])^m*(A*c + (B*c + A*d)*Sin[e + f*x] + B*d*Sin[e + f*x]^2), 
 x] /; FreeQ[{a, b, c, d, e, f, A, B, m}, x] && NeQ[b*c - a*d, 0]
 

rule 3455
Int[((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_)*((A_.) + (B_.)*sin[(e_.) + 
(f_.)*(x_)])*((c_.) + (d_.)*sin[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Sim 
p[(-b)*B*Cos[e + f*x]*(a + b*Sin[e + f*x])^(m - 1)*((c + d*Sin[e + f*x])^(n 
 + 1)/(d*f*(m + n + 1))), x] + Simp[1/(d*(m + n + 1))   Int[(a + b*Sin[e + 
f*x])^(m - 1)*(c + d*Sin[e + f*x])^n*Simp[a*A*d*(m + n + 1) + B*(a*c*(m - 1 
) + b*d*(n + 1)) + (A*b*d*(m + n + 1) - B*(b*c*m - a*d*(2*m + n)))*Sin[e + 
f*x], x], x], x] /; FreeQ[{a, b, c, d, e, f, A, B, n}, x] && NeQ[b*c - a*d, 
 0] && EqQ[a^2 - b^2, 0] && NeQ[c^2 - d^2, 0] && GtQ[m, 1/2] &&  !LtQ[n, -1 
] && IntegerQ[2*m] && (IntegerQ[2*n] || EqQ[c, 0])
 

rule 3502
Int[((a_.) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)*((A_.) + (B_.)*sin[(e_.) 
+ (f_.)*(x_)] + (C_.)*sin[(e_.) + (f_.)*(x_)]^2), x_Symbol] :> Simp[(-C)*Co 
s[e + f*x]*((a + b*Sin[e + f*x])^(m + 1)/(b*f*(m + 2))), x] + Simp[1/(b*(m 
+ 2))   Int[(a + b*Sin[e + f*x])^m*Simp[A*b*(m + 2) + b*C*(m + 1) + (b*B*(m 
 + 2) - a*C)*Sin[e + f*x], x], x], x] /; FreeQ[{a, b, e, f, A, B, C, m}, x] 
 &&  !LtQ[m, -1]
 
Maple [A] (verified)

Time = 0.87 (sec) , antiderivative size = 725, normalized size of antiderivative = 1.57

\[\frac {-\frac {a^{3} A \,c^{2} \left (2+\sin \left (f x +e \right )^{2}\right ) \cos \left (f x +e \right )}{3}+2 a^{3} A c d \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^{3} A \,d^{2} \left (\frac {8}{3}+\sin \left (f x +e \right )^{4}+\frac {4 \sin \left (f x +e \right )^{2}}{3}\right ) \cos \left (f x +e \right )}{5}+a^{3} B \,c^{2} \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 {2 a^{3} B c d \left (\frac {8}{3}+\sin \left (f x +e \right )^{4}+\frac {4 \sin \left (f x +e \right )^{2}}{3}\right ) \cos \left (f x +e \right )}{5}+a^{3} B \,d^{2} \left (-\frac {\left (\sin \left (f x +e \right )^{5}+\frac {5 \sin \left (f x +e \right )^{3}}{4}+\frac {15 \sin \left (f x +e \right )}{8}\right ) \cos \left (f x +e \right )}{6}+\frac {5 f x}{16}+\frac {5 e}{16}\right )+3 a^{3} A \,c^{2} \left (-\frac {\sin \left (f x +e \right ) \cos \left (f x +e \right )}{2}+\frac {f x}{2}+\frac {e}{2}\right )-2 a^{3} A c d \left (2+\sin \left (f x +e \right )^{2}\right ) \cos \left (f x +e \right )+3 a^{3} A \,d^{2} \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^{3} B \,c^{2} \left (2+\sin \left (f x +e \right )^{2}\right ) \cos \left (f x +e \right )+6 a^{3} B c d \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 {3 a^{3} B \,d^{2} \left (\frac {8}{3}+\sin \left (f x +e \right )^{4}+\frac {4 \sin \left (f x +e \right )^{2}}{3}\right ) \cos \left (f x +e \right )}{5}-3 a^{3} A \,c^{2} \cos \left (f x +e \right )+6 a^{3} A c d \left (-\frac {\sin \left (f x +e \right ) \cos \left (f x +e \right )}{2}+\frac {f x}{2}+\frac {e}{2}\right )-a^{3} A \,d^{2} \left (2+\sin \left (f x +e \right )^{2}\right ) \cos \left (f x +e \right )+3 a^{3} B \,c^{2} \left (-\frac {\sin \left (f x +e \right ) \cos \left (f x +e \right )}{2}+\frac {f x}{2}+\frac {e}{2}\right )-2 a^{3} B c d \left (2+\sin \left (f x +e \right )^{2}\right ) \cos \left (f x +e \right )+3 a^{3} B \,d^{2} \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^{3} A \,c^{2} \left (f x +e \right )-2 a^{3} A c d \cos \left (f x +e \right )+a^{3} A \,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 )-a^{3} B \,c^{2} \cos \left (f x +e \right )+2 a^{3} B c d \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^{3} B \,d^{2} \left (2+\sin \left (f x +e \right )^{2}\right ) \cos \left (f x +e \right )}{3}}{f}\]

Input:

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

Output:

1/f*(-1/3*a^3*A*c^2*(2+sin(f*x+e)^2)*cos(f*x+e)+2*a^3*A*c*d*(-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/5*a^3*A*d^2*(8/3+sin(f*x 
+e)^4+4/3*sin(f*x+e)^2)*cos(f*x+e)+a^3*B*c^2*(-1/4*(sin(f*x+e)^3+3/2*sin(f 
*x+e))*cos(f*x+e)+3/8*f*x+3/8*e)-2/5*a^3*B*c*d*(8/3+sin(f*x+e)^4+4/3*sin(f 
*x+e)^2)*cos(f*x+e)+a^3*B*d^2*(-1/6*(sin(f*x+e)^5+5/4*sin(f*x+e)^3+15/8*si 
n(f*x+e))*cos(f*x+e)+5/16*f*x+5/16*e)+3*a^3*A*c^2*(-1/2*sin(f*x+e)*cos(f*x 
+e)+1/2*f*x+1/2*e)-2*a^3*A*c*d*(2+sin(f*x+e)^2)*cos(f*x+e)+3*a^3*A*d^2*(-1 
/4*(sin(f*x+e)^3+3/2*sin(f*x+e))*cos(f*x+e)+3/8*f*x+3/8*e)-a^3*B*c^2*(2+si 
n(f*x+e)^2)*cos(f*x+e)+6*a^3*B*c*d*(-1/4*(sin(f*x+e)^3+3/2*sin(f*x+e))*cos 
(f*x+e)+3/8*f*x+3/8*e)-3/5*a^3*B*d^2*(8/3+sin(f*x+e)^4+4/3*sin(f*x+e)^2)*c 
os(f*x+e)-3*a^3*A*c^2*cos(f*x+e)+6*a^3*A*c*d*(-1/2*sin(f*x+e)*cos(f*x+e)+1 
/2*f*x+1/2*e)-a^3*A*d^2*(2+sin(f*x+e)^2)*cos(f*x+e)+3*a^3*B*c^2*(-1/2*sin( 
f*x+e)*cos(f*x+e)+1/2*f*x+1/2*e)-2*a^3*B*c*d*(2+sin(f*x+e)^2)*cos(f*x+e)+3 
*a^3*B*d^2*(-1/4*(sin(f*x+e)^3+3/2*sin(f*x+e))*cos(f*x+e)+3/8*f*x+3/8*e)+a 
^3*A*c^2*(f*x+e)-2*a^3*A*c*d*cos(f*x+e)+a^3*A*d^2*(-1/2*sin(f*x+e)*cos(f*x 
+e)+1/2*f*x+1/2*e)-a^3*B*c^2*cos(f*x+e)+2*a^3*B*c*d*(-1/2*sin(f*x+e)*cos(f 
*x+e)+1/2*f*x+1/2*e)-1/3*a^3*B*d^2*(2+sin(f*x+e)^2)*cos(f*x+e))
 

Fricas [A] (verification not implemented)

Time = 0.11 (sec) , antiderivative size = 299, normalized size of antiderivative = 0.65 \[ \int (a+a \sin (e+f x))^3 (A+B \sin (e+f x)) (c+d \sin (e+f x))^2 \, dx=-\frac {48 \, {\left (2 \, B a^{3} c d + {\left (A + 3 \, B\right )} a^{3} d^{2}\right )} \cos \left (f x + e\right )^{5} - 80 \, {\left ({\left (A + 3 \, B\right )} a^{3} c^{2} + 2 \, {\left (3 \, A + 5 \, B\right )} a^{3} c d + {\left (5 \, A + 7 \, B\right )} a^{3} d^{2}\right )} \cos \left (f x + e\right )^{3} - 15 \, {\left (10 \, {\left (4 \, A + 3 \, B\right )} a^{3} c^{2} + 4 \, {\left (15 \, A + 13 \, B\right )} a^{3} c d + {\left (26 \, A + 23 \, B\right )} a^{3} d^{2}\right )} f x + 960 \, {\left ({\left (A + B\right )} a^{3} c^{2} + 2 \, {\left (A + B\right )} a^{3} c d + {\left (A + B\right )} a^{3} d^{2}\right )} \cos \left (f x + e\right ) + 5 \, {\left (8 \, B a^{3} d^{2} \cos \left (f x + e\right )^{5} - 2 \, {\left (6 \, B a^{3} c^{2} + 12 \, {\left (A + 3 \, B\right )} a^{3} c d + {\left (18 \, A + 31 \, B\right )} a^{3} d^{2}\right )} \cos \left (f x + e\right )^{3} + 3 \, {\left (2 \, {\left (12 \, A + 17 \, B\right )} a^{3} c^{2} + 4 \, {\left (17 \, A + 19 \, B\right )} a^{3} c d + {\left (38 \, A + 41 \, B\right )} a^{3} d^{2}\right )} \cos \left (f x + e\right )\right )} \sin \left (f x + e\right )}{240 \, f} \] Input:

integrate((a+a*sin(f*x+e))^3*(A+B*sin(f*x+e))*(c+d*sin(f*x+e))^2,x, algori 
thm="fricas")
 

Output:

-1/240*(48*(2*B*a^3*c*d + (A + 3*B)*a^3*d^2)*cos(f*x + e)^5 - 80*((A + 3*B 
)*a^3*c^2 + 2*(3*A + 5*B)*a^3*c*d + (5*A + 7*B)*a^3*d^2)*cos(f*x + e)^3 - 
15*(10*(4*A + 3*B)*a^3*c^2 + 4*(15*A + 13*B)*a^3*c*d + (26*A + 23*B)*a^3*d 
^2)*f*x + 960*((A + B)*a^3*c^2 + 2*(A + B)*a^3*c*d + (A + B)*a^3*d^2)*cos( 
f*x + e) + 5*(8*B*a^3*d^2*cos(f*x + e)^5 - 2*(6*B*a^3*c^2 + 12*(A + 3*B)*a 
^3*c*d + (18*A + 31*B)*a^3*d^2)*cos(f*x + e)^3 + 3*(2*(12*A + 17*B)*a^3*c^ 
2 + 4*(17*A + 19*B)*a^3*c*d + (38*A + 41*B)*a^3*d^2)*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. 1804 vs. \(2 (449) = 898\).

Time = 0.53 (sec) , antiderivative size = 1804, normalized size of antiderivative = 3.90 \[ \int (a+a \sin (e+f x))^3 (A+B \sin (e+f x)) (c+d \sin (e+f x))^2 \, dx=\text {Too large to display} \] Input:

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

Output:

Piecewise((3*A*a**3*c**2*x*sin(e + f*x)**2/2 + 3*A*a**3*c**2*x*cos(e + f*x 
)**2/2 + A*a**3*c**2*x - A*a**3*c**2*sin(e + f*x)**2*cos(e + f*x)/f - 3*A* 
a**3*c**2*sin(e + f*x)*cos(e + f*x)/(2*f) - 2*A*a**3*c**2*cos(e + f*x)**3/ 
(3*f) - 3*A*a**3*c**2*cos(e + f*x)/f + 3*A*a**3*c*d*x*sin(e + f*x)**4/4 + 
3*A*a**3*c*d*x*sin(e + f*x)**2*cos(e + f*x)**2/2 + 3*A*a**3*c*d*x*sin(e + 
f*x)**2 + 3*A*a**3*c*d*x*cos(e + f*x)**4/4 + 3*A*a**3*c*d*x*cos(e + f*x)** 
2 - 5*A*a**3*c*d*sin(e + f*x)**3*cos(e + f*x)/(4*f) - 6*A*a**3*c*d*sin(e + 
 f*x)**2*cos(e + f*x)/f - 3*A*a**3*c*d*sin(e + f*x)*cos(e + f*x)**3/(4*f) 
- 3*A*a**3*c*d*sin(e + f*x)*cos(e + f*x)/f - 4*A*a**3*c*d*cos(e + f*x)**3/ 
f - 2*A*a**3*c*d*cos(e + f*x)/f + 9*A*a**3*d**2*x*sin(e + f*x)**4/8 + 9*A* 
a**3*d**2*x*sin(e + f*x)**2*cos(e + f*x)**2/4 + A*a**3*d**2*x*sin(e + f*x) 
**2/2 + 9*A*a**3*d**2*x*cos(e + f*x)**4/8 + A*a**3*d**2*x*cos(e + f*x)**2/ 
2 - A*a**3*d**2*sin(e + f*x)**4*cos(e + f*x)/f - 15*A*a**3*d**2*sin(e + f* 
x)**3*cos(e + f*x)/(8*f) - 4*A*a**3*d**2*sin(e + f*x)**2*cos(e + f*x)**3/( 
3*f) - 3*A*a**3*d**2*sin(e + f*x)**2*cos(e + f*x)/f - 9*A*a**3*d**2*sin(e 
+ f*x)*cos(e + f*x)**3/(8*f) - A*a**3*d**2*sin(e + f*x)*cos(e + f*x)/(2*f) 
 - 8*A*a**3*d**2*cos(e + f*x)**5/(15*f) - 2*A*a**3*d**2*cos(e + f*x)**3/f 
+ 3*B*a**3*c**2*x*sin(e + f*x)**4/8 + 3*B*a**3*c**2*x*sin(e + f*x)**2*cos( 
e + f*x)**2/4 + 3*B*a**3*c**2*x*sin(e + f*x)**2/2 + 3*B*a**3*c**2*x*cos(e 
+ f*x)**4/8 + 3*B*a**3*c**2*x*cos(e + f*x)**2/2 - 5*B*a**3*c**2*sin(e +...
 

Maxima [A] (verification not implemented)

Time = 0.05 (sec) , antiderivative size = 704, normalized size of antiderivative = 1.52 \[ \int (a+a \sin (e+f x))^3 (A+B \sin (e+f x)) (c+d \sin (e+f x))^2 \, dx =\text {Too large to display} \] Input:

integrate((a+a*sin(f*x+e))^3*(A+B*sin(f*x+e))*(c+d*sin(f*x+e))^2,x, algori 
thm="maxima")
 

Output:

1/960*(320*(cos(f*x + e)^3 - 3*cos(f*x + e))*A*a^3*c^2 + 720*(2*f*x + 2*e 
- sin(2*f*x + 2*e))*A*a^3*c^2 + 960*(f*x + e)*A*a^3*c^2 + 960*(cos(f*x + e 
)^3 - 3*cos(f*x + e))*B*a^3*c^2 + 30*(12*f*x + 12*e + sin(4*f*x + 4*e) - 8 
*sin(2*f*x + 2*e))*B*a^3*c^2 + 720*(2*f*x + 2*e - sin(2*f*x + 2*e))*B*a^3* 
c^2 + 1920*(cos(f*x + e)^3 - 3*cos(f*x + e))*A*a^3*c*d + 60*(12*f*x + 12*e 
 + sin(4*f*x + 4*e) - 8*sin(2*f*x + 2*e))*A*a^3*c*d + 1440*(2*f*x + 2*e - 
sin(2*f*x + 2*e))*A*a^3*c*d - 128*(3*cos(f*x + e)^5 - 10*cos(f*x + e)^3 + 
15*cos(f*x + e))*B*a^3*c*d + 1920*(cos(f*x + e)^3 - 3*cos(f*x + e))*B*a^3* 
c*d + 180*(12*f*x + 12*e + sin(4*f*x + 4*e) - 8*sin(2*f*x + 2*e))*B*a^3*c* 
d + 480*(2*f*x + 2*e - sin(2*f*x + 2*e))*B*a^3*c*d - 64*(3*cos(f*x + e)^5 
- 10*cos(f*x + e)^3 + 15*cos(f*x + e))*A*a^3*d^2 + 960*(cos(f*x + e)^3 - 3 
*cos(f*x + e))*A*a^3*d^2 + 90*(12*f*x + 12*e + sin(4*f*x + 4*e) - 8*sin(2* 
f*x + 2*e))*A*a^3*d^2 + 240*(2*f*x + 2*e - sin(2*f*x + 2*e))*A*a^3*d^2 - 1 
92*(3*cos(f*x + e)^5 - 10*cos(f*x + e)^3 + 15*cos(f*x + e))*B*a^3*d^2 + 32 
0*(cos(f*x + e)^3 - 3*cos(f*x + e))*B*a^3*d^2 + 5*(4*sin(2*f*x + 2*e)^3 + 
60*f*x + 60*e + 9*sin(4*f*x + 4*e) - 48*sin(2*f*x + 2*e))*B*a^3*d^2 + 90*( 
12*f*x + 12*e + sin(4*f*x + 4*e) - 8*sin(2*f*x + 2*e))*B*a^3*d^2 - 2880*A* 
a^3*c^2*cos(f*x + e) - 960*B*a^3*c^2*cos(f*x + e) - 1920*A*a^3*c*d*cos(f*x 
 + e))/f
 

Giac [A] (verification not implemented)

Time = 0.25 (sec) , antiderivative size = 374, normalized size of antiderivative = 0.81 \[ \int (a+a \sin (e+f x))^3 (A+B \sin (e+f x)) (c+d \sin (e+f x))^2 \, dx=-\frac {B a^{3} d^{2} \sin \left (6 \, f x + 6 \, e\right )}{192 \, f} + \frac {1}{16} \, {\left (40 \, A a^{3} c^{2} + 30 \, B a^{3} c^{2} + 60 \, A a^{3} c d + 52 \, B a^{3} c d + 26 \, A a^{3} d^{2} + 23 \, B a^{3} d^{2}\right )} x - \frac {{\left (2 \, B a^{3} c d + A a^{3} d^{2} + 3 \, B a^{3} d^{2}\right )} \cos \left (5 \, f x + 5 \, e\right )}{80 \, f} + \frac {{\left (4 \, A a^{3} c^{2} + 12 \, B a^{3} c^{2} + 24 \, A a^{3} c d + 34 \, B a^{3} c d + 17 \, A a^{3} d^{2} + 19 \, B a^{3} d^{2}\right )} \cos \left (3 \, f x + 3 \, e\right )}{48 \, f} - \frac {{\left (30 \, A a^{3} c^{2} + 26 \, B a^{3} c^{2} + 52 \, A a^{3} c d + 46 \, B a^{3} c d + 23 \, A a^{3} d^{2} + 21 \, B a^{3} d^{2}\right )} \cos \left (f x + e\right )}{8 \, f} + \frac {{\left (2 \, B a^{3} c^{2} + 4 \, A a^{3} c d + 12 \, B a^{3} c d + 6 \, A a^{3} d^{2} + 9 \, B a^{3} d^{2}\right )} \sin \left (4 \, f x + 4 \, e\right )}{64 \, f} - \frac {{\left (48 \, A a^{3} c^{2} + 64 \, B a^{3} c^{2} + 128 \, A a^{3} c d + 128 \, B a^{3} c d + 64 \, A a^{3} d^{2} + 63 \, B a^{3} d^{2}\right )} \sin \left (2 \, f x + 2 \, e\right )}{64 \, f} \] Input:

integrate((a+a*sin(f*x+e))^3*(A+B*sin(f*x+e))*(c+d*sin(f*x+e))^2,x, algori 
thm="giac")
 

Output:

-1/192*B*a^3*d^2*sin(6*f*x + 6*e)/f + 1/16*(40*A*a^3*c^2 + 30*B*a^3*c^2 + 
60*A*a^3*c*d + 52*B*a^3*c*d + 26*A*a^3*d^2 + 23*B*a^3*d^2)*x - 1/80*(2*B*a 
^3*c*d + A*a^3*d^2 + 3*B*a^3*d^2)*cos(5*f*x + 5*e)/f + 1/48*(4*A*a^3*c^2 + 
 12*B*a^3*c^2 + 24*A*a^3*c*d + 34*B*a^3*c*d + 17*A*a^3*d^2 + 19*B*a^3*d^2) 
*cos(3*f*x + 3*e)/f - 1/8*(30*A*a^3*c^2 + 26*B*a^3*c^2 + 52*A*a^3*c*d + 46 
*B*a^3*c*d + 23*A*a^3*d^2 + 21*B*a^3*d^2)*cos(f*x + e)/f + 1/64*(2*B*a^3*c 
^2 + 4*A*a^3*c*d + 12*B*a^3*c*d + 6*A*a^3*d^2 + 9*B*a^3*d^2)*sin(4*f*x + 4 
*e)/f - 1/64*(48*A*a^3*c^2 + 64*B*a^3*c^2 + 128*A*a^3*c*d + 128*B*a^3*c*d 
+ 64*A*a^3*d^2 + 63*B*a^3*d^2)*sin(2*f*x + 2*e)/f
 

Mupad [B] (verification not implemented)

Time = 37.39 (sec) , antiderivative size = 976, normalized size of antiderivative = 2.11 \[ \int (a+a \sin (e+f x))^3 (A+B \sin (e+f x)) (c+d \sin (e+f x))^2 \, dx=\text {Too large to display} \] Input:

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

Output:

(a^3*atan((a^3*tan(e/2 + (f*x)/2)*(40*A*c^2 + 26*A*d^2 + 30*B*c^2 + 23*B*d 
^2 + 60*A*c*d + 52*B*c*d))/(8*(5*A*a^3*c^2 + (13*A*a^3*d^2)/4 + (15*B*a^3* 
c^2)/4 + (23*B*a^3*d^2)/8 + (15*A*a^3*c*d)/2 + (13*B*a^3*c*d)/2)))*(40*A*c 
^2 + 26*A*d^2 + 30*B*c^2 + 23*B*d^2 + 60*A*c*d + 52*B*c*d))/(8*f) - (tan(e 
/2 + (f*x)/2)^10*(6*A*a^3*c^2 + 2*B*a^3*c^2 + 4*A*a^3*c*d) + tan(e/2 + (f* 
x)/2)*(3*A*a^3*c^2 + (13*A*a^3*d^2)/4 + (15*B*a^3*c^2)/4 + (23*B*a^3*d^2)/ 
8 + (15*A*a^3*c*d)/2 + (13*B*a^3*c*d)/2) - tan(e/2 + (f*x)/2)^11*(3*A*a^3* 
c^2 + (13*A*a^3*d^2)/4 + (15*B*a^3*c^2)/4 + (23*B*a^3*d^2)/8 + (15*A*a^3*c 
*d)/2 + (13*B*a^3*c*d)/2) + tan(e/2 + (f*x)/2)^8*(34*A*a^3*c^2 + 12*A*a^3* 
d^2 + 22*B*a^3*c^2 + 4*B*a^3*d^2 + 44*A*a^3*c*d + 24*B*a^3*c*d) + tan(e/2 
+ (f*x)/2)^5*(6*A*a^3*c^2 + (25*A*a^3*d^2)/2 + (19*B*a^3*c^2)/2 + (75*B*a^ 
3*d^2)/4 + 19*A*a^3*c*d + 25*B*a^3*c*d) - tan(e/2 + (f*x)/2)^7*(6*A*a^3*c^ 
2 + (25*A*a^3*d^2)/2 + (19*B*a^3*c^2)/2 + (75*B*a^3*d^2)/4 + 19*A*a^3*c*d 
+ 25*B*a^3*c*d) + tan(e/2 + (f*x)/2)^4*(76*A*a^3*c^2 + 64*A*a^3*d^2 + 68*B 
*a^3*c^2 + 64*B*a^3*d^2 + 136*A*a^3*c*d + 128*B*a^3*c*d) + tan(e/2 + (f*x) 
/2)^3*(9*A*a^3*c^2 + (63*A*a^3*d^2)/4 + (53*B*a^3*c^2)/4 + (391*B*a^3*d^2) 
/24 + (53*A*a^3*c*d)/2 + (63*B*a^3*c*d)/2) - tan(e/2 + (f*x)/2)^9*(9*A*a^3 
*c^2 + (63*A*a^3*d^2)/4 + (53*B*a^3*c^2)/4 + (391*B*a^3*d^2)/24 + (53*A*a^ 
3*c*d)/2 + (63*B*a^3*c*d)/2) + tan(e/2 + (f*x)/2)^2*(38*A*a^3*c^2 + (152*A 
*a^3*d^2)/5 + 34*B*a^3*c^2 + (136*B*a^3*d^2)/5 + 68*A*a^3*c*d + (304*B*...
 

Reduce [B] (verification not implemented)

Time = 0.19 (sec) , antiderivative size = 560, normalized size of antiderivative = 1.21 \[ \int (a+a \sin (e+f x))^3 (A+B \sin (e+f x)) (c+d \sin (e+f x))^2 \, dx=\frac {a^{3} \left (-48 \cos \left (f x +e \right ) \sin \left (f x +e \right )^{4} a \,d^{2}-60 \cos \left (f x +e \right ) \sin \left (f x +e \right )^{3} b \,c^{2}-80 \cos \left (f x +e \right ) \sin \left (f x +e \right )^{2} a \,c^{2}-230 \cos \left (f x +e \right ) \sin \left (f x +e \right )^{3} b \,d^{2}-304 \cos \left (f x +e \right ) \sin \left (f x +e \right )^{2} a \,d^{2}-272 \cos \left (f x +e \right ) \sin \left (f x +e \right )^{2} b \,d^{2}-390 \cos \left (f x +e \right ) \sin \left (f x +e \right ) a \,d^{2}-450 \cos \left (f x +e \right ) \sin \left (f x +e \right ) b \,c^{2}-345 \cos \left (f x +e \right ) \sin \left (f x +e \right ) b \,d^{2}-1440 \cos \left (f x +e \right ) a c d -1216 \cos \left (f x +e \right ) b c d +600 a \,c^{2} f x +390 a \,d^{2} f x +450 b \,c^{2} f x +345 b \,d^{2} f x -608 \cos \left (f x +e \right ) \sin \left (f x +e \right )^{2} b c d -900 \cos \left (f x +e \right ) \sin \left (f x +e \right ) a c d -780 \cos \left (f x +e \right ) \sin \left (f x +e \right ) b c d +900 a c d f x +780 b c d f x +608 a \,d^{2}+720 b \,c^{2}+544 b \,d^{2}+880 a \,c^{2}-240 \cos \left (f x +e \right ) \sin \left (f x +e \right )^{2} b \,c^{2}-360 \cos \left (f x +e \right ) \sin \left (f x +e \right ) a \,c^{2}-40 \cos \left (f x +e \right ) \sin \left (f x +e \right )^{5} b \,d^{2}-360 \cos \left (f x +e \right ) \sin \left (f x +e \right )^{3} b c d -480 \cos \left (f x +e \right ) \sin \left (f x +e \right )^{2} a c d -96 \cos \left (f x +e \right ) \sin \left (f x +e \right )^{4} b c d -120 \cos \left (f x +e \right ) \sin \left (f x +e \right )^{3} a c d -144 \cos \left (f x +e \right ) \sin \left (f x +e \right )^{4} b \,d^{2}-180 \cos \left (f x +e \right ) \sin \left (f x +e \right )^{3} a \,d^{2}-880 \cos \left (f x +e \right ) a \,c^{2}-608 \cos \left (f x +e \right ) a \,d^{2}-720 \cos \left (f x +e \right ) b \,c^{2}-544 \cos \left (f x +e \right ) b \,d^{2}+1440 a c d +1216 b c d \right )}{240 f} \] Input:

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

Output:

(a**3*( - 40*cos(e + f*x)*sin(e + f*x)**5*b*d**2 - 48*cos(e + f*x)*sin(e + 
 f*x)**4*a*d**2 - 96*cos(e + f*x)*sin(e + f*x)**4*b*c*d - 144*cos(e + f*x) 
*sin(e + f*x)**4*b*d**2 - 120*cos(e + f*x)*sin(e + f*x)**3*a*c*d - 180*cos 
(e + f*x)*sin(e + f*x)**3*a*d**2 - 60*cos(e + f*x)*sin(e + f*x)**3*b*c**2 
- 360*cos(e + f*x)*sin(e + f*x)**3*b*c*d - 230*cos(e + f*x)*sin(e + f*x)** 
3*b*d**2 - 80*cos(e + f*x)*sin(e + f*x)**2*a*c**2 - 480*cos(e + f*x)*sin(e 
 + f*x)**2*a*c*d - 304*cos(e + f*x)*sin(e + f*x)**2*a*d**2 - 240*cos(e + f 
*x)*sin(e + f*x)**2*b*c**2 - 608*cos(e + f*x)*sin(e + f*x)**2*b*c*d - 272* 
cos(e + f*x)*sin(e + f*x)**2*b*d**2 - 360*cos(e + f*x)*sin(e + f*x)*a*c**2 
 - 900*cos(e + f*x)*sin(e + f*x)*a*c*d - 390*cos(e + f*x)*sin(e + f*x)*a*d 
**2 - 450*cos(e + f*x)*sin(e + f*x)*b*c**2 - 780*cos(e + f*x)*sin(e + f*x) 
*b*c*d - 345*cos(e + f*x)*sin(e + f*x)*b*d**2 - 880*cos(e + f*x)*a*c**2 - 
1440*cos(e + f*x)*a*c*d - 608*cos(e + f*x)*a*d**2 - 720*cos(e + f*x)*b*c** 
2 - 1216*cos(e + f*x)*b*c*d - 544*cos(e + f*x)*b*d**2 + 600*a*c**2*f*x + 8 
80*a*c**2 + 900*a*c*d*f*x + 1440*a*c*d + 390*a*d**2*f*x + 608*a*d**2 + 450 
*b*c**2*f*x + 720*b*c**2 + 780*b*c*d*f*x + 1216*b*c*d + 345*b*d**2*f*x + 5 
44*b*d**2))/(240*f)