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

Optimal. Leaf size=84 \[ -\frac{x}{2}+\frac{\tan ^{-1}\left (\frac{1-\tan (x)}{\sqrt{2} \sqrt{\tan (x)}}\right )}{\sqrt{2}}+\frac{1}{1-\sqrt{\tan (x)}}+\log \left (1-\sqrt{\tan (x)}\right )+\frac{1}{2} \log (\cos (x))+\frac{\tanh ^{-1}\left (\frac{\tan (x)+1}{\sqrt{2} \sqrt{\tan (x)}}\right )}{\sqrt{2}} \]

[Out]

-x/2 + ArcTan[(1 - Tan[x])/(Sqrt[2]*Sqrt[Tan[x]])]/Sqrt[2] + ArcTanh[(1 + Tan[x]
)/(Sqrt[2]*Sqrt[Tan[x]])]/Sqrt[2] + Log[Cos[x]]/2 + Log[1 - Sqrt[Tan[x]]] + (1 -
 Sqrt[Tan[x]])^(-1)

_______________________________________________________________________________________

Rubi [A]  time = 0.610796, antiderivative size = 133, normalized size of antiderivative = 1.58, number of steps used = 19, number of rules used = 12, integrand size = 13, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.923 \[ -\frac{x}{2}+\frac{\tan ^{-1}\left (1-\sqrt{2} \sqrt{\tan (x)}\right )}{\sqrt{2}}-\frac{\tan ^{-1}\left (\sqrt{2} \sqrt{\tan (x)}+1\right )}{\sqrt{2}}+\frac{1}{1-\sqrt{\tan (x)}}+\log \left (1-\sqrt{\tan (x)}\right )-\frac{\log \left (\tan (x)-\sqrt{2} \sqrt{\tan (x)}+1\right )}{2 \sqrt{2}}+\frac{\log \left (\tan (x)+\sqrt{2} \sqrt{\tan (x)}+1\right )}{2 \sqrt{2}}+\frac{1}{2} \log (\cos (x)) \]

Antiderivative was successfully verified.

[In]  Int[Tan[x]/(-1 + Sqrt[Tan[x]])^2,x]

[Out]

-x/2 + ArcTan[1 - Sqrt[2]*Sqrt[Tan[x]]]/Sqrt[2] - ArcTan[1 + Sqrt[2]*Sqrt[Tan[x]
]]/Sqrt[2] + Log[Cos[x]]/2 + Log[1 - Sqrt[Tan[x]]] - Log[1 - Sqrt[2]*Sqrt[Tan[x]
] + Tan[x]]/(2*Sqrt[2]) + Log[1 + Sqrt[2]*Sqrt[Tan[x]] + Tan[x]]/(2*Sqrt[2]) + (
1 - Sqrt[Tan[x]])^(-1)

_______________________________________________________________________________________

Rubi in Sympy [A]  time = 25.6114, size = 148, normalized size = 1.76 \[ \left (\frac{1}{2} - \frac{i}{2}\right ) \log{\left (- \sqrt{\tan{\left (x \right )}} + 1 \right )} + \left (\frac{1}{2} + \frac{i}{2}\right ) \log{\left (- \sqrt{\tan{\left (x \right )}} + 1 \right )} - \left (\frac{1}{4} - \frac{i}{4}\right ) \log{\left (- \tan{\left (x \right )} + i \right )} - \left (\frac{1}{4} + \frac{i}{4}\right ) \log{\left (\tan{\left (x \right )} + i \right )} + \frac{\sqrt{2} \left (1 - i\right ) \operatorname{atan}{\left (\frac{\sqrt{2} \left (-1 + i\right ) \sqrt{\tan{\left (x \right )}}}{2} \right )}}{2} - \frac{\sqrt{2} \left (1 - i\right ) \operatorname{atanh}{\left (\frac{\sqrt{2} \left (-1 + i\right ) \sqrt{\tan{\left (x \right )}}}{2} \right )}}{2} + \frac{\frac{1}{2} - \frac{i}{2}}{- \sqrt{\tan{\left (x \right )}} + 1} + \frac{\frac{1}{2} + \frac{i}{2}}{- \sqrt{\tan{\left (x \right )}} + 1} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  rubi_integrate(tan(x)/(-1+tan(x)**(1/2))**2,x)

[Out]

(1/2 - I/2)*log(-sqrt(tan(x)) + 1) + (1/2 + I/2)*log(-sqrt(tan(x)) + 1) - (1/4 -
 I/4)*log(-tan(x) + I) - (1/4 + I/4)*log(tan(x) + I) + sqrt(2)*(1 - I)*atan(sqrt
(2)*(-1 + I)*sqrt(tan(x))/2)/2 - sqrt(2)*(1 - I)*atanh(sqrt(2)*(-1 + I)*sqrt(tan
(x))/2)/2 + (1/2 - I/2)/(-sqrt(tan(x)) + 1) + (1/2 + I/2)/(-sqrt(tan(x)) + 1)

_______________________________________________________________________________________

Mathematica [A]  time = 0.795419, size = 155, normalized size = 1.85 \[ \frac{1}{2} \left (-x+\sqrt{2} \left (\tan ^{-1}\left (1-\sqrt{2} \sqrt{\tan (x)}\right )-\tan ^{-1}\left (\sqrt{2} \sqrt{\tan (x)}+1\right )\right )+\log \left (1-\sqrt{\tan (x)}\right )-\log \left (\sqrt{\tan (x)}+1\right )+\frac{\log \left (\tan (x)+\sqrt{2} \sqrt{\tan (x)}+1\right )-\log \left (-\tan (x)+\sqrt{2} \sqrt{\tan (x)}-1\right )}{\sqrt{2}}+\frac{2 \sin (x)}{\cos (x)-\sin (x)}+\log (\cos (x)-\sin (x))+\frac{2 \cos (x) \sqrt{\tan (x)}}{\cos (x)-\sin (x)}\right ) \]

Antiderivative was successfully verified.

[In]  Integrate[Tan[x]/(-1 + Sqrt[Tan[x]])^2,x]

[Out]

(-x + Sqrt[2]*(ArcTan[1 - Sqrt[2]*Sqrt[Tan[x]]] - ArcTan[1 + Sqrt[2]*Sqrt[Tan[x]
]]) + Log[Cos[x] - Sin[x]] + Log[1 - Sqrt[Tan[x]]] - Log[1 + Sqrt[Tan[x]]] + (-L
og[-1 + Sqrt[2]*Sqrt[Tan[x]] - Tan[x]] + Log[1 + Sqrt[2]*Sqrt[Tan[x]] + Tan[x]])
/Sqrt[2] + (2*Sin[x])/(Cos[x] - Sin[x]) + (2*Cos[x]*Sqrt[Tan[x]])/(Cos[x] - Sin[
x]))/2

_______________________________________________________________________________________

Maple [A]  time = 0.028, size = 97, normalized size = 1.2 \[ -{\frac{\sqrt{2}}{2}\arctan \left ( 1+\sqrt{2}\sqrt{\tan \left ( x \right ) } \right ) }-{\frac{\sqrt{2}}{2}\arctan \left ( \sqrt{2}\sqrt{\tan \left ( x \right ) }-1 \right ) }-{\frac{\sqrt{2}}{4}\ln \left ({1 \left ( 1-\sqrt{2}\sqrt{\tan \left ( x \right ) }+\tan \left ( x \right ) \right ) \left ( 1+\sqrt{2}\sqrt{\tan \left ( x \right ) }+\tan \left ( x \right ) \right ) ^{-1}} \right ) }-{\frac{\ln \left ( 1+ \left ( \tan \left ( x \right ) \right ) ^{2} \right ) }{4}}- \left ( -1+\sqrt{\tan \left ( x \right ) } \right ) ^{-1}+\ln \left ( -1+\sqrt{\tan \left ( x \right ) } \right ) -{\frac{x}{2}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  int(tan(x)/(-1+tan(x)^(1/2))^2,x)

[Out]

-1/2*arctan(1+2^(1/2)*tan(x)^(1/2))*2^(1/2)-1/2*arctan(2^(1/2)*tan(x)^(1/2)-1)*2
^(1/2)-1/4*2^(1/2)*ln((1-2^(1/2)*tan(x)^(1/2)+tan(x))/(1+2^(1/2)*tan(x)^(1/2)+ta
n(x)))-1/4*ln(1+tan(x)^2)-1/(-1+tan(x)^(1/2))+ln(-1+tan(x)^(1/2))-1/2*x

_______________________________________________________________________________________

Maxima [A]  time = 1.53385, size = 158, normalized size = 1.88 \[ \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 ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate(tan(x)/(sqrt(tan(x)) - 1)^2,x, algorithm="maxima")

[Out]

1/4*sqrt(2)*(sqrt(2) - 2)*arctan(1/2*sqrt(2)*(sqrt(2) + 2*sqrt(tan(x)))) - 1/4*s
qrt(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(tan(x)) - 1) + log(sqrt(ta
n(x)) - 1)

_______________________________________________________________________________________

Fricas [F(-2)]  time = 0., size = 0, normalized size = 0. \[ \text{Exception raised: NotImplementedError} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate(tan(x)/(sqrt(tan(x)) - 1)^2,x, algorithm="fricas")

[Out]

Exception raised: NotImplementedError

_______________________________________________________________________________________

Sympy [F]  time = 0., size = 0, normalized size = 0. \[ \int \frac{\tan{\left (x \right )}}{\left (\sqrt{\tan{\left (x \right )}} - 1\right )^{2}}\, dx \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate(tan(x)/(-1+tan(x)**(1/2))**2,x)

[Out]

Integral(tan(x)/(sqrt(tan(x)) - 1)**2, x)

_______________________________________________________________________________________

GIAC/XCAS [A]  time = 0.219621, size = 150, normalized size = 1.79 \[ -\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}{\rm ln}\left (\sqrt{2} \sqrt{\tan \left (x\right )} + \tan \left (x\right ) + 1\right ) - \frac{1}{4} \, \sqrt{2}{\rm ln}\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} \,{\rm ln}\left (\tan \left (x\right )^{2} + 1\right ) +{\rm ln}\left ({\left | \sqrt{\tan \left (x\right )} - 1 \right |}\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate(tan(x)/(sqrt(tan(x)) - 1)^2,x, algorithm="giac")

[Out]

-1/2*(sqrt(2) - 1)*arctan(1/2*sqrt(2)*(sqrt(2) + 2*sqrt(tan(x)))) - 1/2*(sqrt(2)
 + 1)*arctan(-1/2*sqrt(2)*(sqrt(2) - 2*sqrt(tan(x)))) + 1/4*sqrt(2)*ln(sqrt(2)*s
qrt(tan(x)) + tan(x) + 1) - 1/4*sqrt(2)*ln(-sqrt(2)*sqrt(tan(x)) + tan(x) + 1) -
 1/(sqrt(tan(x)) - 1) - 1/4*ln(tan(x)^2 + 1) + ln(abs(sqrt(tan(x)) - 1))