\(\int \frac {\csc (e+f x)}{(a+b \sec ^2(e+f x))^2} \, dx\) [44]

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

Optimal result

Integrand size = 21, antiderivative size = 99 \[ \int \frac {\csc (e+f x)}{\left (a+b \sec ^2(e+f x)\right )^2} \, dx=\frac {\sqrt {b} (3 a+b) \arctan \left (\frac {\sqrt {a} \cos (e+f x)}{\sqrt {b}}\right )}{2 a^{3/2} (a+b)^2 f}-\frac {\text {arctanh}(\cos (e+f x))}{(a+b)^2 f}-\frac {b \cos (e+f x)}{2 a (a+b) f \left (b+a \cos ^2(e+f x)\right )} \] Output:

1/2*b^(1/2)*(3*a+b)*arctan(a^(1/2)*cos(f*x+e)/b^(1/2))/a^(3/2)/(a+b)^2/f-a 
rctanh(cos(f*x+e))/(a+b)^2/f-1/2*b*cos(f*x+e)/a/(a+b)/f/(b+a*cos(f*x+e)^2)
 

Mathematica [C] (warning: unable to verify)

Result contains complex when optimal does not.

Time = 1.64 (sec) , antiderivative size = 384, normalized size of antiderivative = 3.88 \[ \int \frac {\csc (e+f x)}{\left (a+b \sec ^2(e+f x)\right )^2} \, dx=\frac {(a+2 b+a \cos (2 (e+f x))) \sec ^3(e+f x) \left (-\frac {2 b (a+b)}{a}+\frac {\sqrt {b} (3 a+b) \arctan \left (\frac {\left (-\sqrt {a}-i \sqrt {a+b} \sqrt {(\cos (e)-i \sin (e))^2}\right ) \sin (e) \tan \left (\frac {f x}{2}\right )+\cos (e) \left (\sqrt {a}-\sqrt {a+b} \sqrt {(\cos (e)-i \sin (e))^2} \tan \left (\frac {f x}{2}\right )\right )}{\sqrt {b}}\right ) (a+2 b+a \cos (2 (e+f x))) \sec (e+f x)}{a^{3/2}}+\frac {\sqrt {b} (3 a+b) \arctan \left (\frac {\left (-\sqrt {a}+i \sqrt {a+b} \sqrt {(\cos (e)-i \sin (e))^2}\right ) \sin (e) \tan \left (\frac {f x}{2}\right )+\cos (e) \left (\sqrt {a}+\sqrt {a+b} \sqrt {(\cos (e)-i \sin (e))^2} \tan \left (\frac {f x}{2}\right )\right )}{\sqrt {b}}\right ) (a+2 b+a \cos (2 (e+f x))) \sec (e+f x)}{a^{3/2}}-2 (a+2 b+a \cos (2 (e+f x))) \log \left (\cos \left (\frac {1}{2} (e+f x)\right )\right ) \sec (e+f x)+2 (a+2 b+a \cos (2 (e+f x))) \log \left (\sin \left (\frac {1}{2} (e+f x)\right )\right ) \sec (e+f x)\right )}{8 (a+b)^2 f \left (a+b \sec ^2(e+f x)\right )^2} \] Input:

Integrate[Csc[e + f*x]/(a + b*Sec[e + f*x]^2)^2,x]
 

Output:

((a + 2*b + a*Cos[2*(e + f*x)])*Sec[e + f*x]^3*((-2*b*(a + b))/a + (Sqrt[b 
]*(3*a + b)*ArcTan[((-Sqrt[a] - I*Sqrt[a + b]*Sqrt[(Cos[e] - I*Sin[e])^2]) 
*Sin[e]*Tan[(f*x)/2] + Cos[e]*(Sqrt[a] - Sqrt[a + b]*Sqrt[(Cos[e] - I*Sin[ 
e])^2]*Tan[(f*x)/2]))/Sqrt[b]]*(a + 2*b + a*Cos[2*(e + f*x)])*Sec[e + f*x] 
)/a^(3/2) + (Sqrt[b]*(3*a + b)*ArcTan[((-Sqrt[a] + I*Sqrt[a + b]*Sqrt[(Cos 
[e] - I*Sin[e])^2])*Sin[e]*Tan[(f*x)/2] + Cos[e]*(Sqrt[a] + Sqrt[a + b]*Sq 
rt[(Cos[e] - I*Sin[e])^2]*Tan[(f*x)/2]))/Sqrt[b]]*(a + 2*b + a*Cos[2*(e + 
f*x)])*Sec[e + f*x])/a^(3/2) - 2*(a + 2*b + a*Cos[2*(e + f*x)])*Log[Cos[(e 
 + f*x)/2]]*Sec[e + f*x] + 2*(a + 2*b + a*Cos[2*(e + f*x)])*Log[Sin[(e + f 
*x)/2]]*Sec[e + f*x]))/(8*(a + b)^2*f*(a + b*Sec[e + f*x]^2)^2)
 

Rubi [A] (verified)

Time = 0.29 (sec) , antiderivative size = 106, normalized size of antiderivative = 1.07, number of steps used = 7, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.286, Rules used = {3042, 4621, 372, 397, 218, 219}

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 {\csc (e+f x)}{\left (a+b \sec ^2(e+f x)\right )^2} \, dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \int \frac {1}{\sin (e+f x) \left (a+b \sec (e+f x)^2\right )^2}dx\)

\(\Big \downarrow \) 4621

\(\displaystyle -\frac {\int \frac {\cos ^4(e+f x)}{\left (1-\cos ^2(e+f x)\right ) \left (a \cos ^2(e+f x)+b\right )^2}d\cos (e+f x)}{f}\)

\(\Big \downarrow \) 372

\(\displaystyle -\frac {\frac {b \cos (e+f x)}{2 a (a+b) \left (a \cos ^2(e+f x)+b\right )}-\frac {\int \frac {b-(2 a+b) \cos ^2(e+f x)}{\left (1-\cos ^2(e+f x)\right ) \left (a \cos ^2(e+f x)+b\right )}d\cos (e+f x)}{2 a (a+b)}}{f}\)

\(\Big \downarrow \) 397

\(\displaystyle -\frac {\frac {b \cos (e+f x)}{2 a (a+b) \left (a \cos ^2(e+f x)+b\right )}-\frac {\frac {b (3 a+b) \int \frac {1}{a \cos ^2(e+f x)+b}d\cos (e+f x)}{a+b}-\frac {2 a \int \frac {1}{1-\cos ^2(e+f x)}d\cos (e+f x)}{a+b}}{2 a (a+b)}}{f}\)

\(\Big \downarrow \) 218

\(\displaystyle -\frac {\frac {b \cos (e+f x)}{2 a (a+b) \left (a \cos ^2(e+f x)+b\right )}-\frac {\frac {\sqrt {b} (3 a+b) \arctan \left (\frac {\sqrt {a} \cos (e+f x)}{\sqrt {b}}\right )}{\sqrt {a} (a+b)}-\frac {2 a \int \frac {1}{1-\cos ^2(e+f x)}d\cos (e+f x)}{a+b}}{2 a (a+b)}}{f}\)

\(\Big \downarrow \) 219

\(\displaystyle -\frac {\frac {b \cos (e+f x)}{2 a (a+b) \left (a \cos ^2(e+f x)+b\right )}-\frac {\frac {\sqrt {b} (3 a+b) \arctan \left (\frac {\sqrt {a} \cos (e+f x)}{\sqrt {b}}\right )}{\sqrt {a} (a+b)}-\frac {2 a \text {arctanh}(\cos (e+f x))}{a+b}}{2 a (a+b)}}{f}\)

Input:

Int[Csc[e + f*x]/(a + b*Sec[e + f*x]^2)^2,x]
 

Output:

-((-1/2*((Sqrt[b]*(3*a + b)*ArcTan[(Sqrt[a]*Cos[e + f*x])/Sqrt[b]])/(Sqrt[ 
a]*(a + b)) - (2*a*ArcTanh[Cos[e + f*x]])/(a + b))/(a*(a + b)) + (b*Cos[e 
+ f*x])/(2*a*(a + b)*(b + a*Cos[e + f*x]^2)))/f)
 

Defintions of rubi rules used

rule 218
Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[a/b, 2]/a)*ArcTan[x/R 
t[a/b, 2]], x] /; FreeQ[{a, b}, x] && PosQ[a/b]
 

rule 219
Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[-b, 2]))* 
ArcTanh[Rt[-b, 2]*(x/Rt[a, 2])], x] /; FreeQ[{a, b}, x] && NegQ[a/b] && (Gt 
Q[a, 0] || LtQ[b, 0])
 

rule 372
Int[((e_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^2)^(p_)*((c_) + (d_.)*(x_)^2)^(q_ 
), x_Symbol] :> Simp[(-a)*e^3*(e*x)^(m - 3)*(a + b*x^2)^(p + 1)*((c + d*x^2 
)^(q + 1)/(2*b*(b*c - a*d)*(p + 1))), x] + Simp[e^4/(2*b*(b*c - a*d)*(p + 1 
))   Int[(e*x)^(m - 4)*(a + b*x^2)^(p + 1)*(c + d*x^2)^q*Simp[a*c*(m - 3) + 
 (a*d*(m + 2*q - 1) + 2*b*c*(p + 1))*x^2, x], x], x] /; FreeQ[{a, b, c, d, 
e, q}, x] && NeQ[b*c - a*d, 0] && LtQ[p, -1] && GtQ[m, 3] && IntBinomialQ[a 
, b, c, d, e, m, 2, p, q, x]
 

rule 397
Int[((e_) + (f_.)*(x_)^2)/(((a_) + (b_.)*(x_)^2)*((c_) + (d_.)*(x_)^2)), x_ 
Symbol] :> Simp[(b*e - a*f)/(b*c - a*d)   Int[1/(a + b*x^2), x], x] - Simp[ 
(d*e - c*f)/(b*c - a*d)   Int[1/(c + d*x^2), x], x] /; FreeQ[{a, b, c, d, e 
, f}, x]
 

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

rule 4621
Int[((a_) + (b_.)*sec[(e_.) + (f_.)*(x_)]^(n_))^(p_.)*sin[(e_.) + (f_.)*(x_ 
)]^(m_.), x_Symbol] :> With[{ff = FreeFactors[Cos[e + f*x], x]}, Simp[-ff/f 
   Subst[Int[(1 - ff^2*x^2)^((m - 1)/2)*((b + a*(ff*x)^n)^p/(ff*x)^(n*p)), 
x], x, Cos[e + f*x]/ff], x]] /; FreeQ[{a, b, e, f}, x] && IntegerQ[(m - 1)/ 
2] && IntegerQ[n] && IntegerQ[p]
 
Maple [A] (verified)

Time = 0.64 (sec) , antiderivative size = 103, normalized size of antiderivative = 1.04

method result size
derivativedivides \(\frac {\frac {b \left (-\frac {\left (a +b \right ) \cos \left (f x +e \right )}{2 a \left (b +a \cos \left (f x +e \right )^{2}\right )}+\frac {\left (3 a +b \right ) \arctan \left (\frac {a \cos \left (f x +e \right )}{\sqrt {a b}}\right )}{2 a \sqrt {a b}}\right )}{\left (a +b \right )^{2}}+\frac {\ln \left (-1+\cos \left (f x +e \right )\right )}{2 \left (a +b \right )^{2}}-\frac {\ln \left (1+\cos \left (f x +e \right )\right )}{2 \left (a +b \right )^{2}}}{f}\) \(103\)
default \(\frac {\frac {b \left (-\frac {\left (a +b \right ) \cos \left (f x +e \right )}{2 a \left (b +a \cos \left (f x +e \right )^{2}\right )}+\frac {\left (3 a +b \right ) \arctan \left (\frac {a \cos \left (f x +e \right )}{\sqrt {a b}}\right )}{2 a \sqrt {a b}}\right )}{\left (a +b \right )^{2}}+\frac {\ln \left (-1+\cos \left (f x +e \right )\right )}{2 \left (a +b \right )^{2}}-\frac {\ln \left (1+\cos \left (f x +e \right )\right )}{2 \left (a +b \right )^{2}}}{f}\) \(103\)
risch \(-\frac {b \left ({\mathrm e}^{3 i \left (f x +e \right )}+{\mathrm e}^{i \left (f x +e \right )}\right )}{a f \left (a +b \right ) \left (a \,{\mathrm e}^{4 i \left (f x +e \right )}+2 a \,{\mathrm e}^{2 i \left (f x +e \right )}+4 b \,{\mathrm e}^{2 i \left (f x +e \right )}+a \right )}-\frac {\ln \left ({\mathrm e}^{i \left (f x +e \right )}+1\right )}{f \left (a^{2}+2 a b +b^{2}\right )}+\frac {\ln \left ({\mathrm e}^{i \left (f x +e \right )}-1\right )}{f \left (a^{2}+2 a b +b^{2}\right )}+\frac {3 i \sqrt {a b}\, \ln \left ({\mathrm e}^{2 i \left (f x +e \right )}+\frac {2 i \sqrt {a b}\, {\mathrm e}^{i \left (f x +e \right )}}{a}+1\right )}{4 a \left (a +b \right )^{2} f}+\frac {i \sqrt {a b}\, \ln \left ({\mathrm e}^{2 i \left (f x +e \right )}+\frac {2 i \sqrt {a b}\, {\mathrm e}^{i \left (f x +e \right )}}{a}+1\right ) b}{4 a^{2} \left (a +b \right )^{2} f}-\frac {3 i \sqrt {a b}\, \ln \left ({\mathrm e}^{2 i \left (f x +e \right )}-\frac {2 i \sqrt {a b}\, {\mathrm e}^{i \left (f x +e \right )}}{a}+1\right )}{4 a \left (a +b \right )^{2} f}-\frac {i \sqrt {a b}\, \ln \left ({\mathrm e}^{2 i \left (f x +e \right )}-\frac {2 i \sqrt {a b}\, {\mathrm e}^{i \left (f x +e \right )}}{a}+1\right ) b}{4 a^{2} \left (a +b \right )^{2} f}\) \(339\)

Input:

int(csc(f*x+e)/(a+b*sec(f*x+e)^2)^2,x,method=_RETURNVERBOSE)
 

Output:

1/f*(b/(a+b)^2*(-1/2*(a+b)/a*cos(f*x+e)/(b+a*cos(f*x+e)^2)+1/2*(3*a+b)/a/( 
a*b)^(1/2)*arctan(a*cos(f*x+e)/(a*b)^(1/2)))+1/2/(a+b)^2*ln(-1+cos(f*x+e)) 
-1/2/(a+b)^2*ln(1+cos(f*x+e)))
 

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 179 vs. \(2 (87) = 174\).

Time = 0.14 (sec) , antiderivative size = 390, normalized size of antiderivative = 3.94 \[ \int \frac {\csc (e+f x)}{\left (a+b \sec ^2(e+f x)\right )^2} \, dx=\left [\frac {{\left ({\left (3 \, a^{2} + a b\right )} \cos \left (f x + e\right )^{2} + 3 \, a b + b^{2}\right )} \sqrt {-\frac {b}{a}} \log \left (-\frac {a \cos \left (f x + e\right )^{2} + 2 \, a \sqrt {-\frac {b}{a}} \cos \left (f x + e\right ) - b}{a \cos \left (f x + e\right )^{2} + b}\right ) - 2 \, {\left (a b + b^{2}\right )} \cos \left (f x + e\right ) - 2 \, {\left (a^{2} \cos \left (f x + e\right )^{2} + a b\right )} \log \left (\frac {1}{2} \, \cos \left (f x + e\right ) + \frac {1}{2}\right ) + 2 \, {\left (a^{2} \cos \left (f x + e\right )^{2} + a b\right )} \log \left (-\frac {1}{2} \, \cos \left (f x + e\right ) + \frac {1}{2}\right )}{4 \, {\left ({\left (a^{4} + 2 \, a^{3} b + a^{2} b^{2}\right )} f \cos \left (f x + e\right )^{2} + {\left (a^{3} b + 2 \, a^{2} b^{2} + a b^{3}\right )} f\right )}}, \frac {{\left ({\left (3 \, a^{2} + a b\right )} \cos \left (f x + e\right )^{2} + 3 \, a b + b^{2}\right )} \sqrt {\frac {b}{a}} \arctan \left (\frac {a \sqrt {\frac {b}{a}} \cos \left (f x + e\right )}{b}\right ) - {\left (a b + b^{2}\right )} \cos \left (f x + e\right ) - {\left (a^{2} \cos \left (f x + e\right )^{2} + a b\right )} \log \left (\frac {1}{2} \, \cos \left (f x + e\right ) + \frac {1}{2}\right ) + {\left (a^{2} \cos \left (f x + e\right )^{2} + a b\right )} \log \left (-\frac {1}{2} \, \cos \left (f x + e\right ) + \frac {1}{2}\right )}{2 \, {\left ({\left (a^{4} + 2 \, a^{3} b + a^{2} b^{2}\right )} f \cos \left (f x + e\right )^{2} + {\left (a^{3} b + 2 \, a^{2} b^{2} + a b^{3}\right )} f\right )}}\right ] \] Input:

integrate(csc(f*x+e)/(a+b*sec(f*x+e)^2)^2,x, algorithm="fricas")
 

Output:

[1/4*(((3*a^2 + a*b)*cos(f*x + e)^2 + 3*a*b + b^2)*sqrt(-b/a)*log(-(a*cos( 
f*x + e)^2 + 2*a*sqrt(-b/a)*cos(f*x + e) - b)/(a*cos(f*x + e)^2 + b)) - 2* 
(a*b + b^2)*cos(f*x + e) - 2*(a^2*cos(f*x + e)^2 + a*b)*log(1/2*cos(f*x + 
e) + 1/2) + 2*(a^2*cos(f*x + e)^2 + a*b)*log(-1/2*cos(f*x + e) + 1/2))/((a 
^4 + 2*a^3*b + a^2*b^2)*f*cos(f*x + e)^2 + (a^3*b + 2*a^2*b^2 + a*b^3)*f), 
 1/2*(((3*a^2 + a*b)*cos(f*x + e)^2 + 3*a*b + b^2)*sqrt(b/a)*arctan(a*sqrt 
(b/a)*cos(f*x + e)/b) - (a*b + b^2)*cos(f*x + e) - (a^2*cos(f*x + e)^2 + a 
*b)*log(1/2*cos(f*x + e) + 1/2) + (a^2*cos(f*x + e)^2 + a*b)*log(-1/2*cos( 
f*x + e) + 1/2))/((a^4 + 2*a^3*b + a^2*b^2)*f*cos(f*x + e)^2 + (a^3*b + 2* 
a^2*b^2 + a*b^3)*f)]
 

Sympy [F]

\[ \int \frac {\csc (e+f x)}{\left (a+b \sec ^2(e+f x)\right )^2} \, dx=\int \frac {\csc {\left (e + f x \right )}}{\left (a + b \sec ^{2}{\left (e + f x \right )}\right )^{2}}\, dx \] Input:

integrate(csc(f*x+e)/(a+b*sec(f*x+e)**2)**2,x)
 

Output:

Integral(csc(e + f*x)/(a + b*sec(e + f*x)**2)**2, x)
 

Maxima [A] (verification not implemented)

Time = 0.11 (sec) , antiderivative size = 138, normalized size of antiderivative = 1.39 \[ \int \frac {\csc (e+f x)}{\left (a+b \sec ^2(e+f x)\right )^2} \, dx=-\frac {\frac {b \cos \left (f x + e\right )}{a^{2} b + a b^{2} + {\left (a^{3} + a^{2} b\right )} \cos \left (f x + e\right )^{2}} - \frac {{\left (3 \, a b + b^{2}\right )} \arctan \left (\frac {a \cos \left (f x + e\right )}{\sqrt {a b}}\right )}{{\left (a^{3} + 2 \, a^{2} b + a b^{2}\right )} \sqrt {a b}} + \frac {\log \left (\cos \left (f x + e\right ) + 1\right )}{a^{2} + 2 \, a b + b^{2}} - \frac {\log \left (\cos \left (f x + e\right ) - 1\right )}{a^{2} + 2 \, a b + b^{2}}}{2 \, f} \] Input:

integrate(csc(f*x+e)/(a+b*sec(f*x+e)^2)^2,x, algorithm="maxima")
 

Output:

-1/2*(b*cos(f*x + e)/(a^2*b + a*b^2 + (a^3 + a^2*b)*cos(f*x + e)^2) - (3*a 
*b + b^2)*arctan(a*cos(f*x + e)/sqrt(a*b))/((a^3 + 2*a^2*b + a*b^2)*sqrt(a 
*b)) + log(cos(f*x + e) + 1)/(a^2 + 2*a*b + b^2) - log(cos(f*x + e) - 1)/( 
a^2 + 2*a*b + b^2))/f
 

Giac [A] (verification not implemented)

Time = 0.18 (sec) , antiderivative size = 150, normalized size of antiderivative = 1.52 \[ \int \frac {\csc (e+f x)}{\left (a+b \sec ^2(e+f x)\right )^2} \, dx=\frac {{\left (3 \, a b + b^{2}\right )} \arctan \left (\frac {a \cos \left (f x + e\right )}{\sqrt {a b}}\right )}{2 \, {\left (a^{3} f + 2 \, a^{2} b f + a b^{2} f\right )} \sqrt {a b}} - \frac {b \cos \left (f x + e\right )}{2 \, {\left (a^{2} f + a b f\right )} {\left (a \cos \left (f x + e\right )^{2} + b\right )}} + \frac {\log \left ({\left | -\cos \left (f x + e\right ) + 1 \right |}\right )}{2 \, {\left (a^{2} f + 2 \, a b f + b^{2} f\right )}} - \frac {\log \left ({\left | -\cos \left (f x + e\right ) - 1 \right |}\right )}{2 \, {\left (a^{2} f + 2 \, a b f + b^{2} f\right )}} \] Input:

integrate(csc(f*x+e)/(a+b*sec(f*x+e)^2)^2,x, algorithm="giac")
 

Output:

1/2*(3*a*b + b^2)*arctan(a*cos(f*x + e)/sqrt(a*b))/((a^3*f + 2*a^2*b*f + a 
*b^2*f)*sqrt(a*b)) - 1/2*b*cos(f*x + e)/((a^2*f + a*b*f)*(a*cos(f*x + e)^2 
 + b)) + 1/2*log(abs(-cos(f*x + e) + 1))/(a^2*f + 2*a*b*f + b^2*f) - 1/2*l 
og(abs(-cos(f*x + e) - 1))/(a^2*f + 2*a*b*f + b^2*f)
 

Mupad [B] (verification not implemented)

Time = 13.66 (sec) , antiderivative size = 2188, normalized size of antiderivative = 22.10 \[ \int \frac {\csc (e+f x)}{\left (a+b \sec ^2(e+f x)\right )^2} \, dx=\text {Too large to display} \] Input:

int(1/(sin(e + f*x)*(a + b/cos(e + f*x)^2)^2),x)
 

Output:

(atan((((3*a + b)*(-a^3*b)^(1/2)*((cos(e + f*x)*(6*a*b^3 + 4*a^4 + b^4 + 9 
*a^2*b^2))/(2*(a*b^2 + 2*a^2*b + a^3)) + ((3*a + b)*(-a^3*b)^(1/2)*((2*a^6 
*b + 2*a^2*b^5 + 8*a^3*b^4 + 12*a^4*b^3 + 8*a^5*b^2)/(a*b^3 + 3*a^3*b + a^ 
4 + 3*a^2*b^2) - (cos(e + f*x)*(3*a + b)*(-a^3*b)^(1/2)*(48*a^7*b + 16*a^8 
 - 16*a^3*b^5 - 48*a^4*b^4 - 32*a^5*b^3 + 32*a^6*b^2))/(8*(a*b^2 + 2*a^2*b 
 + a^3)*(2*a^4*b + a^5 + a^3*b^2))))/(4*(2*a^4*b + a^5 + a^3*b^2)))*1i)/(4 
*(2*a^4*b + a^5 + a^3*b^2)) + ((3*a + b)*(-a^3*b)^(1/2)*((cos(e + f*x)*(6* 
a*b^3 + 4*a^4 + b^4 + 9*a^2*b^2))/(2*(a*b^2 + 2*a^2*b + a^3)) - ((3*a + b) 
*(-a^3*b)^(1/2)*((2*a^6*b + 2*a^2*b^5 + 8*a^3*b^4 + 12*a^4*b^3 + 8*a^5*b^2 
)/(a*b^3 + 3*a^3*b + a^4 + 3*a^2*b^2) + (cos(e + f*x)*(3*a + b)*(-a^3*b)^( 
1/2)*(48*a^7*b + 16*a^8 - 16*a^3*b^5 - 48*a^4*b^4 - 32*a^5*b^3 + 32*a^6*b^ 
2))/(8*(a*b^2 + 2*a^2*b + a^3)*(2*a^4*b + a^5 + a^3*b^2))))/(4*(2*a^4*b + 
a^5 + a^3*b^2)))*1i)/(4*(2*a^4*b + a^5 + a^3*b^2)))/(((5*a*b^2)/2 + 3*a^2* 
b + b^3/2)/(a*b^3 + 3*a^3*b + a^4 + 3*a^2*b^2) - ((3*a + b)*(-a^3*b)^(1/2) 
*((cos(e + f*x)*(6*a*b^3 + 4*a^4 + b^4 + 9*a^2*b^2))/(2*(a*b^2 + 2*a^2*b + 
 a^3)) + ((3*a + b)*(-a^3*b)^(1/2)*((2*a^6*b + 2*a^2*b^5 + 8*a^3*b^4 + 12* 
a^4*b^3 + 8*a^5*b^2)/(a*b^3 + 3*a^3*b + a^4 + 3*a^2*b^2) - (cos(e + f*x)*( 
3*a + b)*(-a^3*b)^(1/2)*(48*a^7*b + 16*a^8 - 16*a^3*b^5 - 48*a^4*b^4 - 32* 
a^5*b^3 + 32*a^6*b^2))/(8*(a*b^2 + 2*a^2*b + a^3)*(2*a^4*b + a^5 + a^3*b^2 
))))/(4*(2*a^4*b + a^5 + a^3*b^2))))/(4*(2*a^4*b + a^5 + a^3*b^2)) + ((...
 

Reduce [B] (verification not implemented)

Time = 0.17 (sec) , antiderivative size = 530, normalized size of antiderivative = 5.35 \[ \int \frac {\csc (e+f x)}{\left (a+b \sec ^2(e+f x)\right )^2} \, dx =\text {Too large to display} \] Input:

int(csc(f*x+e)/(a+b*sec(f*x+e)^2)^2,x)
 

Output:

( - 3*sqrt(b)*sqrt(a)*atan((sqrt(a + b)*tan((e + f*x)/2) - sqrt(a))/sqrt(b 
))*sin(e + f*x)**2*a**2 - sqrt(b)*sqrt(a)*atan((sqrt(a + b)*tan((e + f*x)/ 
2) - sqrt(a))/sqrt(b))*sin(e + f*x)**2*a*b + 3*sqrt(b)*sqrt(a)*atan((sqrt( 
a + b)*tan((e + f*x)/2) - sqrt(a))/sqrt(b))*a**2 + 4*sqrt(b)*sqrt(a)*atan( 
(sqrt(a + b)*tan((e + f*x)/2) - sqrt(a))/sqrt(b))*a*b + sqrt(b)*sqrt(a)*at 
an((sqrt(a + b)*tan((e + f*x)/2) - sqrt(a))/sqrt(b))*b**2 + 3*sqrt(b)*sqrt 
(a)*atan((sqrt(a + b)*tan((e + f*x)/2) + sqrt(a))/sqrt(b))*sin(e + f*x)**2 
*a**2 + sqrt(b)*sqrt(a)*atan((sqrt(a + b)*tan((e + f*x)/2) + sqrt(a))/sqrt 
(b))*sin(e + f*x)**2*a*b - 3*sqrt(b)*sqrt(a)*atan((sqrt(a + b)*tan((e + f* 
x)/2) + sqrt(a))/sqrt(b))*a**2 - 4*sqrt(b)*sqrt(a)*atan((sqrt(a + b)*tan(( 
e + f*x)/2) + sqrt(a))/sqrt(b))*a*b - sqrt(b)*sqrt(a)*atan((sqrt(a + b)*ta 
n((e + f*x)/2) + sqrt(a))/sqrt(b))*b**2 + cos(e + f*x)*a**2*b + cos(e + f* 
x)*a*b**2 + 2*log(tan((e + f*x)/2))*sin(e + f*x)**2*a**3 - 2*log(tan((e + 
f*x)/2))*a**3 - 2*log(tan((e + f*x)/2))*a**2*b + sin(e + f*x)**2*a**2*b - 
a**2*b - a*b**2)/(2*a**2*f*(sin(e + f*x)**2*a**3 + 2*sin(e + f*x)**2*a**2* 
b + sin(e + f*x)**2*a*b**2 - a**3 - 3*a**2*b - 3*a*b**2 - b**3))