3.5.1 \(\int \frac {\tan (x)}{(-1+\sqrt {\tan (x)})^2} \, dx\) [401]

3.5.1.1 Optimal result
3.5.1.2 Mathematica [C] (verified)
3.5.1.3 Rubi [A] (verified)
3.5.1.4 Maple [A] (verified)
3.5.1.5 Fricas [C] (verification not implemented)
3.5.1.6 Sympy [F]
3.5.1.7 Maxima [A] (verification not implemented)
3.5.1.8 Giac [A] (verification not implemented)
3.5.1.9 Mupad [B] (verification not implemented)
3.5.1.10 Reduce [F]

3.5.1.1 Optimal result

Integrand size = 13, antiderivative size = 84 \[ \int \frac {\tan (x)}{\left (-1+\sqrt {\tan (x)}\right )^2} \, dx=-\frac {x}{2}+\frac {\arctan \left (\frac {1-\tan (x)}{\sqrt {2} \sqrt {\tan (x)}}\right )}{\sqrt {2}}+\frac {\text {arctanh}\left (\frac {1+\tan (x)}{\sqrt {2} \sqrt {\tan (x)}}\right )}{\sqrt {2}}+\frac {1}{2} \log (\cos (x))+\log \left (1-\sqrt {\tan (x)}\right )+\frac {1}{1-\sqrt {\tan (x)}} \]

output
-1/2*x+1/2*ln(cos(x))+ln(1-tan(x)^(1/2))+1/2*arctan(1/2*(1-tan(x))*2^(1/2) 
/tan(x)^(1/2))*2^(1/2)+1/2*arctanh(1/2*(1+tan(x))*2^(1/2)/tan(x)^(1/2))*2^ 
(1/2)+1/(1-tan(x)^(1/2))
 
3.5.1.2 Mathematica [C] (verified)

Result contains higher order function than in optimal. Order 5 vs. order 3 in optimal.

Time = 0.32 (sec) , antiderivative size = 62, normalized size of antiderivative = 0.74 \[ \int \frac {\tan (x)}{\left (-1+\sqrt {\tan (x)}\right )^2} \, dx=-\frac {1}{2} \arctan (\tan (x))+\frac {1}{2} \log (\cos (x))+\log \left (1-\sqrt {\tan (x)}\right )+\frac {1}{1-\sqrt {\tan (x)}}-\frac {2}{3} \operatorname {Hypergeometric2F1}\left (\frac {3}{4},1,\frac {7}{4},-\tan ^2(x)\right ) \tan ^{\frac {3}{2}}(x) \]

input
Integrate[Tan[x]/(-1 + Sqrt[Tan[x]])^2,x]
 
output
-1/2*ArcTan[Tan[x]] + Log[Cos[x]]/2 + Log[1 - Sqrt[Tan[x]]] + (1 - Sqrt[Ta 
n[x]])^(-1) - (2*Hypergeometric2F1[3/4, 1, 7/4, -Tan[x]^2]*Tan[x]^(3/2))/3
 
3.5.1.3 Rubi [A] (verified)

Time = 0.60 (sec) , antiderivative size = 154, normalized size of antiderivative = 1.83, number of steps used = 6, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.385, Rules used = {3042, 4153, 7267, 7276, 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 {\tan (x)}{\left (\sqrt {\tan (x)}-1\right )^2} \, dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \int \frac {\tan (x)}{\left (\sqrt {\tan (x)}-1\right )^2}dx\)

\(\Big \downarrow \) 4153

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

\(\Big \downarrow \) 7267

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

\(\Big \downarrow \) 7276

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

\(\Big \downarrow \) 2009

\(\displaystyle 2 \left (\frac {\arctan \left (1-\sqrt {2} \sqrt {\tan (x)}\right )}{2 \sqrt {2}}-\frac {\arctan \left (\sqrt {2} \sqrt {\tan (x)}+1\right )}{2 \sqrt {2}}-\frac {1}{4} \arctan (\tan (x))+\frac {1}{2 \left (1-\sqrt {\tan (x)}\right )}-\frac {1}{8} \log \left (\tan ^2(x)+1\right )+\frac {1}{2} \log \left (1-\sqrt {\tan (x)}\right )-\frac {\log \left (\tan (x)-\sqrt {2} \sqrt {\tan (x)}+1\right )}{4 \sqrt {2}}+\frac {\log \left (\tan (x)+\sqrt {2} \sqrt {\tan (x)}+1\right )}{4 \sqrt {2}}\right )\)

input
Int[Tan[x]/(-1 + Sqrt[Tan[x]])^2,x]
 
output
2*(ArcTan[1 - Sqrt[2]*Sqrt[Tan[x]]]/(2*Sqrt[2]) - ArcTan[1 + Sqrt[2]*Sqrt[ 
Tan[x]]]/(2*Sqrt[2]) - ArcTan[Tan[x]]/4 + Log[1 - Sqrt[Tan[x]]]/2 - Log[1 
- Sqrt[2]*Sqrt[Tan[x]] + Tan[x]]/(4*Sqrt[2]) + Log[1 + Sqrt[2]*Sqrt[Tan[x] 
] + Tan[x]]/(4*Sqrt[2]) - Log[1 + Tan[x]^2]/8 + 1/(2*(1 - Sqrt[Tan[x]])))
 

3.5.1.3.1 Defintions of rubi rules used

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 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]))
 

rule 7267
Int[u_, x_Symbol] :> With[{lst = SubstForFractionalPowerOfLinear[u, x]}, Si 
mp[lst[[2]]*lst[[4]]   Subst[Int[lst[[1]], x], x, lst[[3]]^(1/lst[[2]])], x 
] /;  !FalseQ[lst] && SubstForFractionalPowerQ[u, lst[[3]], x]]
 

rule 7276
Int[(u_)/((a_) + (b_.)*(x_)^(n_)), x_Symbol] :> With[{v = RationalFunctionE 
xpand[u/(a + b*x^n), x]}, Int[v, x] /; SumQ[v]] /; FreeQ[{a, b}, x] && IGtQ 
[n, 0]
 
3.5.1.4 Maple [A] (verified)

Time = 0.08 (sec) , antiderivative size = 94, normalized size of antiderivative = 1.12

method result size
derivativedivides \(-\frac {\arctan \left (\tan \left (x \right )\right )}{2}-\frac {\sqrt {2}\, \left (\ln \left (\frac {1-\sqrt {2}\, \left (\sqrt {\tan }\left (x \right )\right )+\tan \left (x \right )}{1+\sqrt {2}\, \left (\sqrt {\tan }\left (x \right )\right )+\tan \left (x \right )}\right )+2 \arctan \left (1+\sqrt {2}\, \left (\sqrt {\tan }\left (x \right )\right )\right )+2 \arctan \left (-1+\sqrt {2}\, \left (\sqrt {\tan }\left (x \right )\right )\right )\right )}{4}-\frac {\ln \left (1+\tan ^{2}\left (x \right )\right )}{4}-\frac {1}{-1+\sqrt {\tan }\left (x \right )}+\ln \left (-1+\sqrt {\tan }\left (x \right )\right )\) \(94\)
default \(-\frac {\arctan \left (\tan \left (x \right )\right )}{2}-\frac {\sqrt {2}\, \left (\ln \left (\frac {1-\sqrt {2}\, \left (\sqrt {\tan }\left (x \right )\right )+\tan \left (x \right )}{1+\sqrt {2}\, \left (\sqrt {\tan }\left (x \right )\right )+\tan \left (x \right )}\right )+2 \arctan \left (1+\sqrt {2}\, \left (\sqrt {\tan }\left (x \right )\right )\right )+2 \arctan \left (-1+\sqrt {2}\, \left (\sqrt {\tan }\left (x \right )\right )\right )\right )}{4}-\frac {\ln \left (1+\tan ^{2}\left (x \right )\right )}{4}-\frac {1}{-1+\sqrt {\tan }\left (x \right )}+\ln \left (-1+\sqrt {\tan }\left (x \right )\right )\) \(94\)

input
int(tan(x)/(-1+tan(x)^(1/2))^2,x,method=_RETURNVERBOSE)
 
output
-1/2*arctan(tan(x))-1/4*2^(1/2)*(ln((1-2^(1/2)*tan(x)^(1/2)+tan(x))/(1+2^( 
1/2)*tan(x)^(1/2)+tan(x)))+2*arctan(1+2^(1/2)*tan(x)^(1/2))+2*arctan(-1+2^ 
(1/2)*tan(x)^(1/2)))-1/4*ln(1+tan(x)^2)-1/(-1+tan(x)^(1/2))+ln(-1+tan(x)^( 
1/2))
 
3.5.1.5 Fricas [C] (verification not implemented)

Result contains complex when optimal does not.

Time = 0.93 (sec) , antiderivative size = 603, normalized size of antiderivative = 7.18 \[ \int \frac {\tan (x)}{\left (-1+\sqrt {\tan (x)}\right )^2} \, dx=\text {Too large to display} \]

input
integrate(tan(x)/(-1+tan(x)^(1/2))^2,x, algorithm="fricas")
 
output
-1/8*(2*(2*sqrt(-I) - I + 1)*(tan(x) - 1)*log(-1/2*(2*sqrt(-I) - I + 1)^2* 
(4*(-1)^(1/4) + 2*I + 1) - (2*(-1)^(1/4) + I + 1)^3 - ((2*(-1)^(1/4) + I + 
 1)^2 - 8*(-1)^(1/4) - 4*I - 3)*(2*sqrt(-I) - I + 1) + 4*(2*(-1)^(1/4) + I 
 + 1)^2 + 6*sqrt(tan(x)) - 16*(-1)^(1/4) - 8*I - 9) + 2*(2*(-1)^(1/4) + I 
+ 1)*(tan(x) - 1)*log((2*(-1)^(1/4) + I + 1)^3 - 7/2*(2*(-1)^(1/4) + I + 1 
)^2 + 6*sqrt(tan(x)) + 14*(-1)^(1/4) + 7*I + 14) - ((2*sqrt(-I) - I + 1)*( 
tan(x) - 1) + (2*(-1)^(1/4) + I + 1)*(tan(x) - 1) - 4*sqrt(-3/16*(2*sqrt(- 
I) - I + 1)^2 - 3/16*(2*(-1)^(1/4) + I + 1)^2 - 1/8*(2*sqrt(-I) - I + 1)*( 
2*(-1)^(1/4) + I - 3) + (-1)^(1/4) + 1/2*I - 1/2)*(tan(x) - 1) - 4*tan(x) 
+ 4)*log(1/4*(2*sqrt(-I) - I + 1)^2*(4*(-1)^(1/4) + 2*I + 1) + 1/2*((2*(-1 
)^(1/4) + I + 1)^2 - 8*(-1)^(1/4) - 4*I - 3)*(2*sqrt(-I) - I + 1) - 1/4*(2 
*(-1)^(1/4) + I + 1)^2 + sqrt(-3/16*(2*sqrt(-I) - I + 1)^2 - 3/16*(2*(-1)^ 
(1/4) + I + 1)^2 - 1/8*(2*sqrt(-I) - I + 1)*(2*(-1)^(1/4) + I - 3) + (-1)^ 
(1/4) + 1/2*I - 1/2)*((2*sqrt(-I) - I + 1)*(4*(-1)^(1/4) + 2*I + 1) - 2*(- 
1)^(1/4) - I + 1) + 6*sqrt(tan(x)) + (-1)^(1/4) + 1/2*I - 5/2) - ((2*sqrt( 
-I) - I + 1)*(tan(x) - 1) + (2*(-1)^(1/4) + I + 1)*(tan(x) - 1) + 4*sqrt(- 
3/16*(2*sqrt(-I) - I + 1)^2 - 3/16*(2*(-1)^(1/4) + I + 1)^2 - 1/8*(2*sqrt( 
-I) - I + 1)*(2*(-1)^(1/4) + I - 3) + (-1)^(1/4) + 1/2*I - 1/2)*(tan(x) - 
1) - 4*tan(x) + 4)*log(1/4*(2*sqrt(-I) - I + 1)^2*(4*(-1)^(1/4) + 2*I + 1) 
 + 1/2*((2*(-1)^(1/4) + I + 1)^2 - 8*(-1)^(1/4) - 4*I - 3)*(2*sqrt(-I) ...
 
3.5.1.6 Sympy [F]

\[ \int \frac {\tan (x)}{\left (-1+\sqrt {\tan (x)}\right )^2} \, dx=\int \frac {\tan {\left (x \right )}}{\left (\sqrt {\tan {\left (x \right )}} - 1\right )^{2}}\, dx \]

input
integrate(tan(x)/(-1+tan(x)**(1/2))**2,x)
 
output
Integral(tan(x)/(sqrt(tan(x)) - 1)**2, x)
 
3.5.1.7 Maxima [A] (verification not implemented)

Time = 0.28 (sec) , antiderivative size = 117, normalized size of antiderivative = 1.39 \[ \int \frac {\tan (x)}{\left (-1+\sqrt {\tan (x)}\right )^2} \, dx=\frac {1}{4} \, \sqrt {2} {\left (\sqrt {2} - 2\right )} \arctan \left (\frac {1}{2} \, \sqrt {2} {\left (\sqrt {2} + 2 \, \sqrt {\tan \left (x\right )}\right )}\right ) - \frac {1}{4} \, \sqrt {2} {\left (\sqrt {2} + 2\right )} \arctan \left (-\frac {1}{2} \, \sqrt {2} {\left (\sqrt {2} - 2 \, \sqrt {\tan \left (x\right )}\right )}\right ) - \frac {1}{8} \, \sqrt {2} {\left (\sqrt {2} - 2\right )} \log \left (\sqrt {2} \sqrt {\tan \left (x\right )} + \tan \left (x\right ) + 1\right ) - \frac {1}{8} \, \sqrt {2} {\left (\sqrt {2} + 2\right )} \log \left (-\sqrt {2} \sqrt {\tan \left (x\right )} + \tan \left (x\right ) + 1\right ) - \frac {1}{\sqrt {\tan \left (x\right )} - 1} + \log \left (\sqrt {\tan \left (x\right )} - 1\right ) \]

input
integrate(tan(x)/(-1+tan(x)^(1/2))^2,x, algorithm="maxima")
 
output
1/4*sqrt(2)*(sqrt(2) - 2)*arctan(1/2*sqrt(2)*(sqrt(2) + 2*sqrt(tan(x)))) - 
 1/4*sqrt(2)*(sqrt(2) + 2)*arctan(-1/2*sqrt(2)*(sqrt(2) - 2*sqrt(tan(x)))) 
 - 1/8*sqrt(2)*(sqrt(2) - 2)*log(sqrt(2)*sqrt(tan(x)) + tan(x) + 1) - 1/8* 
sqrt(2)*(sqrt(2) + 2)*log(-sqrt(2)*sqrt(tan(x)) + tan(x) + 1) - 1/(sqrt(ta 
n(x)) - 1) + log(sqrt(tan(x)) - 1)
 
3.5.1.8 Giac [A] (verification not implemented)

Time = 0.29 (sec) , antiderivative size = 111, normalized size of antiderivative = 1.32 \[ \int \frac {\tan (x)}{\left (-1+\sqrt {\tan (x)}\right )^2} \, dx=-\frac {1}{2} \, {\left (\sqrt {2} - 1\right )} \arctan \left (\frac {1}{2} \, \sqrt {2} {\left (\sqrt {2} + 2 \, \sqrt {\tan \left (x\right )}\right )}\right ) - \frac {1}{2} \, {\left (\sqrt {2} + 1\right )} \arctan \left (-\frac {1}{2} \, \sqrt {2} {\left (\sqrt {2} - 2 \, \sqrt {\tan \left (x\right )}\right )}\right ) + \frac {1}{4} \, \sqrt {2} \log \left (\sqrt {2} \sqrt {\tan \left (x\right )} + \tan \left (x\right ) + 1\right ) - \frac {1}{4} \, \sqrt {2} \log \left (-\sqrt {2} \sqrt {\tan \left (x\right )} + \tan \left (x\right ) + 1\right ) - \frac {1}{\sqrt {\tan \left (x\right )} - 1} - \frac {1}{4} \, \log \left (\tan \left (x\right )^{2} + 1\right ) + \log \left ({\left | \sqrt {\tan \left (x\right )} - 1 \right |}\right ) \]

input
integrate(tan(x)/(-1+tan(x)^(1/2))^2,x, algorithm="giac")
 
output
-1/2*(sqrt(2) - 1)*arctan(1/2*sqrt(2)*(sqrt(2) + 2*sqrt(tan(x)))) - 1/2*(s 
qrt(2) + 1)*arctan(-1/2*sqrt(2)*(sqrt(2) - 2*sqrt(tan(x)))) + 1/4*sqrt(2)* 
log(sqrt(2)*sqrt(tan(x)) + tan(x) + 1) - 1/4*sqrt(2)*log(-sqrt(2)*sqrt(tan 
(x)) + tan(x) + 1) - 1/(sqrt(tan(x)) - 1) - 1/4*log(tan(x)^2 + 1) + log(ab 
s(sqrt(tan(x)) - 1))
 
3.5.1.9 Mupad [B] (verification not implemented)

Time = 1.28 (sec) , antiderivative size = 228, normalized size of antiderivative = 2.71 \[ \int \frac {\tan (x)}{\left (-1+\sqrt {\tan (x)}\right )^2} \, dx=\ln \left (612\,\sqrt {\mathrm {tan}\left (x\right )}-612\right )-\frac {1}{\sqrt {\mathrm {tan}\left (x\right )}-1}+\left (\sum _{k=1}^4\ln \left (4\,\sqrt {\mathrm {tan}\left (x\right )}+{\mathrm {root}\left (z^4+z^3+\frac {z^2}{2}-\frac {z}{8}+\frac {1}{64},z,k\right )}^2\,\sqrt {\mathrm {tan}\left (x\right )}\,80+{\mathrm {root}\left (z^4+z^3+\frac {z^2}{2}-\frac {z}{8}+\frac {1}{64},z,k\right )}^3\,\sqrt {\mathrm {tan}\left (x\right )}\,448+{\mathrm {root}\left (z^4+z^3+\frac {z^2}{2}-\frac {z}{8}+\frac {1}{64},z,k\right )}^4\,\sqrt {\mathrm {tan}\left (x\right )}\,128+32\,{\mathrm {root}\left (z^4+z^3+\frac {z^2}{2}-\frac {z}{8}+\frac {1}{64},z,k\right )}^2-384\,{\mathrm {root}\left (z^4+z^3+\frac {z^2}{2}-\frac {z}{8}+\frac {1}{64},z,k\right )}^3-256\,{\mathrm {root}\left (z^4+z^3+\frac {z^2}{2}-\frac {z}{8}+\frac {1}{64},z,k\right )}^4-\mathrm {root}\left (z^4+z^3+\frac {z^2}{2}-\frac {z}{8}+\frac {1}{64},z,k\right )\,\sqrt {\mathrm {tan}\left (x\right )}\,48-4\right )\,\mathrm {root}\left (z^4+z^3+\frac {z^2}{2}-\frac {z}{8}+\frac {1}{64},z,k\right )\right ) \]

input
int(tan(x)/(tan(x)^(1/2) - 1)^2,x)
 
output
log(612*tan(x)^(1/2) - 612) - 1/(tan(x)^(1/2) - 1) + symsum(log(4*tan(x)^( 
1/2) + 80*root(z^4 + z^3 + z^2/2 - z/8 + 1/64, z, k)^2*tan(x)^(1/2) + 448* 
root(z^4 + z^3 + z^2/2 - z/8 + 1/64, z, k)^3*tan(x)^(1/2) + 128*root(z^4 + 
 z^3 + z^2/2 - z/8 + 1/64, z, k)^4*tan(x)^(1/2) + 32*root(z^4 + z^3 + z^2/ 
2 - z/8 + 1/64, z, k)^2 - 384*root(z^4 + z^3 + z^2/2 - z/8 + 1/64, z, k)^3 
 - 256*root(z^4 + z^3 + z^2/2 - z/8 + 1/64, z, k)^4 - 48*root(z^4 + z^3 + 
z^2/2 - z/8 + 1/64, z, k)*tan(x)^(1/2) - 4)*root(z^4 + z^3 + z^2/2 - z/8 + 
 1/64, z, k), k, 1, 4)
 
3.5.1.10 Reduce [F]

\[ \int \frac {\tan (x)}{\left (-1+\sqrt {\tan (x)}\right )^2} \, dx=\frac {8 \left (\int \frac {\sqrt {\tan \left (x \right )}\, \tan \left (x \right )}{\tan \left (x \right )^{2}-2 \tan \left (x \right )+1}d x \right ) \tan \left (x \right )-8 \left (\int \frac {\sqrt {\tan \left (x \right )}\, \tan \left (x \right )}{\tan \left (x \right )^{2}-2 \tan \left (x \right )+1}d x \right )-\mathrm {log}\left (\tan \left (x \right )^{2}+1\right ) \tan \left (x \right )+\mathrm {log}\left (\tan \left (x \right )^{2}+1\right )+2 \,\mathrm {log}\left (\tan \left (x \right )-1\right ) \tan \left (x \right )-2 \,\mathrm {log}\left (\tan \left (x \right )-1\right )-2 \tan \left (x \right ) x -4 \tan \left (x \right )+2 x}{4 \tan \left (x \right )-4} \]

input
int(( - tan(x))/(2*sqrt(tan(x)) - tan(x) - 1),x)
 
output
(8*int((sqrt(tan(x))*tan(x))/(tan(x)**2 - 2*tan(x) + 1),x)*tan(x) - 8*int( 
(sqrt(tan(x))*tan(x))/(tan(x)**2 - 2*tan(x) + 1),x) - log(tan(x)**2 + 1)*t 
an(x) + log(tan(x)**2 + 1) + 2*log(tan(x) - 1)*tan(x) - 2*log(tan(x) - 1) 
- 2*tan(x)*x - 4*tan(x) + 2*x)/(4*(tan(x) - 1))