\(\int \frac {1}{(a+a \sin (e+f x))^2 (c+d \sin (e+f x))} \, dx\) [475]

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

Optimal result

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

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

Mathematica [A] (verified)

Time = 1.59 (sec) , antiderivative size = 204, normalized size of antiderivative = 1.56 \[ \int \frac {1}{(a+a \sin (e+f x))^2 (c+d \sin (e+f x))} \, dx=\frac {\left (\cos \left (\frac {1}{2} (e+f x)\right )+\sin \left (\frac {1}{2} (e+f x)\right )\right ) \left (2 (c-d) \sin \left (\frac {1}{2} (e+f x)\right )-(c-d) \left (\cos \left (\frac {1}{2} (e+f x)\right )+\sin \left (\frac {1}{2} (e+f x)\right )\right )+2 (c-4 d) \sin \left (\frac {1}{2} (e+f x)\right ) \left (\cos \left (\frac {1}{2} (e+f x)\right )+\sin \left (\frac {1}{2} (e+f x)\right )\right )^2+\frac {6 d^2 \arctan \left (\frac {d+c \tan \left (\frac {1}{2} (e+f x)\right )}{\sqrt {c^2-d^2}}\right ) \left (\cos \left (\frac {1}{2} (e+f x)\right )+\sin \left (\frac {1}{2} (e+f x)\right )\right )^3}{\sqrt {c^2-d^2}}\right )}{3 a^2 (c-d)^2 f (1+\sin (e+f x))^2} \] Input:

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

Output:

((Cos[(e + f*x)/2] + Sin[(e + f*x)/2])*(2*(c - d)*Sin[(e + f*x)/2] - (c - 
d)*(Cos[(e + f*x)/2] + Sin[(e + f*x)/2]) + 2*(c - 4*d)*Sin[(e + f*x)/2]*(C 
os[(e + f*x)/2] + Sin[(e + f*x)/2])^2 + (6*d^2*ArcTan[(d + c*Tan[(e + f*x) 
/2])/Sqrt[c^2 - d^2]]*(Cos[(e + f*x)/2] + Sin[(e + f*x)/2])^3)/Sqrt[c^2 - 
d^2]))/(3*a^2*(c - d)^2*f*(1 + Sin[e + f*x])^2)
 

Rubi [A] (verified)

Time = 0.60 (sec) , antiderivative size = 144, normalized size of antiderivative = 1.10, number of steps used = 11, number of rules used = 10, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.400, Rules used = {3042, 3245, 25, 3042, 3457, 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 {1}{(a \sin (e+f x)+a)^2 (c+d \sin (e+f x))} \, dx\)

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 3245

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

\(\Big \downarrow \) 25

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

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 3457

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

\(\Big \downarrow \) 27

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

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 3139

\(\displaystyle \frac {\frac {6 d^2 \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 (c-d)}-\frac {(c-4 d) \cos (e+f x)}{f (c-d) (\sin (e+f x)+1)}}{3 a^2 (c-d)}-\frac {\cos (e+f x)}{3 f (c-d) (a \sin (e+f x)+a)^2}\)

\(\Big \downarrow \) 1083

\(\displaystyle \frac {-\frac {12 d^2 \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 (c-d)}-\frac {(c-4 d) \cos (e+f x)}{f (c-d) (\sin (e+f x)+1)}}{3 a^2 (c-d)}-\frac {\cos (e+f x)}{3 f (c-d) (a \sin (e+f x)+a)^2}\)

\(\Big \downarrow \) 217

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

Input:

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

Output:

-1/3*Cos[e + f*x]/((c - d)*f*(a + a*Sin[e + f*x])^2) + ((6*d^2*ArcTan[(2*d 
 + 2*c*Tan[(e + f*x)/2])/(2*Sqrt[c^2 - d^2])])/((c - d)*Sqrt[c^2 - d^2]*f) 
 - ((c - 4*d)*Cos[e + f*x])/((c - d)*f*(1 + Sin[e + f*x])))/(3*a^2*(c - 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 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 3245
Int[((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*sin[(e_.) + 
(f_.)*(x_)])^(n_), x_Symbol] :> Simp[b^2*Cos[e + f*x]*(a + b*Sin[e + f*x])^ 
m*((c + d*Sin[e + f*x])^(n + 1)/(a*f*(2*m + 1)*(b*c - a*d))), x] + Simp[1/( 
a*(2*m + 1)*(b*c - a*d))   Int[(a + b*Sin[e + f*x])^(m + 1)*(c + d*Sin[e + 
f*x])^n*Simp[b*c*(m + 1) - a*d*(2*m + n + 2) + b*d*(m + n + 2)*Sin[e + f*x] 
, x], x], x] /; FreeQ[{a, b, c, d, e, f, n}, x] && NeQ[b*c - a*d, 0] && EqQ 
[a^2 - b^2, 0] && NeQ[c^2 - d^2, 0] && LtQ[m, -1] &&  !GtQ[n, 0] && (Intege 
rsQ[2*m, 2*n] || (IntegerQ[m] && EqQ[c, 0]))
 

rule 3457
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*(A*b - a*B)*Cos[e + f*x]*(a + b*Sin[e + f*x])^m*((c + d*Sin[e + f*x])^( 
n + 1)/(a*f*(2*m + 1)*(b*c - a*d))), x] + Simp[1/(a*(2*m + 1)*(b*c - a*d)) 
  Int[(a + b*Sin[e + f*x])^(m + 1)*(c + d*Sin[e + f*x])^n*Simp[B*(a*c*m + b 
*d*(n + 1)) + A*(b*c*(m + 1) - a*d*(2*m + n + 2)) + d*(A*b - a*B)*(m + n + 
2)*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] && LtQ[m, -2^(-1)] 
 &&  !GtQ[n, 0] && IntegerQ[2*m] && (IntegerQ[2*n] || EqQ[c, 0])
 
Maple [A] (verified)

Time = 0.84 (sec) , antiderivative size = 132, normalized size of antiderivative = 1.01

method result size
derivativedivides \(\frac {-\frac {2 \left (c -2 d \right )}{\left (c -d \right )^{2} \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1\right )}-\frac {4}{3 \left (c -d \right ) \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1\right )^{3}}+\frac {2}{\left (c -d \right ) \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1\right )^{2}}+\frac {2 d^{2} \arctan \left (\frac {2 c \tan \left (\frac {f x}{2}+\frac {e}{2}\right )+2 d}{2 \sqrt {c^{2}-d^{2}}}\right )}{\left (c -d \right )^{2} \sqrt {c^{2}-d^{2}}}}{a^{2} f}\) \(132\)
default \(\frac {-\frac {2 \left (c -2 d \right )}{\left (c -d \right )^{2} \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1\right )}-\frac {4}{3 \left (c -d \right ) \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1\right )^{3}}+\frac {2}{\left (c -d \right ) \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1\right )^{2}}+\frac {2 d^{2} \arctan \left (\frac {2 c \tan \left (\frac {f x}{2}+\frac {e}{2}\right )+2 d}{2 \sqrt {c^{2}-d^{2}}}\right )}{\left (c -d \right )^{2} \sqrt {c^{2}-d^{2}}}}{a^{2} f}\) \(132\)
risch \(\frac {2 d \,{\mathrm e}^{2 i \left (f x +e \right )}+\frac {2 c}{3}-\frac {8 d}{3}-2 i c \,{\mathrm e}^{i \left (f x +e \right )}+6 i d \,{\mathrm e}^{i \left (f x +e \right )}}{\left ({\mathrm e}^{i \left (f x +e \right )}+i\right )^{3} \left (c -d \right )^{2} f \,a^{2}}-\frac {d^{2} \ln \left ({\mathrm e}^{i \left (f x +e \right )}+\frac {i c \sqrt {-c^{2}+d^{2}}-c^{2}+d^{2}}{\sqrt {-c^{2}+d^{2}}\, d}\right )}{\sqrt {-c^{2}+d^{2}}\, \left (c -d \right )^{2} f \,a^{2}}+\frac {d^{2} \ln \left ({\mathrm e}^{i \left (f x +e \right )}+\frac {i c \sqrt {-c^{2}+d^{2}}+c^{2}-d^{2}}{\sqrt {-c^{2}+d^{2}}\, d}\right )}{\sqrt {-c^{2}+d^{2}}\, \left (c -d \right )^{2} f \,a^{2}}\) \(231\)

Input:

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

Output:

2/f/a^2*(-(c-2*d)/(c-d)^2/(tan(1/2*f*x+1/2*e)+1)-2/3/(c-d)/(tan(1/2*f*x+1/ 
2*e)+1)^3+1/(c-d)/(tan(1/2*f*x+1/2*e)+1)^2+d^2/(c-d)^2/(c^2-d^2)^(1/2)*arc 
tan(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. 450 vs. \(2 (122) = 244\).

Time = 0.11 (sec) , antiderivative size = 989, normalized size of antiderivative = 7.55 \[ \int \frac {1}{(a+a \sin (e+f x))^2 (c+d \sin (e+f x))} \, dx =\text {Too large to display} \] Input:

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

Output:

[1/6*(2*c^3 - 2*c^2*d - 2*c*d^2 + 2*d^3 + 2*(c^3 - 4*c^2*d - c*d^2 + 4*d^3 
)*cos(f*x + e)^2 - 3*(d^2*cos(f*x + e)^2 - d^2*cos(f*x + e) - 2*d^2 - (d^2 
*cos(f*x + e) + 2*d^2)*sin(f*x + e))*sqrt(-c^2 + d^2)*log(((2*c^2 - d^2)*c 
os(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*c^3 - 5*c^2*d - 2*c*d^2 + 5*d^3)*cos(f*x + e 
) - 2*(c^3 - c^2*d - c*d^2 + d^3 - (c^3 - 4*c^2*d - c*d^2 + 4*d^3)*cos(f*x 
 + e))*sin(f*x + e))/((a^2*c^4 - 2*a^2*c^3*d + 2*a^2*c*d^3 - a^2*d^4)*f*co 
s(f*x + e)^2 - (a^2*c^4 - 2*a^2*c^3*d + 2*a^2*c*d^3 - a^2*d^4)*f*cos(f*x + 
 e) - 2*(a^2*c^4 - 2*a^2*c^3*d + 2*a^2*c*d^3 - a^2*d^4)*f - ((a^2*c^4 - 2* 
a^2*c^3*d + 2*a^2*c*d^3 - a^2*d^4)*f*cos(f*x + e) + 2*(a^2*c^4 - 2*a^2*c^3 
*d + 2*a^2*c*d^3 - a^2*d^4)*f)*sin(f*x + e)), 1/3*(c^3 - c^2*d - c*d^2 + d 
^3 + (c^3 - 4*c^2*d - c*d^2 + 4*d^3)*cos(f*x + e)^2 - 3*(d^2*cos(f*x + e)^ 
2 - d^2*cos(f*x + e) - 2*d^2 - (d^2*cos(f*x + e) + 2*d^2)*sin(f*x + e))*sq 
rt(c^2 - d^2)*arctan(-(c*sin(f*x + e) + d)/(sqrt(c^2 - d^2)*cos(f*x + e))) 
 + (2*c^3 - 5*c^2*d - 2*c*d^2 + 5*d^3)*cos(f*x + e) - (c^3 - c^2*d - c*d^2 
 + d^3 - (c^3 - 4*c^2*d - c*d^2 + 4*d^3)*cos(f*x + e))*sin(f*x + e))/((a^2 
*c^4 - 2*a^2*c^3*d + 2*a^2*c*d^3 - a^2*d^4)*f*cos(f*x + e)^2 - (a^2*c^4 - 
2*a^2*c^3*d + 2*a^2*c*d^3 - a^2*d^4)*f*cos(f*x + e) - 2*(a^2*c^4 - 2*a^2*c 
^3*d + 2*a^2*c*d^3 - a^2*d^4)*f - ((a^2*c^4 - 2*a^2*c^3*d + 2*a^2*c*d^3...
 

Sympy [F(-1)]

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

integrate(1/(a+a*sin(f*x+e))**2/(c+d*sin(f*x+e)),x)
 

Output:

Timed out
 

Maxima [F(-2)]

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

integrate(1/(a+a*sin(f*x+e))^2/(c+d*sin(f*x+e)),x, algorithm="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 [A] (verification not implemented)

Time = 0.15 (sec) , antiderivative size = 188, normalized size of antiderivative = 1.44 \[ \int \frac {1}{(a+a \sin (e+f x))^2 (c+d \sin (e+f x))} \, dx=\frac {2 \, {\left (\frac {3 \, {\left (\pi \left \lfloor \frac {f x + e}{2 \, \pi } + \frac {1}{2} \right \rfloor \mathrm {sgn}\left (c\right ) + \arctan \left (\frac {c \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + d}{\sqrt {c^{2} - d^{2}}}\right )\right )} d^{2}}{{\left (a^{2} c^{2} - 2 \, a^{2} c d + a^{2} d^{2}\right )} \sqrt {c^{2} - d^{2}}} - \frac {3 \, c \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} - 6 \, d \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} + 3 \, c \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) - 9 \, d \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + 2 \, c - 5 \, d}{{\left (a^{2} c^{2} - 2 \, a^{2} c d + a^{2} d^{2}\right )} {\left (\tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + 1\right )}^{3}}\right )}}{3 \, f} \] Input:

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

Output:

2/3*(3*(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)))*d^2/((a^2*c^2 - 2*a^2*c*d + a^2*d^2)*sqrt(c^ 
2 - d^2)) - (3*c*tan(1/2*f*x + 1/2*e)^2 - 6*d*tan(1/2*f*x + 1/2*e)^2 + 3*c 
*tan(1/2*f*x + 1/2*e) - 9*d*tan(1/2*f*x + 1/2*e) + 2*c - 5*d)/((a^2*c^2 - 
2*a^2*c*d + a^2*d^2)*(tan(1/2*f*x + 1/2*e) + 1)^3))/f
 

Mupad [B] (verification not implemented)

Time = 17.22 (sec) , antiderivative size = 250, normalized size of antiderivative = 1.91 \[ \int \frac {1}{(a+a \sin (e+f x))^2 (c+d \sin (e+f x))} \, dx=\frac {2\,d^2\,\mathrm {atan}\left (\frac {\frac {d^2\,\left (2\,a^2\,c^2\,d-4\,a^2\,c\,d^2+2\,a^2\,d^3\right )}{a^2\,\sqrt {c+d}\,{\left (c-d\right )}^{5/2}}+\frac {2\,c\,d^2\,\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )\,\left (a^2\,c^2-2\,a^2\,c\,d+a^2\,d^2\right )}{a^2\,\sqrt {c+d}\,{\left (c-d\right )}^{5/2}}}{2\,d^2}\right )}{a^2\,f\,\sqrt {c+d}\,{\left (c-d\right )}^{5/2}}-\frac {\frac {2\,\left (2\,c-5\,d\right )}{3\,{\left (c-d\right )}^2}+\frac {2\,\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )\,\left (c-3\,d\right )}{{\left (c-d\right )}^2}+\frac {2\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^2\,\left (c-2\,d\right )}{{\left (c-d\right )}^2}}{f\,\left (a^2\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^3+3\,a^2\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^2+3\,a^2\,\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )+a^2\right )} \] Input:

int(1/((a + a*sin(e + f*x))^2*(c + d*sin(e + f*x))),x)
 

Output:

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

Reduce [B] (verification not implemented)

Time = 0.19 (sec) , antiderivative size = 535, normalized size of antiderivative = 4.08 \[ \int \frac {1}{(a+a \sin (e+f x))^2 (c+d \sin (e+f x))} \, dx=\frac {2 \sqrt {c^{2}-d^{2}}\, \mathit {atan} \left (\frac {\tan \left (\frac {f x}{2}+\frac {e}{2}\right ) c +d}{\sqrt {c^{2}-d^{2}}}\right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{3} d^{2}+6 \sqrt {c^{2}-d^{2}}\, \mathit {atan} \left (\frac {\tan \left (\frac {f x}{2}+\frac {e}{2}\right ) c +d}{\sqrt {c^{2}-d^{2}}}\right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{2} d^{2}+6 \sqrt {c^{2}-d^{2}}\, \mathit {atan} \left (\frac {\tan \left (\frac {f x}{2}+\frac {e}{2}\right ) c +d}{\sqrt {c^{2}-d^{2}}}\right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right ) d^{2}+2 \sqrt {c^{2}-d^{2}}\, \mathit {atan} \left (\frac {\tan \left (\frac {f x}{2}+\frac {e}{2}\right ) c +d}{\sqrt {c^{2}-d^{2}}}\right ) d^{2}+\frac {2 \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{3} c^{3}}{3}-\frac {4 \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{3} c^{2} d}{3}-\frac {2 \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{3} c \,d^{2}}{3}+\frac {4 \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{3} d^{3}}{3}+2 \tan \left (\frac {f x}{2}+\frac {e}{2}\right ) c^{2} d -2 \tan \left (\frac {f x}{2}+\frac {e}{2}\right ) d^{3}-\frac {2 c^{3}}{3}+2 c^{2} d +\frac {2 c \,d^{2}}{3}-2 d^{3}}{a^{2} f \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{3} c^{4}-2 \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{3} c^{3} d +2 \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{3} c \,d^{3}-\tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{3} d^{4}+3 \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{2} c^{4}-6 \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{2} c^{3} d +6 \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{2} c \,d^{3}-3 \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{2} d^{4}+3 \tan \left (\frac {f x}{2}+\frac {e}{2}\right ) c^{4}-6 \tan \left (\frac {f x}{2}+\frac {e}{2}\right ) c^{3} d +6 \tan \left (\frac {f x}{2}+\frac {e}{2}\right ) c \,d^{3}-3 \tan \left (\frac {f x}{2}+\frac {e}{2}\right ) d^{4}+c^{4}-2 c^{3} d +2 c \,d^{3}-d^{4}\right )} \] Input:

int(1/(a+a*sin(f*x+e))^2/(c+d*sin(f*x+e)),x)
 

Output:

(2*(3*sqrt(c**2 - d**2)*atan((tan((e + f*x)/2)*c + d)/sqrt(c**2 - d**2))*t 
an((e + f*x)/2)**3*d**2 + 9*sqrt(c**2 - d**2)*atan((tan((e + f*x)/2)*c + d 
)/sqrt(c**2 - d**2))*tan((e + f*x)/2)**2*d**2 + 9*sqrt(c**2 - d**2)*atan(( 
tan((e + f*x)/2)*c + d)/sqrt(c**2 - d**2))*tan((e + f*x)/2)*d**2 + 3*sqrt( 
c**2 - d**2)*atan((tan((e + f*x)/2)*c + d)/sqrt(c**2 - d**2))*d**2 + tan(( 
e + f*x)/2)**3*c**3 - 2*tan((e + f*x)/2)**3*c**2*d - tan((e + f*x)/2)**3*c 
*d**2 + 2*tan((e + f*x)/2)**3*d**3 + 3*tan((e + f*x)/2)*c**2*d - 3*tan((e 
+ f*x)/2)*d**3 - c**3 + 3*c**2*d + c*d**2 - 3*d**3))/(3*a**2*f*(tan((e + f 
*x)/2)**3*c**4 - 2*tan((e + f*x)/2)**3*c**3*d + 2*tan((e + f*x)/2)**3*c*d* 
*3 - tan((e + f*x)/2)**3*d**4 + 3*tan((e + f*x)/2)**2*c**4 - 6*tan((e + f* 
x)/2)**2*c**3*d + 6*tan((e + f*x)/2)**2*c*d**3 - 3*tan((e + f*x)/2)**2*d** 
4 + 3*tan((e + f*x)/2)*c**4 - 6*tan((e + f*x)/2)*c**3*d + 6*tan((e + f*x)/ 
2)*c*d**3 - 3*tan((e + f*x)/2)*d**4 + c**4 - 2*c**3*d + 2*c*d**3 - d**4))