\(\int \frac {x}{(a+b \sin ^2(c+d x))^2} \, dx\) [4]

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

Optimal result

Integrand size = 16, antiderivative size = 329 \[ \int \frac {x}{\left (a+b \sin ^2(c+d x)\right )^2} \, dx=-\frac {i (2 a+b) x \log \left (1-\frac {b e^{2 i (c+d x)}}{2 a+b-2 \sqrt {a} \sqrt {a+b}}\right )}{4 a^{3/2} (a+b)^{3/2} d}+\frac {i (2 a+b) x \log \left (1-\frac {b e^{2 i (c+d x)}}{2 a+b+2 \sqrt {a} \sqrt {a+b}}\right )}{4 a^{3/2} (a+b)^{3/2} d}-\frac {\log (2 a+b-b \cos (2 c+2 d x))}{4 a (a+b) d^2}-\frac {(2 a+b) \operatorname {PolyLog}\left (2,\frac {b e^{2 i (c+d x)}}{2 a+b-2 \sqrt {a} \sqrt {a+b}}\right )}{8 a^{3/2} (a+b)^{3/2} d^2}+\frac {(2 a+b) \operatorname {PolyLog}\left (2,\frac {b e^{2 i (c+d x)}}{2 a+b+2 \sqrt {a} \sqrt {a+b}}\right )}{8 a^{3/2} (a+b)^{3/2} d^2}+\frac {b x \sin (2 c+2 d x)}{2 a (a+b) d (2 a+b-b \cos (2 c+2 d x))} \] Output:

-1/4*I*(2*a+b)*x*ln(1-b*exp(2*I*(d*x+c))/(2*a+b-2*a^(1/2)*(a+b)^(1/2)))/a^ 
(3/2)/(a+b)^(3/2)/d+1/4*I*(2*a+b)*x*ln(1-b*exp(2*I*(d*x+c))/(2*a+b+2*a^(1/ 
2)*(a+b)^(1/2)))/a^(3/2)/(a+b)^(3/2)/d-1/4*ln(2*a+b-b*cos(2*d*x+2*c))/a/(a 
+b)/d^2-1/8*(2*a+b)*polylog(2,b*exp(2*I*(d*x+c))/(2*a+b-2*a^(1/2)*(a+b)^(1 
/2)))/a^(3/2)/(a+b)^(3/2)/d^2+1/8*(2*a+b)*polylog(2,b*exp(2*I*(d*x+c))/(2* 
a+b+2*a^(1/2)*(a+b)^(1/2)))/a^(3/2)/(a+b)^(3/2)/d^2+1/2*b*x*sin(2*d*x+2*c) 
/a/(a+b)/d/(2*a+b-b*cos(2*d*x+2*c))
 

Mathematica [B] (warning: unable to verify)

Both result and optimal contain complex but leaf count is larger than twice the leaf count of optimal. \(855\) vs. \(2(329)=658\).

Time = 14.96 (sec) , antiderivative size = 855, normalized size of antiderivative = 2.60 \[ \int \frac {x}{\left (a+b \sin ^2(c+d x)\right )^2} \, dx=\frac {b c \sin (2 (c+d x))-b (c+d x) \sin (2 (c+d x))}{2 a (a+b) d^2 (-2 a-b+b \cos (2 (c+d x)))}+\frac {\cos ^2(c+d x) \left (-\frac {4 (2 a+b) c \arctan \left (\frac {\sqrt {a+b} \tan (c+d x)}{\sqrt {a}}\right )}{\sqrt {a} \sqrt {a+b}}+2 \log \left (\sec ^2(c+d x)\right )-2 \log \left (a+(a+b) \tan ^2(c+d x)\right )-\frac {i (2 a+b) \left (\log (1-i \tan (c+d x)) \log \left (\frac {\sqrt {a}-\sqrt {-a-b} \tan (c+d x)}{\sqrt {a}+i \sqrt {-a-b}}\right )+\operatorname {PolyLog}\left (2,\frac {\sqrt {-a-b} (1-i \tan (c+d x))}{-i \sqrt {a}+\sqrt {-a-b}}\right )\right )}{\sqrt {a} \sqrt {-a-b}}+\frac {i (2 a+b) \left (\log (1-i \tan (c+d x)) \log \left (\frac {\sqrt {a}+\sqrt {-a-b} \tan (c+d x)}{\sqrt {a}-i \sqrt {-a-b}}\right )+\operatorname {PolyLog}\left (2,\frac {\sqrt {-a-b} (1-i \tan (c+d x))}{i \sqrt {a}+\sqrt {-a-b}}\right )\right )}{\sqrt {a} \sqrt {-a-b}}-\frac {i (2 a+b) \left (\log (1+i \tan (c+d x)) \log \left (\frac {\sqrt {a}+\sqrt {-a-b} \tan (c+d x)}{\sqrt {a}+i \sqrt {-a-b}}\right )+\operatorname {PolyLog}\left (2,\frac {\sqrt {-a-b} (1+i \tan (c+d x))}{-i \sqrt {a}+\sqrt {-a-b}}\right )\right )}{\sqrt {a} \sqrt {-a-b}}+\frac {i (2 a+b) \left (\log (1+i \tan (c+d x)) \log \left (\frac {\sqrt {a}-\sqrt {-a-b} \tan (c+d x)}{\sqrt {a}-i \sqrt {-a-b}}\right )+\operatorname {PolyLog}\left (2,\frac {\sqrt {-a-b} (1+i \tan (c+d x))}{i \sqrt {a}+\sqrt {-a-b}}\right )\right )}{\sqrt {a} \sqrt {-a-b}}\right ) (2 (2 a+b) d x-b \sin (2 (c+d x))) \left (\sqrt {a}-\sqrt {-a-b} \tan (c+d x)\right ) \left (\sqrt {a}+\sqrt {-a-b} \tan (c+d x)\right )}{4 a (a+b) d^2 (-2 a-b+b \cos (2 (c+d x))) ((2 a+b) (2 c-i \log (1-i \tan (c+d x))+i \log (1+i \tan (c+d x)))+b \sin (2 (c+d x)))} \] Input:

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

Output:

(b*c*Sin[2*(c + d*x)] - b*(c + d*x)*Sin[2*(c + d*x)])/(2*a*(a + b)*d^2*(-2 
*a - b + b*Cos[2*(c + d*x)])) + (Cos[c + d*x]^2*((-4*(2*a + b)*c*ArcTan[(S 
qrt[a + b]*Tan[c + d*x])/Sqrt[a]])/(Sqrt[a]*Sqrt[a + b]) + 2*Log[Sec[c + d 
*x]^2] - 2*Log[a + (a + b)*Tan[c + d*x]^2] - (I*(2*a + b)*(Log[1 - I*Tan[c 
 + d*x]]*Log[(Sqrt[a] - Sqrt[-a - b]*Tan[c + d*x])/(Sqrt[a] + I*Sqrt[-a - 
b])] + PolyLog[2, (Sqrt[-a - b]*(1 - I*Tan[c + d*x]))/((-I)*Sqrt[a] + Sqrt 
[-a - b])]))/(Sqrt[a]*Sqrt[-a - b]) + (I*(2*a + b)*(Log[1 - I*Tan[c + d*x] 
]*Log[(Sqrt[a] + Sqrt[-a - b]*Tan[c + d*x])/(Sqrt[a] - I*Sqrt[-a - b])] + 
PolyLog[2, (Sqrt[-a - b]*(1 - I*Tan[c + d*x]))/(I*Sqrt[a] + Sqrt[-a - b])] 
))/(Sqrt[a]*Sqrt[-a - b]) - (I*(2*a + b)*(Log[1 + I*Tan[c + d*x]]*Log[(Sqr 
t[a] + Sqrt[-a - b]*Tan[c + d*x])/(Sqrt[a] + I*Sqrt[-a - b])] + PolyLog[2, 
 (Sqrt[-a - b]*(1 + I*Tan[c + d*x]))/((-I)*Sqrt[a] + Sqrt[-a - b])]))/(Sqr 
t[a]*Sqrt[-a - b]) + (I*(2*a + b)*(Log[1 + I*Tan[c + d*x]]*Log[(Sqrt[a] - 
Sqrt[-a - b]*Tan[c + d*x])/(Sqrt[a] - I*Sqrt[-a - b])] + PolyLog[2, (Sqrt[ 
-a - b]*(1 + I*Tan[c + d*x]))/(I*Sqrt[a] + Sqrt[-a - b])]))/(Sqrt[a]*Sqrt[ 
-a - b]))*(2*(2*a + b)*d*x - b*Sin[2*(c + d*x)])*(Sqrt[a] - Sqrt[-a - b]*T 
an[c + d*x])*(Sqrt[a] + Sqrt[-a - b]*Tan[c + d*x]))/(4*a*(a + b)*d^2*(-2*a 
 - b + b*Cos[2*(c + d*x)])*((2*a + b)*(2*c - I*Log[1 - I*Tan[c + d*x]] + I 
*Log[1 + I*Tan[c + d*x]]) + b*Sin[2*(c + d*x)]))
 

Rubi [A] (verified)

Time = 1.19 (sec) , antiderivative size = 329, normalized size of antiderivative = 1.00, number of steps used = 15, number of rules used = 14, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.875, Rules used = {5096, 3042, 3805, 25, 3042, 3147, 16, 3802, 25, 2694, 27, 2620, 2715, 2838}

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 {x}{\left (a+b \sin ^2(c+d x)\right )^2} \, dx\)

\(\Big \downarrow \) 5096

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

\(\Big \downarrow \) 3042

\(\displaystyle 4 \int \frac {x}{\left (2 a+b-b \sin \left (2 c+2 d x+\frac {\pi }{2}\right )\right )^2}dx\)

\(\Big \downarrow \) 3805

\(\displaystyle 4 \left (\frac {(2 a+b) \int \frac {x}{2 a+b-b \cos (2 c+2 d x)}dx}{4 a (a+b)}+\frac {b \int -\frac {\sin (2 c+2 d x)}{2 a+b-b \cos (2 c+2 d x)}dx}{8 a d (a+b)}+\frac {b x \sin (2 c+2 d x)}{8 a d (a+b) (2 a-b \cos (2 c+2 d x)+b)}\right )\)

\(\Big \downarrow \) 25

\(\displaystyle 4 \left (\frac {(2 a+b) \int \frac {x}{2 a+b-b \cos (2 c+2 d x)}dx}{4 a (a+b)}-\frac {b \int \frac {\sin (2 c+2 d x)}{2 a+b-b \cos (2 c+2 d x)}dx}{8 a d (a+b)}+\frac {b x \sin (2 c+2 d x)}{8 a d (a+b) (2 a-b \cos (2 c+2 d x)+b)}\right )\)

\(\Big \downarrow \) 3042

\(\displaystyle 4 \left (\frac {(2 a+b) \int \frac {x}{2 a+b-b \sin \left (2 c+2 d x+\frac {\pi }{2}\right )}dx}{4 a (a+b)}-\frac {b \int \frac {\cos \left (2 c+2 d x-\frac {\pi }{2}\right )}{2 a+b+b \sin \left (2 c+2 d x-\frac {\pi }{2}\right )}dx}{8 a d (a+b)}+\frac {b x \sin (2 c+2 d x)}{8 a d (a+b) (2 a-b \cos (2 c+2 d x)+b)}\right )\)

\(\Big \downarrow \) 3147

\(\displaystyle 4 \left (-\frac {\int \frac {1}{2 a+b-b \cos (2 c+2 d x)}d(-b \cos (2 c+2 d x))}{16 a d^2 (a+b)}+\frac {(2 a+b) \int \frac {x}{2 a+b-b \sin \left (2 c+2 d x+\frac {\pi }{2}\right )}dx}{4 a (a+b)}+\frac {b x \sin (2 c+2 d x)}{8 a d (a+b) (2 a-b \cos (2 c+2 d x)+b)}\right )\)

\(\Big \downarrow \) 16

\(\displaystyle 4 \left (\frac {(2 a+b) \int \frac {x}{2 a+b-b \sin \left (2 c+2 d x+\frac {\pi }{2}\right )}dx}{4 a (a+b)}-\frac {\log (2 a-b \cos (2 c+2 d x)+b)}{16 a d^2 (a+b)}+\frac {b x \sin (2 c+2 d x)}{8 a d (a+b) (2 a-b \cos (2 c+2 d x)+b)}\right )\)

\(\Big \downarrow \) 3802

\(\displaystyle 4 \left (\frac {(2 a+b) \int -\frac {e^{2 i (c+d x)} x}{e^{4 i (c+d x)} b+b-2 (2 a+b) e^{2 i (c+d x)}}dx}{2 a (a+b)}-\frac {\log (2 a-b \cos (2 c+2 d x)+b)}{16 a d^2 (a+b)}+\frac {b x \sin (2 c+2 d x)}{8 a d (a+b) (2 a-b \cos (2 c+2 d x)+b)}\right )\)

\(\Big \downarrow \) 25

\(\displaystyle 4 \left (-\frac {(2 a+b) \int \frac {e^{2 i (c+d x)} x}{e^{4 i (c+d x)} b+b-2 (2 a+b) e^{2 i (c+d x)}}dx}{2 a (a+b)}-\frac {\log (2 a-b \cos (2 c+2 d x)+b)}{16 a d^2 (a+b)}+\frac {b x \sin (2 c+2 d x)}{8 a d (a+b) (2 a-b \cos (2 c+2 d x)+b)}\right )\)

\(\Big \downarrow \) 2694

\(\displaystyle 4 \left (-\frac {(2 a+b) \left (\frac {b \int -\frac {e^{2 i (c+d x)} x}{2 \left (2 a+2 \sqrt {a+b} \sqrt {a}-b e^{2 i (c+d x)}+b\right )}dx}{2 \sqrt {a} \sqrt {a+b}}-\frac {b \int -\frac {e^{2 i (c+d x)} x}{2 \left (2 a-2 \sqrt {a+b} \sqrt {a}-b e^{2 i (c+d x)}+b\right )}dx}{2 \sqrt {a} \sqrt {a+b}}\right )}{2 a (a+b)}-\frac {\log (2 a-b \cos (2 c+2 d x)+b)}{16 a d^2 (a+b)}+\frac {b x \sin (2 c+2 d x)}{8 a d (a+b) (2 a-b \cos (2 c+2 d x)+b)}\right )\)

\(\Big \downarrow \) 27

\(\displaystyle 4 \left (-\frac {(2 a+b) \left (\frac {b \int \frac {e^{2 i (c+d x)} x}{2 a-2 \sqrt {a+b} \sqrt {a}-b e^{2 i (c+d x)}+b}dx}{4 \sqrt {a} \sqrt {a+b}}-\frac {b \int \frac {e^{2 i (c+d x)} x}{2 a+2 \sqrt {a+b} \sqrt {a}-b e^{2 i (c+d x)}+b}dx}{4 \sqrt {a} \sqrt {a+b}}\right )}{2 a (a+b)}-\frac {\log (2 a-b \cos (2 c+2 d x)+b)}{16 a d^2 (a+b)}+\frac {b x \sin (2 c+2 d x)}{8 a d (a+b) (2 a-b \cos (2 c+2 d x)+b)}\right )\)

\(\Big \downarrow \) 2620

\(\displaystyle 4 \left (-\frac {(2 a+b) \left (\frac {b \left (\frac {i x \log \left (1-\frac {b e^{2 i (c+d x)}}{-2 \sqrt {a} \sqrt {a+b}+2 a+b}\right )}{2 b d}-\frac {i \int \log \left (1-\frac {b e^{2 i (c+d x)}}{2 a-2 \sqrt {a+b} \sqrt {a}+b}\right )dx}{2 b d}\right )}{4 \sqrt {a} \sqrt {a+b}}-\frac {b \left (\frac {i x \log \left (1-\frac {b e^{2 i (c+d x)}}{2 \sqrt {a} \sqrt {a+b}+2 a+b}\right )}{2 b d}-\frac {i \int \log \left (1-\frac {b e^{2 i (c+d x)}}{2 a+2 \sqrt {a+b} \sqrt {a}+b}\right )dx}{2 b d}\right )}{4 \sqrt {a} \sqrt {a+b}}\right )}{2 a (a+b)}-\frac {\log (2 a-b \cos (2 c+2 d x)+b)}{16 a d^2 (a+b)}+\frac {b x \sin (2 c+2 d x)}{8 a d (a+b) (2 a-b \cos (2 c+2 d x)+b)}\right )\)

\(\Big \downarrow \) 2715

\(\displaystyle 4 \left (-\frac {(2 a+b) \left (\frac {b \left (\frac {i x \log \left (1-\frac {b e^{2 i (c+d x)}}{-2 \sqrt {a} \sqrt {a+b}+2 a+b}\right )}{2 b d}-\frac {\int e^{-2 i (c+d x)} \log \left (1-\frac {b e^{2 i (c+d x)}}{2 a-2 \sqrt {a+b} \sqrt {a}+b}\right )de^{2 i (c+d x)}}{4 b d^2}\right )}{4 \sqrt {a} \sqrt {a+b}}-\frac {b \left (\frac {i x \log \left (1-\frac {b e^{2 i (c+d x)}}{2 \sqrt {a} \sqrt {a+b}+2 a+b}\right )}{2 b d}-\frac {\int e^{-2 i (c+d x)} \log \left (1-\frac {b e^{2 i (c+d x)}}{2 a+2 \sqrt {a+b} \sqrt {a}+b}\right )de^{2 i (c+d x)}}{4 b d^2}\right )}{4 \sqrt {a} \sqrt {a+b}}\right )}{2 a (a+b)}-\frac {\log (2 a-b \cos (2 c+2 d x)+b)}{16 a d^2 (a+b)}+\frac {b x \sin (2 c+2 d x)}{8 a d (a+b) (2 a-b \cos (2 c+2 d x)+b)}\right )\)

\(\Big \downarrow \) 2838

\(\displaystyle 4 \left (-\frac {(2 a+b) \left (\frac {b \left (\frac {\operatorname {PolyLog}\left (2,\frac {b e^{2 i (c+d x)}}{2 a-2 \sqrt {a+b} \sqrt {a}+b}\right )}{4 b d^2}+\frac {i x \log \left (1-\frac {b e^{2 i (c+d x)}}{-2 \sqrt {a} \sqrt {a+b}+2 a+b}\right )}{2 b d}\right )}{4 \sqrt {a} \sqrt {a+b}}-\frac {b \left (\frac {\operatorname {PolyLog}\left (2,\frac {b e^{2 i (c+d x)}}{2 a+2 \sqrt {a+b} \sqrt {a}+b}\right )}{4 b d^2}+\frac {i x \log \left (1-\frac {b e^{2 i (c+d x)}}{2 \sqrt {a} \sqrt {a+b}+2 a+b}\right )}{2 b d}\right )}{4 \sqrt {a} \sqrt {a+b}}\right )}{2 a (a+b)}-\frac {\log (2 a-b \cos (2 c+2 d x)+b)}{16 a d^2 (a+b)}+\frac {b x \sin (2 c+2 d x)}{8 a d (a+b) (2 a-b \cos (2 c+2 d x)+b)}\right )\)

Input:

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

Output:

4*(-1/16*Log[2*a + b - b*Cos[2*c + 2*d*x]]/(a*(a + b)*d^2) - ((2*a + b)*(( 
b*(((I/2)*x*Log[1 - (b*E^((2*I)*(c + d*x)))/(2*a + b - 2*Sqrt[a]*Sqrt[a + 
b])])/(b*d) + PolyLog[2, (b*E^((2*I)*(c + d*x)))/(2*a + b - 2*Sqrt[a]*Sqrt 
[a + b])]/(4*b*d^2)))/(4*Sqrt[a]*Sqrt[a + b]) - (b*(((I/2)*x*Log[1 - (b*E^ 
((2*I)*(c + d*x)))/(2*a + b + 2*Sqrt[a]*Sqrt[a + b])])/(b*d) + PolyLog[2, 
(b*E^((2*I)*(c + d*x)))/(2*a + b + 2*Sqrt[a]*Sqrt[a + b])]/(4*b*d^2)))/(4* 
Sqrt[a]*Sqrt[a + b])))/(2*a*(a + b)) + (b*x*Sin[2*c + 2*d*x])/(8*a*(a + b) 
*d*(2*a + b - b*Cos[2*c + 2*d*x])))
 

Defintions of rubi rules used

rule 16
Int[(c_.)/((a_.) + (b_.)*(x_)), x_Symbol] :> Simp[c*(Log[RemoveContent[a + 
b*x, x]]/b), x] /; FreeQ[{a, b, c}, x]
 

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 2620
Int[(((F_)^((g_.)*((e_.) + (f_.)*(x_))))^(n_.)*((c_.) + (d_.)*(x_))^(m_.))/ 
((a_) + (b_.)*((F_)^((g_.)*((e_.) + (f_.)*(x_))))^(n_.)), x_Symbol] :> Simp 
[((c + d*x)^m/(b*f*g*n*Log[F]))*Log[1 + b*((F^(g*(e + f*x)))^n/a)], x] - Si 
mp[d*(m/(b*f*g*n*Log[F]))   Int[(c + d*x)^(m - 1)*Log[1 + b*((F^(g*(e + f*x 
)))^n/a)], x], x] /; FreeQ[{F, a, b, c, d, e, f, g, n}, x] && IGtQ[m, 0]
 

rule 2694
Int[((F_)^(u_)*((f_.) + (g_.)*(x_))^(m_.))/((a_.) + (b_.)*(F_)^(u_) + (c_.) 
*(F_)^(v_)), x_Symbol] :> With[{q = Rt[b^2 - 4*a*c, 2]}, Simp[2*(c/q)   Int 
[(f + g*x)^m*(F^u/(b - q + 2*c*F^u)), x], x] - Simp[2*(c/q)   Int[(f + g*x) 
^m*(F^u/(b + q + 2*c*F^u)), x], x]] /; FreeQ[{F, a, b, c, f, g}, x] && EqQ[ 
v, 2*u] && LinearQ[u, x] && NeQ[b^2 - 4*a*c, 0] && IGtQ[m, 0]
 

rule 2715
Int[Log[(a_) + (b_.)*((F_)^((e_.)*((c_.) + (d_.)*(x_))))^(n_.)], x_Symbol] 
:> Simp[1/(d*e*n*Log[F])   Subst[Int[Log[a + b*x]/x, x], x, (F^(e*(c + d*x) 
))^n], x] /; FreeQ[{F, a, b, c, d, e, n}, x] && GtQ[a, 0]
 

rule 2838
Int[Log[(c_.)*((d_) + (e_.)*(x_)^(n_.))]/(x_), x_Symbol] :> Simp[-PolyLog[2 
, (-c)*e*x^n]/n, x] /; FreeQ[{c, d, e, n}, x] && EqQ[c*d, 1]
 

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

rule 3147
Int[cos[(e_.) + (f_.)*(x_)]^(p_.)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m 
_.), x_Symbol] :> Simp[1/(b^p*f)   Subst[Int[(a + x)^m*(b^2 - x^2)^((p - 1) 
/2), x], x, b*Sin[e + f*x]], x] /; FreeQ[{a, b, e, f, m}, x] && IntegerQ[(p 
 - 1)/2] && NeQ[a^2 - b^2, 0]
 

rule 3802
Int[((c_.) + (d_.)*(x_))^(m_.)/((a_) + (b_.)*sin[(e_.) + Pi*(k_.) + (f_.)*( 
x_)]), x_Symbol] :> Simp[2   Int[(c + d*x)^m*E^(I*Pi*(k - 1/2))*(E^(I*(e + 
f*x))/(b + 2*a*E^(I*Pi*(k - 1/2))*E^(I*(e + f*x)) - b*E^(2*I*k*Pi)*E^(2*I*( 
e + f*x)))), x], x] /; FreeQ[{a, b, c, d, e, f}, x] && IntegerQ[2*k] && NeQ 
[a^2 - b^2, 0] && IGtQ[m, 0]
 

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

rule 5096
Int[(x_)^(m_.)*((a_) + (b_.)*Sin[(c_.) + (d_.)*(x_)]^2)^(n_), x_Symbol] :> 
Simp[1/2^n   Int[x^m*(2*a + b - b*Cos[2*c + 2*d*x])^n, x], x] /; FreeQ[{a, 
b, c, d}, x] && NeQ[a + b, 0] && IGtQ[m, 0] && ILtQ[n, 0] && (EqQ[n, -1] || 
 (EqQ[m, 1] && EqQ[n, -2]))
 
Maple [B] (verified)

Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 2168 vs. \(2 (275 ) = 550\).

Time = 0.87 (sec) , antiderivative size = 2169, normalized size of antiderivative = 6.59

method result size
risch \(\text {Expression too large to display}\) \(2169\)

Input:

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

Output:

1/8/d^2/(a+b)/a*b^2/(a*(a+b))^(1/2)/(2*(a*(a+b))^(1/2)+2*a+b)*polylog(2,b* 
exp(2*I*(d*x+c))/(2*(a*(a+b))^(1/2)+2*a+b))-1/2/d/(a+b)/a*b/(a*(a+b))^(1/2 
)*c*x-1/2/d^2/(a+b)/(a*(a+b))^(1/2)*c^2-1/4/d^2/(a+b)/(a*(a+b))^(1/2)*poly 
log(2,b*exp(2*I*(d*x+c))/(-2*(a*(a+b))^(1/2)+2*a+b))+1/d^2/(a+b)/(2*(a*(a+ 
b))^(1/2)+2*a+b)*c^2+1/2/d^2/(a+b)/(2*(a*(a+b))^(1/2)+2*a+b)*polylog(2,b*e 
xp(2*I*(d*x+c))/(2*(a*(a+b))^(1/2)+2*a+b))+1/d/(a+b)/a*b/(2*(a*(a+b))^(1/2 
)+2*a+b)*c*x+2/d/(a+b)*a/(a*(a+b))^(1/2)/(2*(a*(a+b))^(1/2)+2*a+b)*c*x+1/4 
/d^2/(a+b)/a*b^2/(a*(a+b))^(1/2)/(2*(a*(a+b))^(1/2)+2*a+b)*c^2+2/d/(a+b)/( 
a*(a+b))^(1/2)/(2*(a*(a+b))^(1/2)+2*a+b)*c*x*b-I*x*(2*a*exp(2*I*(d*x+c))+b 
*exp(2*I*(d*x+c))-b)/a/(a+b)/d/(-b*exp(4*I*(d*x+c))+4*a*exp(2*I*(d*x+c))+2 
*b*exp(2*I*(d*x+c))-b)-1/2*I/d^2/(a+b)/a*b*c/(a^2+a*b)^(1/2)*arctanh(1/4*( 
-2*b*exp(2*I*(d*x+c))+4*a+2*b)/(a^2+a*b)^(1/2))-1/4*I/d^2/(a+b)/a*b/(a*(a+ 
b))^(1/2)*ln(1-b*exp(2*I*(d*x+c))/(-2*(a*(a+b))^(1/2)+2*a+b))*c+1/2*I/d^2/ 
(a+b)/a*b/(2*(a*(a+b))^(1/2)+2*a+b)*ln(1-b*exp(2*I*(d*x+c))/(2*(a*(a+b))^( 
1/2)+2*a+b))*c-1/4*I/d/(a+b)/a*b/(a*(a+b))^(1/2)*ln(1-b*exp(2*I*(d*x+c))/( 
-2*(a*(a+b))^(1/2)+2*a+b))*x+1/2*I/d/(a+b)/a*b/(2*(a*(a+b))^(1/2)+2*a+b)*l 
n(1-b*exp(2*I*(d*x+c))/(2*(a*(a+b))^(1/2)+2*a+b))*x+I/d/(a+b)/(a*(a+b))^(1 
/2)/(2*(a*(a+b))^(1/2)+2*a+b)*ln(1-b*exp(2*I*(d*x+c))/(2*(a*(a+b))^(1/2)+2 
*a+b))*b*x+1/2/d/(a+b)/a*b^2/(a*(a+b))^(1/2)/(2*(a*(a+b))^(1/2)+2*a+b)*c*x 
+I/d^2/(a+b)/(a*(a+b))^(1/2)/(2*(a*(a+b))^(1/2)+2*a+b)*ln(1-b*exp(2*I*(...
 

Fricas [B] (verification not implemented)

Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 3960 vs. \(2 (280) = 560\).

Time = 1.69 (sec) , antiderivative size = 3960, normalized size of antiderivative = 12.04 \[ \int \frac {x}{\left (a+b \sin ^2(c+d x)\right )^2} \, dx=\text {Too large to display} \] Input:

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

Output:

Too large to include
 

Sympy [F(-1)]

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

integrate(x/(a+b*sin(d*x+c)**2)**2,x)
 

Output:

Timed out
 

Maxima [F(-1)]

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

integrate(x/(a+b*sin(d*x+c)^2)^2,x, algorithm="maxima")
 

Output:

Timed out
 

Giac [F]

\[ \int \frac {x}{\left (a+b \sin ^2(c+d x)\right )^2} \, dx=\int { \frac {x}{{\left (b \sin \left (d x + c\right )^{2} + a\right )}^{2}} \,d x } \] Input:

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

Output:

integrate(x/(b*sin(d*x + c)^2 + a)^2, x)
 

Mupad [F(-1)]

Timed out. \[ \int \frac {x}{\left (a+b \sin ^2(c+d x)\right )^2} \, dx=\int \frac {x}{{\left (b\,{\sin \left (c+d\,x\right )}^2+a\right )}^2} \,d x \] Input:

int(x/(a + b*sin(c + d*x)^2)^2,x)
 

Output:

int(x/(a + b*sin(c + d*x)^2)^2, x)
 

Reduce [F]

\[ \int \frac {x}{\left (a+b \sin ^2(c+d x)\right )^2} \, dx=\text {too large to display} \] Input:

int(x/(a+b*sin(d*x+c)^2)^2,x)
 

Output:

(4*cos(c + d*x)*sin(c + d*x)*a**3*b*d*x - 20*cos(c + d*x)*sin(c + d*x)*a** 
2*b**2*d*x - 40*cos(c + d*x)*sin(c + d*x)*a*b**3*d*x - 16*cos(c + d*x)*sin 
(c + d*x)*b**4*d*x + 16*sqrt(b)*sqrt(a + b)*log( - sqrt(2*sqrt(b)*sqrt(a + 
 b) - a - 2*b) + sqrt(a)*tan((c + d*x)/2))*sin(c + d*x)**2*a*b**2 + 8*sqrt 
(b)*sqrt(a + b)*log( - sqrt(2*sqrt(b)*sqrt(a + b) - a - 2*b) + sqrt(a)*tan 
((c + d*x)/2))*sin(c + d*x)**2*b**3 + 16*sqrt(b)*sqrt(a + b)*log( - sqrt(2 
*sqrt(b)*sqrt(a + b) - a - 2*b) + sqrt(a)*tan((c + d*x)/2))*a**2*b + 8*sqr 
t(b)*sqrt(a + b)*log( - sqrt(2*sqrt(b)*sqrt(a + b) - a - 2*b) + sqrt(a)*ta 
n((c + d*x)/2))*a*b**2 + 16*sqrt(b)*sqrt(a + b)*log(sqrt(2*sqrt(b)*sqrt(a 
+ b) - a - 2*b) + sqrt(a)*tan((c + d*x)/2))*sin(c + d*x)**2*a*b**2 + 8*sqr 
t(b)*sqrt(a + b)*log(sqrt(2*sqrt(b)*sqrt(a + b) - a - 2*b) + sqrt(a)*tan(( 
c + d*x)/2))*sin(c + d*x)**2*b**3 + 16*sqrt(b)*sqrt(a + b)*log(sqrt(2*sqrt 
(b)*sqrt(a + b) - a - 2*b) + sqrt(a)*tan((c + d*x)/2))*a**2*b + 8*sqrt(b)* 
sqrt(a + b)*log(sqrt(2*sqrt(b)*sqrt(a + b) - a - 2*b) + sqrt(a)*tan((c + d 
*x)/2))*a*b**2 - 16*sqrt(b)*sqrt(a + b)*log(2*sqrt(b)*sqrt(a + b) + tan((c 
 + d*x)/2)**2*a + a + 2*b)*sin(c + d*x)**2*a*b**2 - 8*sqrt(b)*sqrt(a + b)* 
log(2*sqrt(b)*sqrt(a + b) + tan((c + d*x)/2)**2*a + a + 2*b)*sin(c + d*x)* 
*2*b**3 - 16*sqrt(b)*sqrt(a + b)*log(2*sqrt(b)*sqrt(a + b) + tan((c + d*x) 
/2)**2*a + a + 2*b)*a**2*b - 8*sqrt(b)*sqrt(a + b)*log(2*sqrt(b)*sqrt(a + 
b) + tan((c + d*x)/2)**2*a + a + 2*b)*a*b**2 + 256*int((tan((c + d*x)/2...