\(\int \frac {(a+a \sin (e+f x)) (A+B \sin (e+f x))}{(c+d \sin (e+f x))^3} \, dx\) [250]

Optimal result
Mathematica [C] (warning: unable to verify)
Rubi [A] (verified)
Maple [B] (verified)
Fricas [B] (verification not implemented)
Sympy [F(-1)]
Maxima [F(-2)]
Giac [B] (verification not implemented)
Mupad [B] (verification not implemented)
Reduce [B] (verification not implemented)

Optimal result

Integrand size = 33, antiderivative size = 176 \[ \int \frac {(a+a \sin (e+f x)) (A+B \sin (e+f x))}{(c+d \sin (e+f x))^3} \, dx=\frac {a (2 A c+B c-A d-2 B d) \arctan \left (\frac {d+c \tan \left (\frac {1}{2} (e+f x)\right )}{\sqrt {c^2-d^2}}\right )}{(c+d) \left (c^2-d^2\right )^{3/2} f}+\frac {a (B c-A d) \cos (e+f x)}{2 d (c+d) f (c+d \sin (e+f x))^2}-\frac {a \left (A (c-2 d) d+B \left (c^2+2 c d-2 d^2\right )\right ) \cos (e+f x)}{2 (c-d) d (c+d)^2 f (c+d \sin (e+f x))} \] Output:

a*(2*A*c-A*d+B*c-2*B*d)*arctan((d+c*tan(1/2*f*x+1/2*e))/(c^2-d^2)^(1/2))/( 
c+d)/(c^2-d^2)^(3/2)/f+1/2*a*(-A*d+B*c)*cos(f*x+e)/d/(c+d)/f/(c+d*sin(f*x+ 
e))^2-1/2*a*(A*(c-2*d)*d+B*(c^2+2*c*d-2*d^2))*cos(f*x+e)/(c-d)/d/(c+d)^2/f 
/(c+d*sin(f*x+e))
 

Mathematica [C] (warning: unable to verify)

Result contains complex when optimal does not.

Time = 5.41 (sec) , antiderivative size = 345, normalized size of antiderivative = 1.96 \[ \int \frac {(a+a \sin (e+f x)) (A+B \sin (e+f x))}{(c+d \sin (e+f x))^3} \, dx=\frac {a (1+\sin (e+f x)) \left (\frac {4 (2 A c+B c-A d-2 B d) \arctan \left (\frac {\sec \left (\frac {f x}{2}\right ) (\cos (e)-i \sin (e)) \left (d \cos \left (e+\frac {f x}{2}\right )+c \sin \left (\frac {f x}{2}\right )\right )}{\sqrt {c^2-d^2} \sqrt {(\cos (e)-i \sin (e))^2}}\right ) (\cos (e)-i \sin (e))}{\sqrt {c^2-d^2} \sqrt {(\cos (e)-i \sin (e))^2}}+\frac {\left (2 c^2+d^2\right ) \left (A (c-2 d) d+B \left (c^2+2 c d-2 d^2\right )\right ) \cot (e)+d \csc (e) \left (-d \left (A (c-2 d) d+B \left (c^2+2 c d-2 d^2\right )\right ) \cos (e+2 f x)+\left (B c \left (2 c^2+6 c d-5 d^2\right )-A d \left (-4 c^2+6 c d+d^2\right )\right ) \sin (f x)+\left (A d^2 (-2 c+d)+B c \left (2 c^2+2 c d-3 d^2\right )\right ) \sin (2 e+f x)\right )}{d^2 (c+d \sin (e+f x))^2}\right )}{4 (c-d) (c+d)^2 f \left (\cos \left (\frac {1}{2} (e+f x)\right )+\sin \left (\frac {1}{2} (e+f x)\right )\right )^2} \] Input:

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

Output:

(a*(1 + Sin[e + f*x])*((4*(2*A*c + B*c - A*d - 2*B*d)*ArcTan[(Sec[(f*x)/2] 
*(Cos[e] - I*Sin[e])*(d*Cos[e + (f*x)/2] + c*Sin[(f*x)/2]))/(Sqrt[c^2 - d^ 
2]*Sqrt[(Cos[e] - I*Sin[e])^2])]*(Cos[e] - I*Sin[e]))/(Sqrt[c^2 - d^2]*Sqr 
t[(Cos[e] - I*Sin[e])^2]) + ((2*c^2 + d^2)*(A*(c - 2*d)*d + B*(c^2 + 2*c*d 
 - 2*d^2))*Cot[e] + d*Csc[e]*(-(d*(A*(c - 2*d)*d + B*(c^2 + 2*c*d - 2*d^2) 
)*Cos[e + 2*f*x]) + (B*c*(2*c^2 + 6*c*d - 5*d^2) - A*d*(-4*c^2 + 6*c*d + d 
^2))*Sin[f*x] + (A*d^2*(-2*c + d) + B*c*(2*c^2 + 2*c*d - 3*d^2))*Sin[2*e + 
 f*x]))/(d^2*(c + d*Sin[e + f*x])^2)))/(4*(c - d)*(c + d)^2*f*(Cos[(e + f* 
x)/2] + Sin[(e + f*x)/2])^2)
 

Rubi [A] (verified)

Time = 0.85 (sec) , antiderivative size = 191, normalized size of antiderivative = 1.09, number of steps used = 14, number of rules used = 13, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.394, Rules used = {3042, 3447, 3042, 3500, 25, 3042, 3233, 25, 27, 3042, 3139, 1083, 217}

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 \frac {(a \sin (e+f x)+a) (A+B \sin (e+f x))}{(c+d \sin (e+f x))^3} \, dx\)

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 3447

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

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 3500

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

\(\Big \downarrow \) 25

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

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 3233

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

\(\Big \downarrow \) 25

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

\(\Big \downarrow \) 27

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

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 3139

\(\displaystyle \frac {\frac {2 a d (c-d) (2 A c-A d+B c-2 B d) \int \frac {1}{c \tan ^2\left (\frac {1}{2} (e+f x)\right )+2 d \tan \left (\frac {1}{2} (e+f x)\right )+c}d\tan \left (\frac {1}{2} (e+f x)\right )}{f \left (c^2-d^2\right )}-\frac {a \left (A d (c-2 d)+B \left (c^2+2 c d-2 d^2\right )\right ) \cos (e+f x)}{f (c+d) (c+d \sin (e+f x))}}{2 d \left (c^2-d^2\right )}+\frac {a (B c-A d) \cos (e+f x)}{2 d f (c+d) (c+d \sin (e+f x))^2}\)

\(\Big \downarrow \) 1083

\(\displaystyle \frac {-\frac {4 a d (c-d) (2 A c-A d+B c-2 B d) \int \frac {1}{-\left (2 d+2 c \tan \left (\frac {1}{2} (e+f x)\right )\right )^2-4 \left (c^2-d^2\right )}d\left (2 d+2 c \tan \left (\frac {1}{2} (e+f x)\right )\right )}{f \left (c^2-d^2\right )}-\frac {a \left (A d (c-2 d)+B \left (c^2+2 c d-2 d^2\right )\right ) \cos (e+f x)}{f (c+d) (c+d \sin (e+f x))}}{2 d \left (c^2-d^2\right )}+\frac {a (B c-A d) \cos (e+f x)}{2 d f (c+d) (c+d \sin (e+f x))^2}\)

\(\Big \downarrow \) 217

\(\displaystyle \frac {\frac {2 a d (c-d) (2 A c-A d+B c-2 B d) \arctan \left (\frac {2 c \tan \left (\frac {1}{2} (e+f x)\right )+2 d}{2 \sqrt {c^2-d^2}}\right )}{f \left (c^2-d^2\right )^{3/2}}-\frac {a \left (A d (c-2 d)+B \left (c^2+2 c d-2 d^2\right )\right ) \cos (e+f x)}{f (c+d) (c+d \sin (e+f x))}}{2 d \left (c^2-d^2\right )}+\frac {a (B c-A d) \cos (e+f x)}{2 d f (c+d) (c+d \sin (e+f x))^2}\)

Input:

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

Output:

(a*(B*c - A*d)*Cos[e + f*x])/(2*d*(c + d)*f*(c + d*Sin[e + f*x])^2) + ((2* 
a*(c - d)*d*(2*A*c + B*c - A*d - 2*B*d)*ArcTan[(2*d + 2*c*Tan[(e + f*x)/2] 
)/(2*Sqrt[c^2 - d^2])])/((c^2 - d^2)^(3/2)*f) - (a*(A*(c - 2*d)*d + B*(c^2 
 + 2*c*d - 2*d^2))*Cos[e + f*x])/((c + d)*f*(c + d*Sin[e + f*x])))/(2*d*(c 
^2 - d^2))
 

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 217
Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(-(Rt[-a, 2]*Rt[-b, 2])^( 
-1))*ArcTan[Rt[-b, 2]*(x/Rt[-a, 2])], x] /; FreeQ[{a, b}, x] && PosQ[a/b] & 
& (LtQ[a, 0] || LtQ[b, 0])
 

rule 1083
Int[((a_) + (b_.)*(x_) + (c_.)*(x_)^2)^(-1), x_Symbol] :> Simp[-2   Subst[I 
nt[1/Simp[b^2 - 4*a*c - x^2, x], x], x, b + 2*c*x], x] /; FreeQ[{a, b, c}, 
x]
 

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

rule 3139
Int[((a_) + (b_.)*sin[(c_.) + (d_.)*(x_)])^(-1), x_Symbol] :> With[{e = Fre 
eFactors[Tan[(c + d*x)/2], x]}, Simp[2*(e/d)   Subst[Int[1/(a + 2*b*e*x + a 
*e^2*x^2), x], x, Tan[(c + d*x)/2]/e], x]] /; FreeQ[{a, b, c, d}, x] && NeQ 
[a^2 - b^2, 0]
 

rule 3233
Int[((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*sin[(e_.) + 
(f_.)*(x_)]), x_Symbol] :> Simp[(-(b*c - a*d))*Cos[e + f*x]*((a + b*Sin[e + 
 f*x])^(m + 1)/(f*(m + 1)*(a^2 - b^2))), x] + Simp[1/((m + 1)*(a^2 - b^2)) 
  Int[(a + b*Sin[e + f*x])^(m + 1)*Simp[(a*c - b*d)*(m + 1) - (b*c - a*d)*( 
m + 2)*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] && LtQ[m, -1] && 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 3500
Int[((a_.) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_)*((A_.) + (B_.)*sin[(e_.) + 
 (f_.)*(x_)] + (C_.)*sin[(e_.) + (f_.)*(x_)]^2), x_Symbol] :> Simp[(-(A*b^2 
 - a*b*B + a^2*C))*Cos[e + f*x]*((a + b*Sin[e + f*x])^(m + 1)/(b*f*(m + 1)* 
(a^2 - b^2))), x] + Simp[1/(b*(m + 1)*(a^2 - b^2))   Int[(a + b*Sin[e + f*x 
])^(m + 1)*Simp[b*(a*A - b*B + a*C)*(m + 1) - (A*b^2 - a*b*B + a^2*C + b*(A 
*b - a*B + b*C)*(m + 1))*Sin[e + f*x], x], x], x] /; FreeQ[{a, b, e, f, A, 
B, C}, x] && LtQ[m, -1] && NeQ[a^2 - b^2, 0]
 
Maple [B] (verified)

Leaf count of result is larger than twice the leaf count of optimal. \(423\) vs. \(2(167)=334\).

Time = 0.73 (sec) , antiderivative size = 424, normalized size of antiderivative = 2.41

method result size
derivativedivides \(\frac {2 a \left (\frac {-\frac {\left (3 A \,c^{2} d -2 A c \,d^{2}-2 A \,d^{3}-B \,c^{3}+2 B \,c^{2} d \right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{3}}{2 c \left (c^{3}+c^{2} d -c \,d^{2}-d^{3}\right )}-\frac {\left (2 A \,c^{4}-2 A \,c^{3} d +3 A \,c^{2} d^{2}-4 A c \,d^{3}-2 A \,d^{4}+2 B \,c^{4}-B \,c^{3} d +4 B \,c^{2} d^{2}-2 B c \,d^{3}\right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{2}}{2 \left (c^{3}+c^{2} d -c \,d^{2}-d^{3}\right ) c^{2}}-\frac {\left (5 A \,c^{2} d -6 A c \,d^{2}-2 A \,d^{3}+B \,c^{3}+6 B \,c^{2} d -4 B c \,d^{2}\right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )}{2 c \left (c^{3}+c^{2} d -c \,d^{2}-d^{3}\right )}-\frac {2 A \,c^{2}-2 A c d -A \,d^{2}+2 B \,c^{2}-B c d}{2 \left (c^{3}+c^{2} d -c \,d^{2}-d^{3}\right )}}{\left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{2} c +2 d \tan \left (\frac {f x}{2}+\frac {e}{2}\right )+c \right )^{2}}+\frac {\left (2 A c -A d +B c -2 B d \right ) \arctan \left (\frac {2 c \tan \left (\frac {f x}{2}+\frac {e}{2}\right )+2 d}{2 \sqrt {c^{2}-d^{2}}}\right )}{2 \left (c^{3}+c^{2} d -c \,d^{2}-d^{3}\right ) \sqrt {c^{2}-d^{2}}}\right )}{f}\) \(424\)
default \(\frac {2 a \left (\frac {-\frac {\left (3 A \,c^{2} d -2 A c \,d^{2}-2 A \,d^{3}-B \,c^{3}+2 B \,c^{2} d \right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{3}}{2 c \left (c^{3}+c^{2} d -c \,d^{2}-d^{3}\right )}-\frac {\left (2 A \,c^{4}-2 A \,c^{3} d +3 A \,c^{2} d^{2}-4 A c \,d^{3}-2 A \,d^{4}+2 B \,c^{4}-B \,c^{3} d +4 B \,c^{2} d^{2}-2 B c \,d^{3}\right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{2}}{2 \left (c^{3}+c^{2} d -c \,d^{2}-d^{3}\right ) c^{2}}-\frac {\left (5 A \,c^{2} d -6 A c \,d^{2}-2 A \,d^{3}+B \,c^{3}+6 B \,c^{2} d -4 B c \,d^{2}\right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )}{2 c \left (c^{3}+c^{2} d -c \,d^{2}-d^{3}\right )}-\frac {2 A \,c^{2}-2 A c d -A \,d^{2}+2 B \,c^{2}-B c d}{2 \left (c^{3}+c^{2} d -c \,d^{2}-d^{3}\right )}}{\left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{2} c +2 d \tan \left (\frac {f x}{2}+\frac {e}{2}\right )+c \right )^{2}}+\frac {\left (2 A c -A d +B c -2 B d \right ) \arctan \left (\frac {2 c \tan \left (\frac {f x}{2}+\frac {e}{2}\right )+2 d}{2 \sqrt {c^{2}-d^{2}}}\right )}{2 \left (c^{3}+c^{2} d -c \,d^{2}-d^{3}\right ) \sqrt {c^{2}-d^{2}}}\right )}{f}\) \(424\)
risch \(\text {Expression too large to display}\) \(1073\)

Input:

int((a+a*sin(f*x+e))*(A+B*sin(f*x+e))/(c+d*sin(f*x+e))^3,x,method=_RETURNV 
ERBOSE)
 

Output:

2/f*a*((-1/2*(3*A*c^2*d-2*A*c*d^2-2*A*d^3-B*c^3+2*B*c^2*d)/c/(c^3+c^2*d-c* 
d^2-d^3)*tan(1/2*f*x+1/2*e)^3-1/2*(2*A*c^4-2*A*c^3*d+3*A*c^2*d^2-4*A*c*d^3 
-2*A*d^4+2*B*c^4-B*c^3*d+4*B*c^2*d^2-2*B*c*d^3)/(c^3+c^2*d-c*d^2-d^3)/c^2* 
tan(1/2*f*x+1/2*e)^2-1/2*(5*A*c^2*d-6*A*c*d^2-2*A*d^3+B*c^3+6*B*c^2*d-4*B* 
c*d^2)/c/(c^3+c^2*d-c*d^2-d^3)*tan(1/2*f*x+1/2*e)-1/2*(2*A*c^2-2*A*c*d-A*d 
^2+2*B*c^2-B*c*d)/(c^3+c^2*d-c*d^2-d^3))/(tan(1/2*f*x+1/2*e)^2*c+2*d*tan(1 
/2*f*x+1/2*e)+c)^2+1/2*(2*A*c-A*d+B*c-2*B*d)/(c^3+c^2*d-c*d^2-d^3)/(c^2-d^ 
2)^(1/2)*arctan(1/2*(2*c*tan(1/2*f*x+1/2*e)+2*d)/(c^2-d^2)^(1/2)))
 

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 441 vs. \(2 (167) = 334\).

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

integrate((a+a*sin(f*x+e))*(A+B*sin(f*x+e))/(c+d*sin(f*x+e))^3,x, algorith 
m="fricas")
 

Output:

[1/4*(2*(B*a*c^4 + (A + 2*B)*a*c^3*d - (2*A + 3*B)*a*c^2*d^2 - (A + 2*B)*a 
*c*d^3 + 2*(A + B)*a*d^4)*cos(f*x + e)*sin(f*x + e) + ((2*A + B)*a*c^3 - ( 
A + 2*B)*a*c^2*d + (2*A + B)*a*c*d^2 - (A + 2*B)*a*d^3 - ((2*A + B)*a*c*d^ 
2 - (A + 2*B)*a*d^3)*cos(f*x + e)^2 + 2*((2*A + B)*a*c^2*d - (A + 2*B)*a*c 
*d^2)*sin(f*x + e))*sqrt(-c^2 + d^2)*log(((2*c^2 - d^2)*cos(f*x + e)^2 - 2 
*c*d*sin(f*x + e) - c^2 - d^2 + 2*(c*cos(f*x + e)*sin(f*x + e) + d*cos(f*x 
 + e))*sqrt(-c^2 + d^2))/(d^2*cos(f*x + e)^2 - 2*c*d*sin(f*x + e) - c^2 - 
d^2)) + 2*(2*(A + B)*a*c^4 - (2*A + B)*a*c^3*d - (3*A + 2*B)*a*c^2*d^2 + ( 
2*A + B)*a*c*d^3 + A*a*d^4)*cos(f*x + e))/((c^5*d^2 + c^4*d^3 - 2*c^3*d^4 
- 2*c^2*d^5 + c*d^6 + d^7)*f*cos(f*x + e)^2 - 2*(c^6*d + c^5*d^2 - 2*c^4*d 
^3 - 2*c^3*d^4 + c^2*d^5 + c*d^6)*f*sin(f*x + e) - (c^7 + c^6*d - c^5*d^2 
- c^4*d^3 - c^3*d^4 - c^2*d^5 + c*d^6 + d^7)*f), 1/2*((B*a*c^4 + (A + 2*B) 
*a*c^3*d - (2*A + 3*B)*a*c^2*d^2 - (A + 2*B)*a*c*d^3 + 2*(A + B)*a*d^4)*co 
s(f*x + e)*sin(f*x + e) + ((2*A + B)*a*c^3 - (A + 2*B)*a*c^2*d + (2*A + B) 
*a*c*d^2 - (A + 2*B)*a*d^3 - ((2*A + B)*a*c*d^2 - (A + 2*B)*a*d^3)*cos(f*x 
 + e)^2 + 2*((2*A + B)*a*c^2*d - (A + 2*B)*a*c*d^2)*sin(f*x + e))*sqrt(c^2 
 - d^2)*arctan(-(c*sin(f*x + e) + d)/(sqrt(c^2 - d^2)*cos(f*x + e))) + (2* 
(A + B)*a*c^4 - (2*A + B)*a*c^3*d - (3*A + 2*B)*a*c^2*d^2 + (2*A + B)*a*c* 
d^3 + A*a*d^4)*cos(f*x + e))/((c^5*d^2 + c^4*d^3 - 2*c^3*d^4 - 2*c^2*d^5 + 
 c*d^6 + d^7)*f*cos(f*x + e)^2 - 2*(c^6*d + c^5*d^2 - 2*c^4*d^3 - 2*c^3...
 

Sympy [F(-1)]

Timed out. \[ \int \frac {(a+a \sin (e+f x)) (A+B \sin (e+f x))}{(c+d \sin (e+f x))^3} \, dx=\text {Timed out} \] Input:

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

Output:

Timed out
                                                                                    
                                                                                    
 

Maxima [F(-2)]

Exception generated. \[ \int \frac {(a+a \sin (e+f x)) (A+B \sin (e+f x))}{(c+d \sin (e+f x))^3} \, dx=\text {Exception raised: ValueError} \] Input:

integrate((a+a*sin(f*x+e))*(A+B*sin(f*x+e))/(c+d*sin(f*x+e))^3,x, algorith 
m="maxima")
 

Output:

Exception raised: ValueError >> Computation failed since Maxima requested 
additional constraints; using the 'assume' command before evaluation *may* 
 help (example of legal syntax is 'assume(4*d^2-4*c^2>0)', see `assume?` f 
or more de
 

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 570 vs. \(2 (167) = 334\).

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

integrate((a+a*sin(f*x+e))*(A+B*sin(f*x+e))/(c+d*sin(f*x+e))^3,x, algorith 
m="giac")
 

Output:

((2*A*a*c + B*a*c - A*a*d - 2*B*a*d)*(pi*floor(1/2*(f*x + e)/pi + 1/2)*sgn 
(c) + arctan((c*tan(1/2*f*x + 1/2*e) + d)/sqrt(c^2 - d^2)))/((c^3 + c^2*d 
- c*d^2 - d^3)*sqrt(c^2 - d^2)) + (B*a*c^4*tan(1/2*f*x + 1/2*e)^3 - 3*A*a* 
c^3*d*tan(1/2*f*x + 1/2*e)^3 - 2*B*a*c^3*d*tan(1/2*f*x + 1/2*e)^3 + 2*A*a* 
c^2*d^2*tan(1/2*f*x + 1/2*e)^3 + 2*A*a*c*d^3*tan(1/2*f*x + 1/2*e)^3 - 2*A* 
a*c^4*tan(1/2*f*x + 1/2*e)^2 - 2*B*a*c^4*tan(1/2*f*x + 1/2*e)^2 + 2*A*a*c^ 
3*d*tan(1/2*f*x + 1/2*e)^2 + B*a*c^3*d*tan(1/2*f*x + 1/2*e)^2 - 3*A*a*c^2* 
d^2*tan(1/2*f*x + 1/2*e)^2 - 4*B*a*c^2*d^2*tan(1/2*f*x + 1/2*e)^2 + 4*A*a* 
c*d^3*tan(1/2*f*x + 1/2*e)^2 + 2*B*a*c*d^3*tan(1/2*f*x + 1/2*e)^2 + 2*A*a* 
d^4*tan(1/2*f*x + 1/2*e)^2 - B*a*c^4*tan(1/2*f*x + 1/2*e) - 5*A*a*c^3*d*ta 
n(1/2*f*x + 1/2*e) - 6*B*a*c^3*d*tan(1/2*f*x + 1/2*e) + 6*A*a*c^2*d^2*tan( 
1/2*f*x + 1/2*e) + 4*B*a*c^2*d^2*tan(1/2*f*x + 1/2*e) + 2*A*a*c*d^3*tan(1/ 
2*f*x + 1/2*e) - 2*A*a*c^4 - 2*B*a*c^4 + 2*A*a*c^3*d + B*a*c^3*d + A*a*c^2 
*d^2)/((c^5 + c^4*d - c^3*d^2 - c^2*d^3)*(c*tan(1/2*f*x + 1/2*e)^2 + 2*d*t 
an(1/2*f*x + 1/2*e) + c)^2))/f
 

Mupad [B] (verification not implemented)

Time = 37.53 (sec) , antiderivative size = 554, normalized size of antiderivative = 3.15 \[ \int \frac {(a+a \sin (e+f x)) (A+B \sin (e+f x))}{(c+d \sin (e+f x))^3} \, dx=-\frac {\frac {A\,a\,d^2-2\,A\,a\,c^2-2\,B\,a\,c^2+2\,A\,a\,c\,d+B\,a\,c\,d}{-c^3-c^2\,d+c\,d^2+d^3}+\frac {a\,\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )\,\left (2\,A\,d^3-B\,c^3+6\,A\,c\,d^2-5\,A\,c^2\,d+4\,B\,c\,d^2-6\,B\,c^2\,d\right )}{c\,\left (-c^3-c^2\,d+c\,d^2+d^3\right )}+\frac {a\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^3\,\left (2\,A\,d^3+B\,c^3+2\,A\,c\,d^2-3\,A\,c^2\,d-2\,B\,c^2\,d\right )}{c\,\left (-c^3-c^2\,d+c\,d^2+d^3\right )}+\frac {a\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^2\,\left (c^2+2\,d^2\right )\,\left (A\,d^2-2\,A\,c^2-2\,B\,c^2+2\,A\,c\,d+B\,c\,d\right )}{c^2\,\left (-c^3-c^2\,d+c\,d^2+d^3\right )}}{f\,\left ({\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^2\,\left (2\,c^2+4\,d^2\right )+c^2\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^4+c^2+4\,c\,d\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^3+4\,c\,d\,\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )\right )}-\frac {a\,\mathrm {atan}\left (\frac {\left (\frac {a\,\left (2\,A\,c-A\,d+B\,c-2\,B\,d\right )\,\left (-2\,c^3\,d-2\,c^2\,d^2+2\,c\,d^3+2\,d^4\right )}{2\,{\left (c+d\right )}^{5/2}\,{\left (c-d\right )}^{3/2}\,\left (-c^3-c^2\,d+c\,d^2+d^3\right )}+\frac {a\,c\,\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )\,\left (2\,A\,c-A\,d+B\,c-2\,B\,d\right )}{{\left (c+d\right )}^{5/2}\,{\left (c-d\right )}^{3/2}}\right )\,\left (-c^3-c^2\,d+c\,d^2+d^3\right )}{2\,A\,a\,c-A\,a\,d+B\,a\,c-2\,B\,a\,d}\right )\,\left (2\,A\,c-A\,d+B\,c-2\,B\,d\right )}{f\,{\left (c+d\right )}^{5/2}\,{\left (c-d\right )}^{3/2}} \] Input:

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

Output:

- ((A*a*d^2 - 2*A*a*c^2 - 2*B*a*c^2 + 2*A*a*c*d + B*a*c*d)/(c*d^2 - c^2*d 
- c^3 + d^3) + (a*tan(e/2 + (f*x)/2)*(2*A*d^3 - B*c^3 + 6*A*c*d^2 - 5*A*c^ 
2*d + 4*B*c*d^2 - 6*B*c^2*d))/(c*(c*d^2 - c^2*d - c^3 + d^3)) + (a*tan(e/2 
 + (f*x)/2)^3*(2*A*d^3 + B*c^3 + 2*A*c*d^2 - 3*A*c^2*d - 2*B*c^2*d))/(c*(c 
*d^2 - c^2*d - c^3 + d^3)) + (a*tan(e/2 + (f*x)/2)^2*(c^2 + 2*d^2)*(A*d^2 
- 2*A*c^2 - 2*B*c^2 + 2*A*c*d + B*c*d))/(c^2*(c*d^2 - c^2*d - c^3 + d^3))) 
/(f*(tan(e/2 + (f*x)/2)^2*(2*c^2 + 4*d^2) + c^2*tan(e/2 + (f*x)/2)^4 + c^2 
 + 4*c*d*tan(e/2 + (f*x)/2)^3 + 4*c*d*tan(e/2 + (f*x)/2))) - (a*atan((((a* 
(2*A*c - A*d + B*c - 2*B*d)*(2*c*d^3 - 2*c^3*d + 2*d^4 - 2*c^2*d^2))/(2*(c 
 + d)^(5/2)*(c - d)^(3/2)*(c*d^2 - c^2*d - c^3 + d^3)) + (a*c*tan(e/2 + (f 
*x)/2)*(2*A*c - A*d + B*c - 2*B*d))/((c + d)^(5/2)*(c - d)^(3/2)))*(c*d^2 
- c^2*d - c^3 + d^3))/(2*A*a*c - A*a*d + B*a*c - 2*B*a*d))*(2*A*c - A*d + 
B*c - 2*B*d))/(f*(c + d)^(5/2)*(c - d)^(3/2))
 

Reduce [B] (verification not implemented)

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

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

Output:

(a*(8*sqrt(c**2 - d**2)*atan((tan((e + f*x)/2)*c + d)/sqrt(c**2 - d**2))*s 
in(e + f*x)**2*a*c**2*d**3 - 4*sqrt(c**2 - d**2)*atan((tan((e + f*x)/2)*c 
+ d)/sqrt(c**2 - d**2))*sin(e + f*x)**2*a*c*d**4 + 4*sqrt(c**2 - d**2)*ata 
n((tan((e + f*x)/2)*c + d)/sqrt(c**2 - d**2))*sin(e + f*x)**2*b*c**2*d**3 
- 8*sqrt(c**2 - d**2)*atan((tan((e + f*x)/2)*c + d)/sqrt(c**2 - d**2))*sin 
(e + f*x)**2*b*c*d**4 + 16*sqrt(c**2 - d**2)*atan((tan((e + f*x)/2)*c + d) 
/sqrt(c**2 - d**2))*sin(e + f*x)*a*c**3*d**2 - 8*sqrt(c**2 - d**2)*atan((t 
an((e + f*x)/2)*c + d)/sqrt(c**2 - d**2))*sin(e + f*x)*a*c**2*d**3 + 8*sqr 
t(c**2 - d**2)*atan((tan((e + f*x)/2)*c + d)/sqrt(c**2 - d**2))*sin(e + f* 
x)*b*c**3*d**2 - 16*sqrt(c**2 - d**2)*atan((tan((e + f*x)/2)*c + d)/sqrt(c 
**2 - d**2))*sin(e + f*x)*b*c**2*d**3 + 8*sqrt(c**2 - d**2)*atan((tan((e + 
 f*x)/2)*c + d)/sqrt(c**2 - d**2))*a*c**4*d - 4*sqrt(c**2 - d**2)*atan((ta 
n((e + f*x)/2)*c + d)/sqrt(c**2 - d**2))*a*c**3*d**2 + 4*sqrt(c**2 - d**2) 
*atan((tan((e + f*x)/2)*c + d)/sqrt(c**2 - d**2))*b*c**4*d - 8*sqrt(c**2 - 
 d**2)*atan((tan((e + f*x)/2)*c + d)/sqrt(c**2 - d**2))*b*c**3*d**2 - 2*co 
s(e + f*x)*sin(e + f*x)*a*c**4*d**2 + 4*cos(e + f*x)*sin(e + f*x)*a*c**3*d 
**3 + 2*cos(e + f*x)*sin(e + f*x)*a*c**2*d**4 - 4*cos(e + f*x)*sin(e + f*x 
)*a*c*d**5 - 2*cos(e + f*x)*sin(e + f*x)*b*c**5*d - 4*cos(e + f*x)*sin(e + 
 f*x)*b*c**4*d**2 + 6*cos(e + f*x)*sin(e + f*x)*b*c**3*d**3 + 4*cos(e + f* 
x)*sin(e + f*x)*b*c**2*d**4 - 4*cos(e + f*x)*sin(e + f*x)*b*c*d**5 - 4*...