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

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 = 327 \[ \int \frac {x}{\left (a+b \cos ^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. \(825\) vs. \(2(327)=654\).

Time = 14.52 (sec) , antiderivative size = 825, normalized size of antiderivative = 2.52 \[ \int \frac {x}{\left (a+b \cos ^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} \tan (c+d x)}{\sqrt {a+b}}\right )}{\sqrt {a} \sqrt {a+b}}+2 \log \left (\sec ^2(c+d x)\right )-2 \log \left (a+b+a \tan ^2(c+d x)\right )-\frac {i (2 a+b) \left (\log (1-i \tan (c+d x)) \log \left (\frac {\sqrt {-a-b}+\sqrt {a} \tan (c+d x)}{-i \sqrt {a}+\sqrt {-a-b}}\right )+\operatorname {PolyLog}\left (2,\frac {\sqrt {a} (1-i \tan (c+d x))}{\sqrt {a}+i \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-b}+\sqrt {a} \tan (c+d x)}{i \sqrt {a}+\sqrt {-a-b}}\right )+\operatorname {PolyLog}\left (2,\frac {\sqrt {a} (1+i \tan (c+d x))}{\sqrt {a}-i \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-b}-\sqrt {a} \tan (c+d x)}{-i \sqrt {a}+\sqrt {-a-b}}\right )+\operatorname {PolyLog}\left (2,\frac {\sqrt {a} (1+i \tan (c+d x))}{\sqrt {a}+i \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-b}-\sqrt {a} \tan (c+d x)}{i \sqrt {a}+\sqrt {-a-b}}\right )+\operatorname {PolyLog}\left (2,\frac {\sqrt {a} (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-b}+\sqrt {a} \tan (c+d x)\right ) \left (\sqrt {-a-b}+\sqrt {a} \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*Cos[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[(Sq 
rt[a]*Tan[c + d*x])/Sqrt[a + b]])/(Sqrt[a]*Sqrt[a + b]) + 2*Log[Sec[c + d* 
x]^2] - 2*Log[a + b + a*Tan[c + d*x]^2] - (I*(2*a + b)*(Log[1 - I*Tan[c + 
d*x]]*Log[(Sqrt[-a - b] + Sqrt[a]*Tan[c + d*x])/((-I)*Sqrt[a] + Sqrt[-a - 
b])] + PolyLog[2, (Sqrt[a]*(1 - I*Tan[c + d*x]))/(Sqrt[a] + I*Sqrt[-a - b] 
)]))/(Sqrt[a]*Sqrt[-a - b]) + (I*(2*a + b)*(Log[1 + I*Tan[c + d*x]]*Log[(S 
qrt[-a - b] + Sqrt[a]*Tan[c + d*x])/(I*Sqrt[a] + Sqrt[-a - b])] + PolyLog[ 
2, (Sqrt[a]*(1 + I*Tan[c + d*x]))/(Sqrt[a] - I*Sqrt[-a - b])]))/(Sqrt[a]*S 
qrt[-a - b]) - (I*(2*a + b)*(Log[1 + I*Tan[c + d*x]]*Log[(Sqrt[-a - b] - S 
qrt[a]*Tan[c + d*x])/((-I)*Sqrt[a] + Sqrt[-a - b])] + PolyLog[2, (Sqrt[a]* 
(1 + I*Tan[c + d*x]))/(Sqrt[a] + I*Sqrt[-a - b])]))/(Sqrt[a]*Sqrt[-a - b]) 
 + (I*(2*a + b)*(Log[1 - I*Tan[c + d*x]]*Log[(Sqrt[-a - b] - Sqrt[a]*Tan[c 
 + d*x])/(I*Sqrt[a] + Sqrt[-a - b])] + PolyLog[2, (Sqrt[a]*(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 - b] + Sqrt[a]*Tan[c + d*x])*(Sqrt[-a - 
b] + Sqrt[a]*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 = 327, normalized size of antiderivative = 1.00, number of steps used = 14, number of rules used = 13, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.812, Rules used = {5097, 3042, 3805, 25, 3042, 3147, 16, 3802, 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 \cos ^2(c+d x)\right )^2} \, dx\)

\(\Big \downarrow \) 5097

\(\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 \) 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 \int \log \left (\frac {e^{2 i (c+d x)} b}{2 a-2 \sqrt {a+b} \sqrt {a}+b}+1\right )dx}{2 b d}-\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 {i \int \log \left (\frac {e^{2 i (c+d x)} b}{2 a+2 \sqrt {a+b} \sqrt {a}+b}+1\right )dx}{2 b d}-\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 )\)

\(\Big \downarrow \) 2715

\(\displaystyle 4 \left (\frac {(2 a+b) \left (\frac {b \left (\frac {\int e^{-2 i (c+d x)} \log \left (\frac {e^{2 i (c+d x)} b}{2 a-2 \sqrt {a+b} \sqrt {a}+b}+1\right )de^{2 i (c+d x)}}{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 {\int e^{-2 i (c+d x)} \log \left (\frac {e^{2 i (c+d x)} b}{2 a+2 \sqrt {a+b} \sqrt {a}+b}+1\right )de^{2 i (c+d x)}}{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 )\)

\(\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*Cos[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*(((-1/2*I)*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*(((-1/2*I)*x*Log[ 
1 + (b*E^((2*I)*(c + d*x)))/(2*a + b + 2*Sqrt[a]*Sqrt[a + b])])/(b*d) - Po 
lyLog[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 5097
Int[(Cos[(c_.) + (d_.)*(x_)]^2*(b_.) + (a_))^(n_)*(x_)^(m_.), 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. 2269 vs. \(2 (273 ) = 546\).

Time = 0.86 (sec) , antiderivative size = 2270, normalized size of antiderivative = 6.94

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

Input:

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

Output:

-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*exp(2*I*(d*x+c))/(-2*(a*(a+b))^(1/2)-2*a-b))-1/4/d^ 
2/(a+b)/(a*(a+b))^(1/2)*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/4/d^2/(a+b)/a*ln(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/d^2/(a+b)/(a*(a+b)) 
^(1/2)*c^2-I*x*(2*a*exp(2*I*(d*x+c))+b*exp(2*I*(d*x+c))+b)/a/(a+b)/d/(b*ex 
p(4*I*(d*x+c))+4*a*exp(2*I*(d*x+c))+2*b*exp(2*I*(d*x+c))+b)-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-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))-2/d/(a+b)*a/(a*(a+b))^(1/2)/(-2*(a*(a+b))^(1/2)-2*a-b)*c*x-1/d/( 
a+b)/a*b/(-2*(a*(a+b))^(1/2)-2*a-b)*c*x-2/d/(a+b)/(-2*(a*(a+b))^(1/2)-2*a- 
b)*c*x-1/2/(a+b)/a*b/(-2*(a*(a+b))^(1/2)-2*a-b)*x^2-1/(a+b)*a/(a*(a+b))^(1 
/2)/(-2*(a*(a+b))^(1/2)-2*a-b)*x^2-1/(a+b)/(a*(a+b))^(1/2)/(-2*(a*(a+b))^( 
1/2)-2*a-b)*x^2*b+1/d^2/(a+b)/a*ln(exp(I*(d*x+c)))-1/2/d/(a+b)/a*b^2/(a*(a 
+b))^(1/2)/(-2*(a*(a+b))^(1/2)-2*a-b)*c*x-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)*ln(1-b*exp(2*I*(d*x+c))/(-2*(a*(a+b))^(1/2)-2*a- 
b))*x-I/d^2/(a+b)*a/(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))*c-I/d/(a+b)*a/(a*(a+b))^(1/2)/...
 

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. 3759 vs. \(2 (277) = 554\).

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

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

Output:

Too large to include
 

Sympy [F(-1)]

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

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

Output:

Timed out
 

Maxima [F(-1)]

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

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

Output:

Timed out
 

Giac [F]

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

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

Output:

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

Mupad [F(-1)]

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

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

Output:

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

Reduce [F]

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

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

Output:

int(x/(cos(c + d*x)**4*b**2 + 2*cos(c + d*x)**2*a*b + a**2),x)