\(\int (a+b \cot ^2(x))^{3/2} \tan ^2(x) \, dx\) [30]

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

Optimal result

Integrand size = 17, antiderivative size = 80 \[ \int \left (a+b \cot ^2(x)\right )^{3/2} \tan ^2(x) \, dx=(a-b)^{3/2} \arctan \left (\frac {\sqrt {a-b} \cot (x)}{\sqrt {a+b \cot ^2(x)}}\right )-b^{3/2} \text {arctanh}\left (\frac {\sqrt {b} \cot (x)}{\sqrt {a+b \cot ^2(x)}}\right )+a \sqrt {a+b \cot ^2(x)} \tan (x) \] Output:

(a-b)^(3/2)*arctan((a-b)^(1/2)*cot(x)/(a+b*cot(x)^2)^(1/2))-b^(3/2)*arctan 
h(b^(1/2)*cot(x)/(a+b*cot(x)^2)^(1/2))+a*(a+b*cot(x)^2)^(1/2)*tan(x)
 

Mathematica [B] (warning: unable to verify)

Leaf count is larger than twice the leaf count of optimal. \(222\) vs. \(2(80)=160\).

Time = 0.51 (sec) , antiderivative size = 222, normalized size of antiderivative = 2.78 \[ \int \left (a+b \cot ^2(x)\right )^{3/2} \tan ^2(x) \, dx=\frac {\sqrt {-\left ((-a-b+(a-b) \cos (2 x)) \csc ^2(x)\right )} \left (-\sqrt {2} (a-b)^2 \sqrt {-b} \text {arctanh}\left (\frac {\sqrt {2} \sqrt {a-b} \cos (x)}{\sqrt {-a-b+(a-b) \cos (2 x)}}\right )+\sqrt {a-b} \left (\sqrt {2} b^2 \text {arctanh}\left (\frac {\sqrt {2} \sqrt {-b} \cos (x)}{\sqrt {-a-b+(a-b) \cos (2 x)}}\right )+a \sqrt {-b} \sqrt {-a-b+(a-b) \cos (2 x)} \sec (x)\right )\right ) \sin (x)}{\sqrt {2} \sqrt {a-b} \sqrt {-b} \sqrt {-a-b+(a-b) \cos (2 x)}} \] Input:

Integrate[(a + b*Cot[x]^2)^(3/2)*Tan[x]^2,x]
 

Output:

(Sqrt[-((-a - b + (a - b)*Cos[2*x])*Csc[x]^2)]*(-(Sqrt[2]*(a - b)^2*Sqrt[- 
b]*ArcTanh[(Sqrt[2]*Sqrt[a - b]*Cos[x])/Sqrt[-a - b + (a - b)*Cos[2*x]]]) 
+ Sqrt[a - b]*(Sqrt[2]*b^2*ArcTanh[(Sqrt[2]*Sqrt[-b]*Cos[x])/Sqrt[-a - b + 
 (a - b)*Cos[2*x]]] + a*Sqrt[-b]*Sqrt[-a - b + (a - b)*Cos[2*x]]*Sec[x]))* 
Sin[x])/(Sqrt[2]*Sqrt[a - b]*Sqrt[-b]*Sqrt[-a - b + (a - b)*Cos[2*x]])
 

Rubi [A] (verified)

Time = 0.36 (sec) , antiderivative size = 80, normalized size of antiderivative = 1.00, number of steps used = 10, number of rules used = 9, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.529, Rules used = {3042, 4153, 376, 25, 398, 224, 219, 291, 216}

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 \tan ^2(x) \left (a+b \cot ^2(x)\right )^{3/2} \, dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \int \frac {\left (a+b \tan \left (x+\frac {\pi }{2}\right )^2\right )^{3/2}}{\tan \left (x+\frac {\pi }{2}\right )^2}dx\)

\(\Big \downarrow \) 4153

\(\displaystyle -\int \frac {\left (b \cot ^2(x)+a\right )^{3/2} \tan ^2(x)}{\cot ^2(x)+1}d\cot (x)\)

\(\Big \downarrow \) 376

\(\displaystyle a \tan (x) \sqrt {a+b \cot ^2(x)}-\int -\frac {a (a-2 b)-b^2 \cot ^2(x)}{\left (\cot ^2(x)+1\right ) \sqrt {b \cot ^2(x)+a}}d\cot (x)\)

\(\Big \downarrow \) 25

\(\displaystyle \int \frac {a (a-2 b)-b^2 \cot ^2(x)}{\left (\cot ^2(x)+1\right ) \sqrt {b \cot ^2(x)+a}}d\cot (x)+a \tan (x) \sqrt {a+b \cot ^2(x)}\)

\(\Big \downarrow \) 398

\(\displaystyle -b^2 \int \frac {1}{\sqrt {b \cot ^2(x)+a}}d\cot (x)+(a-b)^2 \int \frac {1}{\left (\cot ^2(x)+1\right ) \sqrt {b \cot ^2(x)+a}}d\cot (x)+a \tan (x) \sqrt {a+b \cot ^2(x)}\)

\(\Big \downarrow \) 224

\(\displaystyle -b^2 \int \frac {1}{1-\frac {b \cot ^2(x)}{b \cot ^2(x)+a}}d\frac {\cot (x)}{\sqrt {b \cot ^2(x)+a}}+(a-b)^2 \int \frac {1}{\left (\cot ^2(x)+1\right ) \sqrt {b \cot ^2(x)+a}}d\cot (x)+a \tan (x) \sqrt {a+b \cot ^2(x)}\)

\(\Big \downarrow \) 219

\(\displaystyle (a-b)^2 \int \frac {1}{\left (\cot ^2(x)+1\right ) \sqrt {b \cot ^2(x)+a}}d\cot (x)-b^{3/2} \text {arctanh}\left (\frac {\sqrt {b} \cot (x)}{\sqrt {a+b \cot ^2(x)}}\right )+a \tan (x) \sqrt {a+b \cot ^2(x)}\)

\(\Big \downarrow \) 291

\(\displaystyle (a-b)^2 \int \frac {1}{1-\frac {(b-a) \cot ^2(x)}{b \cot ^2(x)+a}}d\frac {\cot (x)}{\sqrt {b \cot ^2(x)+a}}-b^{3/2} \text {arctanh}\left (\frac {\sqrt {b} \cot (x)}{\sqrt {a+b \cot ^2(x)}}\right )+a \tan (x) \sqrt {a+b \cot ^2(x)}\)

\(\Big \downarrow \) 216

\(\displaystyle (a-b)^{3/2} \arctan \left (\frac {\sqrt {a-b} \cot (x)}{\sqrt {a+b \cot ^2(x)}}\right )-b^{3/2} \text {arctanh}\left (\frac {\sqrt {b} \cot (x)}{\sqrt {a+b \cot ^2(x)}}\right )+a \tan (x) \sqrt {a+b \cot ^2(x)}\)

Input:

Int[(a + b*Cot[x]^2)^(3/2)*Tan[x]^2,x]
 

Output:

(a - b)^(3/2)*ArcTan[(Sqrt[a - b]*Cot[x])/Sqrt[a + b*Cot[x]^2]] - b^(3/2)* 
ArcTanh[(Sqrt[b]*Cot[x])/Sqrt[a + b*Cot[x]^2]] + a*Sqrt[a + b*Cot[x]^2]*Ta 
n[x]
 

Defintions of rubi rules used

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

rule 216
Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[b, 2]))*A 
rcTan[Rt[b, 2]*(x/Rt[a, 2])], x] /; FreeQ[{a, b}, x] && PosQ[a/b] && (GtQ[a 
, 0] || GtQ[b, 0])
 

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 224
Int[1/Sqrt[(a_) + (b_.)*(x_)^2], x_Symbol] :> Subst[Int[1/(1 - b*x^2), x], 
x, x/Sqrt[a + b*x^2]] /; FreeQ[{a, b}, x] &&  !GtQ[a, 0]
 

rule 291
Int[1/(Sqrt[(a_) + (b_.)*(x_)^2]*((c_) + (d_.)*(x_)^2)), x_Symbol] :> Subst 
[Int[1/(c - (b*c - a*d)*x^2), x], x, x/Sqrt[a + b*x^2]] /; FreeQ[{a, b, c, 
d}, x] && NeQ[b*c - a*d, 0]
 

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

rule 398
Int[((e_) + (f_.)*(x_)^2)/(((a_) + (b_.)*(x_)^2)*Sqrt[(c_) + (d_.)*(x_)^2]) 
, x_Symbol] :> Simp[f/b   Int[1/Sqrt[c + d*x^2], x], x] + Simp[(b*e - a*f)/ 
b   Int[1/((a + b*x^2)*Sqrt[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 4153
Int[((d_.)*tan[(e_.) + (f_.)*(x_)])^(m_.)*((a_) + (b_.)*((c_.)*tan[(e_.) + 
(f_.)*(x_)])^(n_))^(p_.), x_Symbol] :> With[{ff = FreeFactors[Tan[e + f*x], 
 x]}, Simp[c*(ff/f)   Subst[Int[(d*ff*(x/c))^m*((a + b*(ff*x)^n)^p/(c^2 + f 
f^2*x^2)), x], x, c*(Tan[e + f*x]/ff)], x]] /; FreeQ[{a, b, c, d, e, f, m, 
n, p}, x] && (IGtQ[p, 0] || EqQ[n, 2] || EqQ[n, 4] || (IntegerQ[p] && Ratio 
nalQ[n]))
 
Maple [B] (warning: unable to verify)

Leaf count of result is larger than twice the leaf count of optimal. \(564\) vs. \(2(66)=132\).

Time = 2.56 (sec) , antiderivative size = 565, normalized size of antiderivative = 7.06

method result size
default \(\frac {\sqrt {4}\, \left (a +b \cot \left (x \right )^{2}\right )^{\frac {3}{2}} \left (\left (-2+2 \cos \left (x \right )\right ) b^{\frac {7}{2}} \ln \left (4 \sqrt {\frac {\cos \left (x \right )^{2} b +a \sin \left (x \right )^{2}}{\left (\cos \left (x \right )+1\right )^{2}}}\, \sqrt {-a +b}\, \cos \left (x \right )+4 \sqrt {-a +b}\, \sqrt {\frac {\cos \left (x \right )^{2} b +a \sin \left (x \right )^{2}}{\left (\cos \left (x \right )+1\right )^{2}}}-4 \cos \left (x \right ) a +4 b \cos \left (x \right )\right ) \sin \left (x \right )+\left (-4 \cos \left (x \right )+4\right ) b^{\frac {5}{2}} \ln \left (4 \sqrt {\frac {\cos \left (x \right )^{2} b +a \sin \left (x \right )^{2}}{\left (\cos \left (x \right )+1\right )^{2}}}\, \sqrt {-a +b}\, \cos \left (x \right )+4 \sqrt {-a +b}\, \sqrt {\frac {\cos \left (x \right )^{2} b +a \sin \left (x \right )^{2}}{\left (\cos \left (x \right )+1\right )^{2}}}-4 \cos \left (x \right ) a +4 b \cos \left (x \right )\right ) a \sin \left (x \right )-2 b^{\frac {3}{2}} \sqrt {\frac {\cos \left (x \right )^{2} b +a \sin \left (x \right )^{2}}{\left (\cos \left (x \right )+1\right )^{2}}}\, \sqrt {-a +b}\, a \sin \left (x \right )^{2} \tan \left (x \right )+\left (-2+2 \cos \left (x \right )\right ) b^{\frac {3}{2}} \ln \left (4 \sqrt {\frac {\cos \left (x \right )^{2} b +a \sin \left (x \right )^{2}}{\left (\cos \left (x \right )+1\right )^{2}}}\, \sqrt {-a +b}\, \cos \left (x \right )+4 \sqrt {-a +b}\, \sqrt {\frac {\cos \left (x \right )^{2} b +a \sin \left (x \right )^{2}}{\left (\cos \left (x \right )+1\right )^{2}}}-4 \cos \left (x \right ) a +4 b \cos \left (x \right )\right ) a^{2} \sin \left (x \right )+\left (1-\cos \left (x \right )\right ) \sqrt {-a +b}\, \ln \left (\frac {4 \sqrt {\frac {\cos \left (x \right )^{2} b +a \sin \left (x \right )^{2}}{\left (\cos \left (x \right )+1\right )^{2}}}\, \sqrt {b}\, \sin \left (x \right )^{2}+4 a \cos \left (x \right )^{2}-2 \cos \left (x \right )^{2} b +2 b \sin \left (x \right )^{2}-8 \cos \left (x \right ) a +4 b \cos \left (x \right )+4 a -2 b}{\left (-1+\cos \left (x \right )\right )^{2}}\right ) b^{3} \sin \left (x \right )+\left (-1+\cos \left (x \right )\right ) \sqrt {-a +b}\, \ln \left (\frac {2 \sqrt {b}\, \sqrt {\frac {\cos \left (x \right )^{2} b +a \sin \left (x \right )^{2}}{\left (\cos \left (x \right )+1\right )^{2}}}\, \cos \left (x \right )+2 \cos \left (x \right ) a -2 b \cos \left (x \right )+2 \sqrt {\frac {\cos \left (x \right )^{2} b +a \sin \left (x \right )^{2}}{\left (\cos \left (x \right )+1\right )^{2}}}\, \sqrt {b}+2 a}{\sqrt {b}\, \left (\cos \left (x \right )+1\right )}\right ) b^{3} \sin \left (x \right )\right )}{4 b^{\frac {3}{2}} \sqrt {-a +b}\, \left (-\cos \left (x \right )^{2} b -a \sin \left (x \right )^{2}\right ) \sqrt {\frac {\cos \left (x \right )^{2} b +a \sin \left (x \right )^{2}}{\left (\cos \left (x \right )+1\right )^{2}}}}\) \(565\)

Input:

int((a+b*cot(x)^2)^(3/2)*tan(x)^2,x,method=_RETURNVERBOSE)
 

Output:

1/4*4^(1/2)/b^(3/2)/(-a+b)^(1/2)*(a+b*cot(x)^2)^(3/2)/(-cos(x)^2*b-a*sin(x 
)^2)/((cos(x)^2*b+a*sin(x)^2)/(cos(x)+1)^2)^(1/2)*((-2+2*cos(x))*b^(7/2)*l 
n(4*((cos(x)^2*b+a*sin(x)^2)/(cos(x)+1)^2)^(1/2)*(-a+b)^(1/2)*cos(x)+4*(-a 
+b)^(1/2)*((cos(x)^2*b+a*sin(x)^2)/(cos(x)+1)^2)^(1/2)-4*cos(x)*a+4*b*cos( 
x))*sin(x)+(-4*cos(x)+4)*b^(5/2)*ln(4*((cos(x)^2*b+a*sin(x)^2)/(cos(x)+1)^ 
2)^(1/2)*(-a+b)^(1/2)*cos(x)+4*(-a+b)^(1/2)*((cos(x)^2*b+a*sin(x)^2)/(cos( 
x)+1)^2)^(1/2)-4*cos(x)*a+4*b*cos(x))*a*sin(x)-2*b^(3/2)*((cos(x)^2*b+a*si 
n(x)^2)/(cos(x)+1)^2)^(1/2)*(-a+b)^(1/2)*a*sin(x)^2*tan(x)+(-2+2*cos(x))*b 
^(3/2)*ln(4*((cos(x)^2*b+a*sin(x)^2)/(cos(x)+1)^2)^(1/2)*(-a+b)^(1/2)*cos( 
x)+4*(-a+b)^(1/2)*((cos(x)^2*b+a*sin(x)^2)/(cos(x)+1)^2)^(1/2)-4*cos(x)*a+ 
4*b*cos(x))*a^2*sin(x)+(1-cos(x))*(-a+b)^(1/2)*ln(2*(2*((cos(x)^2*b+a*sin( 
x)^2)/(cos(x)+1)^2)^(1/2)*b^(1/2)*sin(x)^2+2*a*cos(x)^2-cos(x)^2*b+b*sin(x 
)^2-4*cos(x)*a+2*b*cos(x)+2*a-b)/(-1+cos(x))^2)*b^3*sin(x)+(-1+cos(x))*(-a 
+b)^(1/2)*ln(2/b^(1/2)*(b^(1/2)*((cos(x)^2*b+a*sin(x)^2)/(cos(x)+1)^2)^(1/ 
2)*cos(x)+((cos(x)^2*b+a*sin(x)^2)/(cos(x)+1)^2)^(1/2)*b^(1/2)+cos(x)*a-b* 
cos(x)+a)/(cos(x)+1))*b^3*sin(x))
 

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 135 vs. \(2 (66) = 132\).

Time = 0.57 (sec) , antiderivative size = 603, normalized size of antiderivative = 7.54 \[ \int \left (a+b \cot ^2(x)\right )^{3/2} \tan ^2(x) \, dx =\text {Too large to display} \] Input:

integrate((a+b*cot(x)^2)^(3/2)*tan(x)^2,x, algorithm="fricas")
 

Output:

[1/4*(-a + b)^(3/2)*log(-(a^2*tan(x)^4 - 2*(3*a^2 - 4*a*b)*tan(x)^2 + a^2 
- 8*a*b + 8*b^2 + 4*(a*tan(x)^3 - (a - 2*b)*tan(x))*sqrt(-a + b)*sqrt((a*t 
an(x)^2 + b)/tan(x)^2))/(tan(x)^4 + 2*tan(x)^2 + 1)) + 1/2*b^(3/2)*log((a* 
tan(x)^2 - 2*sqrt(b)*sqrt((a*tan(x)^2 + b)/tan(x)^2)*tan(x) + 2*b)/tan(x)^ 
2) + a*sqrt((a*tan(x)^2 + b)/tan(x)^2)*tan(x), sqrt(-b)*b*arctan(sqrt(-b)* 
sqrt((a*tan(x)^2 + b)/tan(x)^2)*tan(x)/(a*tan(x)^2 + b)) + 1/4*(-a + b)^(3 
/2)*log(-(a^2*tan(x)^4 - 2*(3*a^2 - 4*a*b)*tan(x)^2 + a^2 - 8*a*b + 8*b^2 
+ 4*(a*tan(x)^3 - (a - 2*b)*tan(x))*sqrt(-a + b)*sqrt((a*tan(x)^2 + b)/tan 
(x)^2))/(tan(x)^4 + 2*tan(x)^2 + 1)) + a*sqrt((a*tan(x)^2 + b)/tan(x)^2)*t 
an(x), 1/2*(a - b)^(3/2)*arctan(-1/2*(a*tan(x)^3 - (a - 2*b)*tan(x))*sqrt( 
a - b)*sqrt((a*tan(x)^2 + b)/tan(x)^2)/((a^2 - a*b)*tan(x)^2 + a*b - b^2)) 
 + 1/2*b^(3/2)*log((a*tan(x)^2 - 2*sqrt(b)*sqrt((a*tan(x)^2 + b)/tan(x)^2) 
*tan(x) + 2*b)/tan(x)^2) + a*sqrt((a*tan(x)^2 + b)/tan(x)^2)*tan(x), 1/2*( 
a - b)^(3/2)*arctan(-1/2*(a*tan(x)^3 - (a - 2*b)*tan(x))*sqrt(a - b)*sqrt( 
(a*tan(x)^2 + b)/tan(x)^2)/((a^2 - a*b)*tan(x)^2 + a*b - b^2)) + sqrt(-b)* 
b*arctan(sqrt(-b)*sqrt((a*tan(x)^2 + b)/tan(x)^2)*tan(x)/(a*tan(x)^2 + b)) 
 + a*sqrt((a*tan(x)^2 + b)/tan(x)^2)*tan(x)]
 

Sympy [F]

\[ \int \left (a+b \cot ^2(x)\right )^{3/2} \tan ^2(x) \, dx=\int \left (a + b \cot ^{2}{\left (x \right )}\right )^{\frac {3}{2}} \tan ^{2}{\left (x \right )}\, dx \] Input:

integrate((a+b*cot(x)**2)**(3/2)*tan(x)**2,x)
 

Output:

Integral((a + b*cot(x)**2)**(3/2)*tan(x)**2, x)
                                                                                    
                                                                                    
 

Maxima [F]

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

integrate((a+b*cot(x)^2)^(3/2)*tan(x)^2,x, algorithm="maxima")
 

Output:

integrate((b*cot(x)^2 + a)^(3/2)*tan(x)^2, x)
 

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 625 vs. \(2 (66) = 132\).

Time = 1.08 (sec) , antiderivative size = 625, normalized size of antiderivative = 7.81 \[ \int \left (a+b \cot ^2(x)\right )^{3/2} \tan ^2(x) \, dx=-\frac {1}{2} \, {\left (\frac {2 \, \sqrt {-a + b} b^{2} \arctan \left (\frac {{\left (\sqrt {-a + b} \cos \left (x\right ) - \sqrt {-a \cos \left (x\right )^{2} + b \cos \left (x\right )^{2} + a}\right )}^{2} + a - 2 \, b}{2 \, \sqrt {a b - b^{2}}}\right )}{\sqrt {a b - b^{2}}} - {\left (a - b\right )} \sqrt {-a + b} \log \left ({\left (\sqrt {-a + b} \cos \left (x\right ) - \sqrt {-a \cos \left (x\right )^{2} + b \cos \left (x\right )^{2} + a}\right )}^{2}\right ) + \frac {4 \, a^{2} \sqrt {-a + b}}{{\left (\sqrt {-a + b} \cos \left (x\right ) - \sqrt {-a \cos \left (x\right )^{2} + b \cos \left (x\right )^{2} + a}\right )}^{2} - a}\right )} \mathrm {sgn}\left (\sin \left (x\right )\right ) - \frac {{\left (2 \, a \sqrt {-a + b} b^{2} \arctan \left (\frac {\sqrt {-a + b} \sqrt {b}}{\sqrt {a b - b^{2}}}\right ) - 2 \, a b^{\frac {5}{2}} \arctan \left (\frac {\sqrt {-a + b} \sqrt {b}}{\sqrt {a b - b^{2}}}\right ) - 2 \, \sqrt {-a + b} b^{3} \arctan \left (\frac {\sqrt {-a + b} \sqrt {b}}{\sqrt {a b - b^{2}}}\right ) + 2 \, b^{\frac {7}{2}} \arctan \left (\frac {\sqrt {-a + b} \sqrt {b}}{\sqrt {a b - b^{2}}}\right ) + \sqrt {a b - b^{2}} a^{2} \sqrt {-a + b} \log \left (-a - 2 \, \sqrt {-a + b} \sqrt {b} + 2 \, b\right ) - \sqrt {a b - b^{2}} a^{2} \sqrt {b} \log \left (-a - 2 \, \sqrt {-a + b} \sqrt {b} + 2 \, b\right ) - 2 \, \sqrt {a b - b^{2}} a \sqrt {-a + b} b \log \left (-a - 2 \, \sqrt {-a + b} \sqrt {b} + 2 \, b\right ) + 2 \, \sqrt {a b - b^{2}} a b^{\frac {3}{2}} \log \left (-a - 2 \, \sqrt {-a + b} \sqrt {b} + 2 \, b\right ) + \sqrt {a b - b^{2}} \sqrt {-a + b} b^{2} \log \left (-a - 2 \, \sqrt {-a + b} \sqrt {b} + 2 \, b\right ) - \sqrt {a b - b^{2}} b^{\frac {5}{2}} \log \left (-a - 2 \, \sqrt {-a + b} \sqrt {b} + 2 \, b\right ) + 2 \, \sqrt {a b - b^{2}} a^{2} \sqrt {-a + b}\right )} \mathrm {sgn}\left (\sin \left (x\right )\right )}{2 \, {\left (\sqrt {a b - b^{2}} a + \sqrt {a b - b^{2}} \sqrt {-a + b} \sqrt {b} - \sqrt {a b - b^{2}} b\right )}} \] Input:

integrate((a+b*cot(x)^2)^(3/2)*tan(x)^2,x, algorithm="giac")
 

Output:

-1/2*(2*sqrt(-a + b)*b^2*arctan(1/2*((sqrt(-a + b)*cos(x) - sqrt(-a*cos(x) 
^2 + b*cos(x)^2 + a))^2 + a - 2*b)/sqrt(a*b - b^2))/sqrt(a*b - b^2) - (a - 
 b)*sqrt(-a + b)*log((sqrt(-a + b)*cos(x) - sqrt(-a*cos(x)^2 + b*cos(x)^2 
+ a))^2) + 4*a^2*sqrt(-a + b)/((sqrt(-a + b)*cos(x) - sqrt(-a*cos(x)^2 + b 
*cos(x)^2 + a))^2 - a))*sgn(sin(x)) - 1/2*(2*a*sqrt(-a + b)*b^2*arctan(sqr 
t(-a + b)*sqrt(b)/sqrt(a*b - b^2)) - 2*a*b^(5/2)*arctan(sqrt(-a + b)*sqrt( 
b)/sqrt(a*b - b^2)) - 2*sqrt(-a + b)*b^3*arctan(sqrt(-a + b)*sqrt(b)/sqrt( 
a*b - b^2)) + 2*b^(7/2)*arctan(sqrt(-a + b)*sqrt(b)/sqrt(a*b - b^2)) + sqr 
t(a*b - b^2)*a^2*sqrt(-a + b)*log(-a - 2*sqrt(-a + b)*sqrt(b) + 2*b) - sqr 
t(a*b - b^2)*a^2*sqrt(b)*log(-a - 2*sqrt(-a + b)*sqrt(b) + 2*b) - 2*sqrt(a 
*b - b^2)*a*sqrt(-a + b)*b*log(-a - 2*sqrt(-a + b)*sqrt(b) + 2*b) + 2*sqrt 
(a*b - b^2)*a*b^(3/2)*log(-a - 2*sqrt(-a + b)*sqrt(b) + 2*b) + sqrt(a*b - 
b^2)*sqrt(-a + b)*b^2*log(-a - 2*sqrt(-a + b)*sqrt(b) + 2*b) - sqrt(a*b - 
b^2)*b^(5/2)*log(-a - 2*sqrt(-a + b)*sqrt(b) + 2*b) + 2*sqrt(a*b - b^2)*a^ 
2*sqrt(-a + b))*sgn(sin(x))/(sqrt(a*b - b^2)*a + sqrt(a*b - b^2)*sqrt(-a + 
 b)*sqrt(b) - sqrt(a*b - b^2)*b)
 

Mupad [F(-1)]

Timed out. \[ \int \left (a+b \cot ^2(x)\right )^{3/2} \tan ^2(x) \, dx=\int {\mathrm {tan}\left (x\right )}^2\,{\left (b\,{\mathrm {cot}\left (x\right )}^2+a\right )}^{3/2} \,d x \] Input:

int(tan(x)^2*(a + b*cot(x)^2)^(3/2),x)
 

Output:

int(tan(x)^2*(a + b*cot(x)^2)^(3/2), x)
 

Reduce [F]

\[ \int \left (a+b \cot ^2(x)\right )^{3/2} \tan ^2(x) \, dx=\left (\int \sqrt {\cot \left (x \right )^{2} b +a}\, \cot \left (x \right )^{2} \tan \left (x \right )^{2}d x \right ) b +\left (\int \sqrt {\cot \left (x \right )^{2} b +a}\, \tan \left (x \right )^{2}d x \right ) a \] Input:

int((a+b*cot(x)^2)^(3/2)*tan(x)^2,x)
 

Output:

int(sqrt(cot(x)**2*b + a)*cot(x)**2*tan(x)**2,x)*b + int(sqrt(cot(x)**2*b 
+ a)*tan(x)**2,x)*a