\(\int \frac {\csc ^2(c+d x)}{(a+b \sec (c+d x))^3} \, dx\) [231]

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

Optimal result

Integrand size = 21, antiderivative size = 376 \[ \int \frac {\csc ^2(c+d x)}{(a+b \sec (c+d x))^3} \, dx=-\frac {2 b^3 \left (3 a^2-b^2\right ) \text {arctanh}\left (\frac {\sqrt {a-b} \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a+b}}\right )}{a (a-b)^{7/2} (a+b)^{7/2} d}-\frac {2 a b \left (3 a^2+b^2\right ) \text {arctanh}\left (\frac {\sqrt {a-b} \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a+b}}\right )}{(a-b)^{7/2} (a+b)^{7/2} d}-\frac {b^3 \left (a^2+2 b^2\right ) \text {arctanh}\left (\frac {\sqrt {a-b} \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a+b}}\right )}{a (a-b)^{7/2} (a+b)^{7/2} d}-\frac {\sin (c+d x)}{2 (a+b)^3 d (1-\cos (c+d x))}+\frac {\sin (c+d x)}{2 (a-b)^3 d (1+\cos (c+d x))}-\frac {b^3 \sin (c+d x)}{2 \left (a^2-b^2\right )^2 d (b+a \cos (c+d x))^2}+\frac {3 b^4 \sin (c+d x)}{2 \left (a^2-b^2\right )^3 d (b+a \cos (c+d x))}+\frac {b^2 \left (3 a^2-b^2\right ) \sin (c+d x)}{\left (a^2-b^2\right )^3 d (b+a \cos (c+d x))} \] Output:

-2*b^3*(3*a^2-b^2)*arctanh((a-b)^(1/2)*tan(1/2*d*x+1/2*c)/(a+b)^(1/2))/a/( 
a-b)^(7/2)/(a+b)^(7/2)/d-2*a*b*(3*a^2+b^2)*arctanh((a-b)^(1/2)*tan(1/2*d*x 
+1/2*c)/(a+b)^(1/2))/(a-b)^(7/2)/(a+b)^(7/2)/d-b^3*(a^2+2*b^2)*arctanh((a- 
b)^(1/2)*tan(1/2*d*x+1/2*c)/(a+b)^(1/2))/a/(a-b)^(7/2)/(a+b)^(7/2)/d-1/2*s 
in(d*x+c)/(a+b)^3/d/(1-cos(d*x+c))+1/2*sin(d*x+c)/(a-b)^3/d/(1+cos(d*x+c)) 
-1/2*b^3*sin(d*x+c)/(a^2-b^2)^2/d/(b+a*cos(d*x+c))^2+3/2*b^4*sin(d*x+c)/(a 
^2-b^2)^3/d/(b+a*cos(d*x+c))+b^2*(3*a^2-b^2)*sin(d*x+c)/(a^2-b^2)^3/d/(b+a 
*cos(d*x+c))
 

Mathematica [A] (verified)

Time = 0.94 (sec) , antiderivative size = 231, normalized size of antiderivative = 0.61 \[ \int \frac {\csc ^2(c+d x)}{(a+b \sec (c+d x))^3} \, dx=\frac {(b+a \cos (c+d x)) \sec ^3(c+d x) \left (\frac {6 a b \left (2 a^2+3 b^2\right ) \text {arctanh}\left (\frac {(-a+b) \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a^2-b^2}}\right ) (b+a \cos (c+d x))^2}{\left (a^2-b^2\right )^{7/2}}-\frac {(b+a \cos (c+d x))^2 \cot \left (\frac {1}{2} (c+d x)\right )}{(a+b)^3}-\frac {b^3 \sin (c+d x)}{(a-b)^2 (a+b)^2}+\frac {b^2 \left (6 a^2+b^2\right ) (b+a \cos (c+d x)) \sin (c+d x)}{(a-b)^3 (a+b)^3}+\frac {(b+a \cos (c+d x))^2 \tan \left (\frac {1}{2} (c+d x)\right )}{(a-b)^3}\right )}{2 d (a+b \sec (c+d x))^3} \] Input:

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

Output:

((b + a*Cos[c + d*x])*Sec[c + d*x]^3*((6*a*b*(2*a^2 + 3*b^2)*ArcTanh[((-a 
+ b)*Tan[(c + d*x)/2])/Sqrt[a^2 - b^2]]*(b + a*Cos[c + d*x])^2)/(a^2 - b^2 
)^(7/2) - ((b + a*Cos[c + d*x])^2*Cot[(c + d*x)/2])/(a + b)^3 - (b^3*Sin[c 
 + d*x])/((a - b)^2*(a + b)^2) + (b^2*(6*a^2 + b^2)*(b + a*Cos[c + d*x])*S 
in[c + d*x])/((a - b)^3*(a + b)^3) + ((b + a*Cos[c + d*x])^2*Tan[(c + d*x) 
/2])/(a - b)^3))/(2*d*(a + b*Sec[c + d*x])^3)
 

Rubi [A] (verified)

Time = 0.99 (sec) , antiderivative size = 376, normalized size of antiderivative = 1.00, number of steps used = 8, number of rules used = 8, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.381, Rules used = {3042, 4360, 25, 25, 3042, 25, 3376, 2009}

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

\(\Big \downarrow \) 3042

\(\displaystyle \int \frac {1}{\cos \left (c+d x-\frac {\pi }{2}\right )^2 \left (a-b \csc \left (c+d x-\frac {\pi }{2}\right )\right )^3}dx\)

\(\Big \downarrow \) 4360

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

\(\Big \downarrow \) 25

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

\(\Big \downarrow \) 25

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

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 25

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

\(\Big \downarrow \) 3376

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

\(\Big \downarrow \) 2009

\(\displaystyle -\frac {2 a b \left (3 a^2+b^2\right ) \text {arctanh}\left (\frac {\sqrt {a-b} \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a+b}}\right )}{d (a-b)^{7/2} (a+b)^{7/2}}-\frac {2 b^3 \left (3 a^2-b^2\right ) \text {arctanh}\left (\frac {\sqrt {a-b} \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a+b}}\right )}{a d (a-b)^{7/2} (a+b)^{7/2}}-\frac {b^3 \left (a^2+2 b^2\right ) \text {arctanh}\left (\frac {\sqrt {a-b} \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a+b}}\right )}{a d (a-b)^{7/2} (a+b)^{7/2}}+\frac {b^2 \left (3 a^2-b^2\right ) \sin (c+d x)}{d \left (a^2-b^2\right )^3 (a \cos (c+d x)+b)}+\frac {3 b^4 \sin (c+d x)}{2 d \left (a^2-b^2\right )^3 (a \cos (c+d x)+b)}-\frac {b^3 \sin (c+d x)}{2 d \left (a^2-b^2\right )^2 (a \cos (c+d x)+b)^2}-\frac {\sin (c+d x)}{2 d (a+b)^3 (1-\cos (c+d x))}+\frac {\sin (c+d x)}{2 d (a-b)^3 (\cos (c+d x)+1)}\)

Input:

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

Output:

(-2*b^3*(3*a^2 - b^2)*ArcTanh[(Sqrt[a - b]*Tan[(c + d*x)/2])/Sqrt[a + b]]) 
/(a*(a - b)^(7/2)*(a + b)^(7/2)*d) - (2*a*b*(3*a^2 + b^2)*ArcTanh[(Sqrt[a 
- b]*Tan[(c + d*x)/2])/Sqrt[a + b]])/((a - b)^(7/2)*(a + b)^(7/2)*d) - (b^ 
3*(a^2 + 2*b^2)*ArcTanh[(Sqrt[a - b]*Tan[(c + d*x)/2])/Sqrt[a + b]])/(a*(a 
 - b)^(7/2)*(a + b)^(7/2)*d) - Sin[c + d*x]/(2*(a + b)^3*d*(1 - Cos[c + d* 
x])) + Sin[c + d*x]/(2*(a - b)^3*d*(1 + Cos[c + d*x])) - (b^3*Sin[c + d*x] 
)/(2*(a^2 - b^2)^2*d*(b + a*Cos[c + d*x])^2) + (3*b^4*Sin[c + d*x])/(2*(a^ 
2 - b^2)^3*d*(b + a*Cos[c + d*x])) + (b^2*(3*a^2 - b^2)*Sin[c + d*x])/((a^ 
2 - b^2)^3*d*(b + a*Cos[c + d*x]))
 

Defintions of rubi rules used

rule 25
Int[-(Fx_), x_Symbol] :> Simp[Identity[-1]   Int[Fx, x], x]
 

rule 2009
Int[u_, x_Symbol] :> Simp[IntSum[u, x], x] /; SumQ[u]
 

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

rule 3376
Int[cos[(e_.) + (f_.)*(x_)]^(p_)*((d_.)*sin[(e_.) + (f_.)*(x_)])^(n_)*((a_) 
 + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_), x_Symbol] :> Int[ExpandTrig[(d*sin[ 
e + f*x])^n*(a + b*sin[e + f*x])^m*(1 - sin[e + f*x]^2)^(p/2), x], x] /; Fr 
eeQ[{a, b, d, e, f}, x] && NeQ[a^2 - b^2, 0] && IntegersQ[m, 2*n, p/2] && ( 
LtQ[m, -1] || (EqQ[m, -1] && GtQ[p, 0]))
 

rule 4360
Int[(cos[(e_.) + (f_.)*(x_)]*(g_.))^(p_.)*(csc[(e_.) + (f_.)*(x_)]*(b_.) + 
(a_))^(m_.), x_Symbol] :> Int[(g*Cos[e + f*x])^p*((b + a*Sin[e + f*x])^m/Si 
n[e + f*x]^m), x] /; FreeQ[{a, b, e, f, g, p}, x] && IntegerQ[m]
 
Maple [A] (verified)

Time = 0.39 (sec) , antiderivative size = 234, normalized size of antiderivative = 0.62

method result size
derivativedivides \(\frac {\frac {\tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{2 a^{3}-6 a^{2} b +6 a \,b^{2}-2 b^{3}}+\frac {2 b \left (\frac {\left (-3 a^{3} b +\frac {5}{2} a^{2} b^{2}-\frac {1}{2} a \,b^{3}+b^{4}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3}+\left (3 a^{3} b +\frac {5}{2} a^{2} b^{2}+\frac {1}{2} a \,b^{3}+b^{4}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2} a -\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2} b -a -b \right )^{2}}-\frac {3 \left (2 a^{2}+3 b^{2}\right ) a \,\operatorname {arctanh}\left (\frac {\left (a -b \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{\sqrt {\left (a +b \right ) \left (a -b \right )}}\right )}{2 \sqrt {\left (a +b \right ) \left (a -b \right )}}\right )}{\left (a -b \right )^{3} \left (a +b \right )^{3}}-\frac {1}{2 \left (a +b \right )^{3} \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}}{d}\) \(234\)
default \(\frac {\frac {\tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{2 a^{3}-6 a^{2} b +6 a \,b^{2}-2 b^{3}}+\frac {2 b \left (\frac {\left (-3 a^{3} b +\frac {5}{2} a^{2} b^{2}-\frac {1}{2} a \,b^{3}+b^{4}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3}+\left (3 a^{3} b +\frac {5}{2} a^{2} b^{2}+\frac {1}{2} a \,b^{3}+b^{4}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2} a -\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2} b -a -b \right )^{2}}-\frac {3 \left (2 a^{2}+3 b^{2}\right ) a \,\operatorname {arctanh}\left (\frac {\left (a -b \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{\sqrt {\left (a +b \right ) \left (a -b \right )}}\right )}{2 \sqrt {\left (a +b \right ) \left (a -b \right )}}\right )}{\left (a -b \right )^{3} \left (a +b \right )^{3}}-\frac {1}{2 \left (a +b \right )^{3} \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}}{d}\) \(234\)
risch \(-\frac {i \left (6 a^{5} b \,{\mathrm e}^{5 i \left (d x +c \right )}+9 a^{3} b^{3} {\mathrm e}^{5 i \left (d x +c \right )}-2 a^{6} {\mathrm e}^{4 i \left (d x +c \right )}+24 a^{4} b^{2} {\mathrm e}^{4 i \left (d x +c \right )}+21 a^{2} b^{4} {\mathrm e}^{4 i \left (d x +c \right )}+2 b^{6} {\mathrm e}^{4 i \left (d x +c \right )}+4 a^{5} b \,{\mathrm e}^{3 i \left (d x +c \right )}+14 a^{3} b^{3} {\mathrm e}^{3 i \left (d x +c \right )}+12 b^{5} {\mathrm e}^{3 i \left (d x +c \right )} a -4 a^{6} {\mathrm e}^{2 i \left (d x +c \right )}+4 a^{4} b^{2} {\mathrm e}^{2 i \left (d x +c \right )}-28 a^{2} b^{4} {\mathrm e}^{2 i \left (d x +c \right )}-2 b^{6} {\mathrm e}^{2 i \left (d x +c \right )}-2 a^{5} b \,{\mathrm e}^{i \left (d x +c \right )}-39 b^{3} {\mathrm e}^{i \left (d x +c \right )} a^{3}-4 b^{5} {\mathrm e}^{i \left (d x +c \right )} a -2 a^{6}-12 a^{4} b^{2}-a^{2} b^{4}\right )}{a \left (a \,{\mathrm e}^{2 i \left (d x +c \right )}+2 b \,{\mathrm e}^{i \left (d x +c \right )}+a \right )^{2} \left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right ) \left (-a^{2}+b^{2}\right )^{3} d}-\frac {3 b \,a^{3} \ln \left ({\mathrm e}^{i \left (d x +c \right )}+\frac {i a^{2}-i b^{2}+\sqrt {a^{2}-b^{2}}\, b}{a \sqrt {a^{2}-b^{2}}}\right )}{\sqrt {a^{2}-b^{2}}\, \left (a +b \right )^{3} \left (a -b \right )^{3} d}-\frac {9 b^{3} a \ln \left ({\mathrm e}^{i \left (d x +c \right )}+\frac {i a^{2}-i b^{2}+\sqrt {a^{2}-b^{2}}\, b}{a \sqrt {a^{2}-b^{2}}}\right )}{2 \sqrt {a^{2}-b^{2}}\, \left (a +b \right )^{3} \left (a -b \right )^{3} d}+\frac {3 b \,a^{3} \ln \left ({\mathrm e}^{i \left (d x +c \right )}+\frac {-i a^{2}+i b^{2}+\sqrt {a^{2}-b^{2}}\, b}{a \sqrt {a^{2}-b^{2}}}\right )}{\sqrt {a^{2}-b^{2}}\, \left (a +b \right )^{3} \left (a -b \right )^{3} d}+\frac {9 b^{3} a \ln \left ({\mathrm e}^{i \left (d x +c \right )}+\frac {-i a^{2}+i b^{2}+\sqrt {a^{2}-b^{2}}\, b}{a \sqrt {a^{2}-b^{2}}}\right )}{2 \sqrt {a^{2}-b^{2}}\, \left (a +b \right )^{3} \left (a -b \right )^{3} d}\) \(670\)

Input:

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

Output:

1/d*(1/2*tan(1/2*d*x+1/2*c)/(a^3-3*a^2*b+3*a*b^2-b^3)+2*b/(a-b)^3/(a+b)^3* 
(((-3*a^3*b+5/2*a^2*b^2-1/2*a*b^3+b^4)*tan(1/2*d*x+1/2*c)^3+(3*a^3*b+5/2*a 
^2*b^2+1/2*a*b^3+b^4)*tan(1/2*d*x+1/2*c))/(tan(1/2*d*x+1/2*c)^2*a-tan(1/2* 
d*x+1/2*c)^2*b-a-b)^2-3/2*(2*a^2+3*b^2)*a/((a+b)*(a-b))^(1/2)*arctanh((a-b 
)*tan(1/2*d*x+1/2*c)/((a+b)*(a-b))^(1/2)))-1/2/(a+b)^3/tan(1/2*d*x+1/2*c))
 

Fricas [A] (verification not implemented)

Time = 0.13 (sec) , antiderivative size = 841, normalized size of antiderivative = 2.24 \[ \int \frac {\csc ^2(c+d x)}{(a+b \sec (c+d x))^3} \, dx =\text {Too large to display} \] Input:

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

Output:

[1/4*(22*a^4*b^3 - 14*a^2*b^5 - 8*b^7 - 2*(2*a^7 + 10*a^5*b^2 - 11*a^3*b^4 
 - a*b^6)*cos(d*x + c)^3 - 3*(2*a^3*b^3 + 3*a*b^5 + (2*a^5*b + 3*a^3*b^3)* 
cos(d*x + c)^2 + 2*(2*a^4*b^2 + 3*a^2*b^4)*cos(d*x + c))*sqrt(a^2 - b^2)*l 
og((2*a*b*cos(d*x + c) - (a^2 - 2*b^2)*cos(d*x + c)^2 + 2*sqrt(a^2 - b^2)* 
(b*cos(d*x + c) + a)*sin(d*x + c) + 2*a^2 - b^2)/(a^2*cos(d*x + c)^2 + 2*a 
*b*cos(d*x + c) + b^2))*sin(d*x + c) + 2*(2*a^6*b - 17*a^4*b^3 + 13*a^2*b^ 
5 + 2*b^7)*cos(d*x + c)^2 + 2*(16*a^5*b^2 - 17*a^3*b^4 + a*b^6)*cos(d*x + 
c))/(((a^10 - 4*a^8*b^2 + 6*a^6*b^4 - 4*a^4*b^6 + a^2*b^8)*d*cos(d*x + c)^ 
2 + 2*(a^9*b - 4*a^7*b^3 + 6*a^5*b^5 - 4*a^3*b^7 + a*b^9)*d*cos(d*x + c) + 
 (a^8*b^2 - 4*a^6*b^4 + 6*a^4*b^6 - 4*a^2*b^8 + b^10)*d)*sin(d*x + c)), 1/ 
2*(11*a^4*b^3 - 7*a^2*b^5 - 4*b^7 - (2*a^7 + 10*a^5*b^2 - 11*a^3*b^4 - a*b 
^6)*cos(d*x + c)^3 - 3*(2*a^3*b^3 + 3*a*b^5 + (2*a^5*b + 3*a^3*b^3)*cos(d* 
x + c)^2 + 2*(2*a^4*b^2 + 3*a^2*b^4)*cos(d*x + c))*sqrt(-a^2 + b^2)*arctan 
(-sqrt(-a^2 + b^2)*(b*cos(d*x + c) + a)/((a^2 - b^2)*sin(d*x + c)))*sin(d* 
x + c) + (2*a^6*b - 17*a^4*b^3 + 13*a^2*b^5 + 2*b^7)*cos(d*x + c)^2 + (16* 
a^5*b^2 - 17*a^3*b^4 + a*b^6)*cos(d*x + c))/(((a^10 - 4*a^8*b^2 + 6*a^6*b^ 
4 - 4*a^4*b^6 + a^2*b^8)*d*cos(d*x + c)^2 + 2*(a^9*b - 4*a^7*b^3 + 6*a^5*b 
^5 - 4*a^3*b^7 + a*b^9)*d*cos(d*x + c) + (a^8*b^2 - 4*a^6*b^4 + 6*a^4*b^6 
- 4*a^2*b^8 + b^10)*d)*sin(d*x + c))]
                                                                                    
                                                                                    
 

Sympy [F]

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

integrate(csc(d*x+c)**2/(a+b*sec(d*x+c))**3,x)
 

Output:

Integral(csc(c + d*x)**2/(a + b*sec(c + d*x))**3, x)
 

Maxima [F(-2)]

Exception generated. \[ \int \frac {\csc ^2(c+d x)}{(a+b \sec (c+d x))^3} \, dx=\text {Exception raised: ValueError} \] Input:

integrate(csc(d*x+c)^2/(a+b*sec(d*x+c))^3,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*a^2-4*b^2>0)', see `assume?` f 
or more de
 

Giac [A] (verification not implemented)

Time = 0.26 (sec) , antiderivative size = 386, normalized size of antiderivative = 1.03 \[ \int \frac {\csc ^2(c+d x)}{(a+b \sec (c+d x))^3} \, dx=\frac {\frac {6 \, {\left (2 \, a^{3} b + 3 \, a b^{3}\right )} {\left (\pi \left \lfloor \frac {d x + c}{2 \, \pi } + \frac {1}{2} \right \rfloor \mathrm {sgn}\left (2 \, a - 2 \, b\right ) + \arctan \left (\frac {a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{\sqrt {-a^{2} + b^{2}}}\right )\right )}}{{\left (a^{6} - 3 \, a^{4} b^{2} + 3 \, a^{2} b^{4} - b^{6}\right )} \sqrt {-a^{2} + b^{2}}} + \frac {\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{a^{3} - 3 \, a^{2} b + 3 \, a b^{2} - b^{3}} - \frac {2 \, {\left (6 \, a^{3} b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 5 \, a^{2} b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + a b^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 2 \, b^{5} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 6 \, a^{3} b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 5 \, a^{2} b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - a b^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 2 \, b^{5} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )}}{{\left (a^{6} - 3 \, a^{4} b^{2} + 3 \, a^{2} b^{4} - b^{6}\right )} {\left (a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - a - b\right )}^{2}} - \frac {1}{{\left (a^{3} + 3 \, a^{2} b + 3 \, a b^{2} + b^{3}\right )} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}}{2 \, d} \] Input:

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

Output:

1/2*(6*(2*a^3*b + 3*a*b^3)*(pi*floor(1/2*(d*x + c)/pi + 1/2)*sgn(2*a - 2*b 
) + arctan((a*tan(1/2*d*x + 1/2*c) - b*tan(1/2*d*x + 1/2*c))/sqrt(-a^2 + b 
^2)))/((a^6 - 3*a^4*b^2 + 3*a^2*b^4 - b^6)*sqrt(-a^2 + b^2)) + tan(1/2*d*x 
 + 1/2*c)/(a^3 - 3*a^2*b + 3*a*b^2 - b^3) - 2*(6*a^3*b^2*tan(1/2*d*x + 1/2 
*c)^3 - 5*a^2*b^3*tan(1/2*d*x + 1/2*c)^3 + a*b^4*tan(1/2*d*x + 1/2*c)^3 - 
2*b^5*tan(1/2*d*x + 1/2*c)^3 - 6*a^3*b^2*tan(1/2*d*x + 1/2*c) - 5*a^2*b^3* 
tan(1/2*d*x + 1/2*c) - a*b^4*tan(1/2*d*x + 1/2*c) - 2*b^5*tan(1/2*d*x + 1/ 
2*c))/((a^6 - 3*a^4*b^2 + 3*a^2*b^4 - b^6)*(a*tan(1/2*d*x + 1/2*c)^2 - b*t 
an(1/2*d*x + 1/2*c)^2 - a - b)^2) - 1/((a^3 + 3*a^2*b + 3*a*b^2 + b^3)*tan 
(1/2*d*x + 1/2*c)))/d
 

Mupad [B] (verification not implemented)

Time = 13.38 (sec) , antiderivative size = 423, normalized size of antiderivative = 1.12 \[ \int \frac {\csc ^2(c+d x)}{(a+b \sec (c+d x))^3} \, dx=\frac {\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{2\,d\,{\left (a-b\right )}^3}-\frac {\frac {a^3-3\,a^2\,b+3\,a\,b^2-b^3}{a+b}+\frac {{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4\,\left (a^5-5\,a^4\,b+22\,a^3\,b^2-20\,a^2\,b^3+7\,a\,b^4-5\,b^5\right )}{{\left (a+b\right )}^3}-\frac {2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2\,\left (a^4-4\,a^3\,b+12\,a^2\,b^2-5\,a\,b^3+3\,b^4\right )}{{\left (a+b\right )}^2}}{d\,\left (\left (2\,a^5-10\,a^4\,b+20\,a^3\,b^2-20\,a^2\,b^3+10\,a\,b^4-2\,b^5\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5+\left (-4\,a^5+12\,a^4\,b-8\,a^3\,b^2-8\,a^2\,b^3+12\,a\,b^4-4\,b^5\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3+\left (2\,a^5-2\,a^4\,b-4\,a^3\,b^2+4\,a^2\,b^3+2\,a\,b^4-2\,b^5\right )\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )}+\frac {a\,b\,\mathrm {atan}\left (\frac {1{}\mathrm {i}\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,a^6-3{}\mathrm {i}\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,a^4\,b^2+3{}\mathrm {i}\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,a^2\,b^4-1{}\mathrm {i}\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,b^6}{{\left (a+b\right )}^{7/2}\,{\left (a-b\right )}^{5/2}}\right )\,\left (2\,a^2+3\,b^2\right )\,3{}\mathrm {i}}{d\,{\left (a+b\right )}^{7/2}\,{\left (a-b\right )}^{7/2}} \] Input:

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

Output:

tan(c/2 + (d*x)/2)/(2*d*(a - b)^3) - ((3*a*b^2 - 3*a^2*b + a^3 - b^3)/(a + 
 b) + (tan(c/2 + (d*x)/2)^4*(7*a*b^4 - 5*a^4*b + a^5 - 5*b^5 - 20*a^2*b^3 
+ 22*a^3*b^2))/(a + b)^3 - (2*tan(c/2 + (d*x)/2)^2*(a^4 - 4*a^3*b - 5*a*b^ 
3 + 3*b^4 + 12*a^2*b^2))/(a + b)^2)/(d*(tan(c/2 + (d*x)/2)*(2*a*b^4 - 2*a^ 
4*b + 2*a^5 - 2*b^5 + 4*a^2*b^3 - 4*a^3*b^2) - tan(c/2 + (d*x)/2)^3*(4*a^5 
 - 12*a^4*b - 12*a*b^4 + 4*b^5 + 8*a^2*b^3 + 8*a^3*b^2) + tan(c/2 + (d*x)/ 
2)^5*(10*a*b^4 - 10*a^4*b + 2*a^5 - 2*b^5 - 20*a^2*b^3 + 20*a^3*b^2))) + ( 
a*b*atan((a^6*tan(c/2 + (d*x)/2)*1i - b^6*tan(c/2 + (d*x)/2)*1i + a^2*b^4* 
tan(c/2 + (d*x)/2)*3i - a^4*b^2*tan(c/2 + (d*x)/2)*3i)/((a + b)^(7/2)*(a - 
 b)^(5/2)))*(2*a^2 + 3*b^2)*3i)/(d*(a + b)^(7/2)*(a - b)^(7/2))
 

Reduce [B] (verification not implemented)

Time = 0.19 (sec) , antiderivative size = 862, normalized size of antiderivative = 2.29 \[ \int \frac {\csc ^2(c+d x)}{(a+b \sec (c+d x))^3} \, dx =\text {Too large to display} \] Input:

int(csc(d*x+c)^2/(a+b*sec(d*x+c))^3,x)
 

Output:

( - 24*sqrt( - a**2 + b**2)*atan((tan((c + d*x)/2)*a - tan((c + d*x)/2)*b) 
/sqrt( - a**2 + b**2))*cos(c + d*x)*sin(c + d*x)*a**4*b**2 - 36*sqrt( - a* 
*2 + b**2)*atan((tan((c + d*x)/2)*a - tan((c + d*x)/2)*b)/sqrt( - a**2 + b 
**2))*cos(c + d*x)*sin(c + d*x)*a**2*b**4 + 12*sqrt( - a**2 + b**2)*atan(( 
tan((c + d*x)/2)*a - tan((c + d*x)/2)*b)/sqrt( - a**2 + b**2))*sin(c + d*x 
)**3*a**5*b + 18*sqrt( - a**2 + b**2)*atan((tan((c + d*x)/2)*a - tan((c + 
d*x)/2)*b)/sqrt( - a**2 + b**2))*sin(c + d*x)**3*a**3*b**3 - 12*sqrt( - a* 
*2 + b**2)*atan((tan((c + d*x)/2)*a - tan((c + d*x)/2)*b)/sqrt( - a**2 + b 
**2))*sin(c + d*x)*a**5*b - 30*sqrt( - a**2 + b**2)*atan((tan((c + d*x)/2) 
*a - tan((c + d*x)/2)*b)/sqrt( - a**2 + b**2))*sin(c + d*x)*a**3*b**3 - 18 
*sqrt( - a**2 + b**2)*atan((tan((c + d*x)/2)*a - tan((c + d*x)/2)*b)/sqrt( 
 - a**2 + b**2))*sin(c + d*x)*a*b**5 + 2*cos(c + d*x)*sin(c + d*x)**2*a**7 
 + 10*cos(c + d*x)*sin(c + d*x)**2*a**5*b**2 - 11*cos(c + d*x)*sin(c + d*x 
)**2*a**3*b**4 - cos(c + d*x)*sin(c + d*x)**2*a*b**6 - 2*cos(c + d*x)*a**7 
 + 6*cos(c + d*x)*a**5*b**2 - 6*cos(c + d*x)*a**3*b**4 + 2*cos(c + d*x)*a* 
b**6 - 2*sin(c + d*x)**2*a**6*b + 17*sin(c + d*x)**2*a**4*b**3 - 13*sin(c 
+ d*x)**2*a**2*b**5 - 2*sin(c + d*x)**2*b**7 + 2*a**6*b - 6*a**4*b**3 + 6* 
a**2*b**5 - 2*b**7)/(2*sin(c + d*x)*d*(2*cos(c + d*x)*a**9*b - 8*cos(c + d 
*x)*a**7*b**3 + 12*cos(c + d*x)*a**5*b**5 - 8*cos(c + d*x)*a**3*b**7 + 2*c 
os(c + d*x)*a*b**9 - sin(c + d*x)**2*a**10 + 4*sin(c + d*x)**2*a**8*b**...