3.5.56 \(\int \sqrt {\tan (x) \tan (2 x)} \, dx\) [456]

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

[Out]

-arctanh(tan(x)/(tan(x)*tan(2*x))^(1/2))

________________________________________________________________________________________

Rubi [A]
time = 0.01, antiderivative size = 18, normalized size of antiderivative = 1.06, number of steps used = 3, number of rules used = 3, integrand size = 11, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.273, Rules used = {4482, 3859, 213} \begin {gather*} -\tanh ^{-1}\left (\frac {\tan (2 x)}{\sqrt {\sec (2 x)-1}}\right ) \end {gather*}

Antiderivative was successfully verified.

[In]

Int[Sqrt[Tan[x]*Tan[2*x]],x]

[Out]

-ArcTanh[Tan[2*x]/Sqrt[-1 + Sec[2*x]]]

Rule 213

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

Rule 3859

Int[Sqrt[csc[(c_.) + (d_.)*(x_)]*(b_.) + (a_)], x_Symbol] :> Dist[-2*(b/d), Subst[Int[1/(a + x^2), x], x, b*(C
ot[c + d*x]/Sqrt[a + b*Csc[c + d*x]])], x] /; FreeQ[{a, b, c, d}, x] && EqQ[a^2 - b^2, 0]

Rule 4482

Int[u_, x_Symbol] :> Int[TrigSimplify[u], x] /; TrigSimplifyQ[u]

Rubi steps

\begin {align*} \int \sqrt {\tan (x) \tan (2 x)} \, dx &=\int \sqrt {-1+\sec (2 x)} \, dx\\ &=-\text {Subst}\left (\int \frac {1}{-1+x^2} \, dx,x,-\frac {\tan (2 x)}{\sqrt {-1+\sec (2 x)}}\right )\\ &=-\tanh ^{-1}\left (\frac {\tan (2 x)}{\sqrt {-1+\sec (2 x)}}\right )\\ \end {align*}

________________________________________________________________________________________

Mathematica [B] Leaf count is larger than twice the leaf count of optimal. \(45\) vs. \(2(17)=34\).
time = 0.05, size = 45, normalized size = 2.65 \begin {gather*} -\frac {\tanh ^{-1}\left (\frac {\sqrt {2} \cos (x)}{\sqrt {\cos (2 x)}}\right ) \sqrt {\cos (2 x)} \csc (x) \sqrt {\tan (x) \tan (2 x)}}{\sqrt {2}} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[Sqrt[Tan[x]*Tan[2*x]],x]

[Out]

-((ArcTanh[(Sqrt[2]*Cos[x])/Sqrt[Cos[2*x]]]*Sqrt[Cos[2*x]]*Csc[x]*Sqrt[Tan[x]*Tan[2*x]])/Sqrt[2])

________________________________________________________________________________________

Maple [B] Leaf count of result is larger than twice the leaf count of optimal. \(87\) vs. \(2(15)=30\).
time = 0.28, size = 88, normalized size = 5.18

method result size
default \(-\frac {\sqrt {4}\, \sqrt {\frac {1-\left (\cos ^{2}\left (x \right )\right )}{2 \left (\cos ^{2}\left (x \right )\right )-1}}\, \sin \left (x \right ) \sqrt {\frac {2 \left (\cos ^{2}\left (x \right )\right )-1}{\left (1+\cos \left (x \right )\right )^{2}}}\, \arctanh \left (\frac {\sqrt {2}\, \cos \left (x \right ) \sqrt {4}\, \left (\cos \left (x \right )-1\right )}{2 \sqrt {\frac {2 \left (\cos ^{2}\left (x \right )\right )-1}{\left (1+\cos \left (x \right )\right )^{2}}}\, \sin \left (x \right )^{2}}\right )}{2 \left (\cos \left (x \right )-1\right )}\) \(88\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((tan(x)*tan(2*x))^(1/2),x,method=_RETURNVERBOSE)

[Out]

-1/2*4^(1/2)*((1-cos(x)^2)/(2*cos(x)^2-1))^(1/2)*sin(x)*((2*cos(x)^2-1)/(1+cos(x))^2)^(1/2)*arctanh(1/2*2^(1/2
)*cos(x)*4^(1/2)*(cos(x)-1)/((2*cos(x)^2-1)/(1+cos(x))^2)^(1/2)/sin(x)^2)/(cos(x)-1)

________________________________________________________________________________________

Maxima [B] Leaf count of result is larger than twice the leaf count of optimal. 259 vs. \(2 (15) = 30\).
time = 2.23, size = 259, normalized size = 15.24 \begin {gather*} \frac {1}{4} \, \log \left (4 \, \sqrt {\cos \left (4 \, x\right )^{2} + \sin \left (4 \, x\right )^{2} + 2 \, \cos \left (4 \, x\right ) + 1} \cos \left (\frac {1}{2} \, \arctan \left (\sin \left (4 \, x\right ), \cos \left (4 \, x\right ) + 1\right )\right )^{2} + 4 \, \sqrt {\cos \left (4 \, x\right )^{2} + \sin \left (4 \, x\right )^{2} + 2 \, \cos \left (4 \, x\right ) + 1} \sin \left (\frac {1}{2} \, \arctan \left (\sin \left (4 \, x\right ), \cos \left (4 \, x\right ) + 1\right )\right )^{2} + 8 \, {\left (\cos \left (4 \, x\right )^{2} + \sin \left (4 \, x\right )^{2} + 2 \, \cos \left (4 \, x\right ) + 1\right )}^{\frac {1}{4}} \cos \left (\frac {1}{2} \, \arctan \left (\sin \left (4 \, x\right ), \cos \left (4 \, x\right ) + 1\right )\right ) + 4\right ) - \frac {1}{4} \, \log \left (\cos \left (2 \, x\right )^{2} + \sin \left (2 \, x\right )^{2} + \sqrt {\cos \left (4 \, x\right )^{2} + \sin \left (4 \, x\right )^{2} + 2 \, \cos \left (4 \, x\right ) + 1} {\left (\cos \left (\frac {1}{2} \, \arctan \left (\sin \left (4 \, x\right ), \cos \left (4 \, x\right ) + 1\right )\right )^{2} + \sin \left (\frac {1}{2} \, \arctan \left (\sin \left (4 \, x\right ), \cos \left (4 \, x\right ) + 1\right )\right )^{2}\right )} + 2 \, {\left (\cos \left (4 \, x\right )^{2} + \sin \left (4 \, x\right )^{2} + 2 \, \cos \left (4 \, x\right ) + 1\right )}^{\frac {1}{4}} {\left (\cos \left (2 \, x\right ) \cos \left (\frac {1}{2} \, \arctan \left (\sin \left (4 \, x\right ), \cos \left (4 \, x\right ) + 1\right )\right ) + \sin \left (2 \, x\right ) \sin \left (\frac {1}{2} \, \arctan \left (\sin \left (4 \, x\right ), \cos \left (4 \, x\right ) + 1\right )\right )\right )}\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((tan(x)*tan(2*x))^(1/2),x, algorithm="maxima")

[Out]

1/4*log(4*sqrt(cos(4*x)^2 + sin(4*x)^2 + 2*cos(4*x) + 1)*cos(1/2*arctan2(sin(4*x), cos(4*x) + 1))^2 + 4*sqrt(c
os(4*x)^2 + sin(4*x)^2 + 2*cos(4*x) + 1)*sin(1/2*arctan2(sin(4*x), cos(4*x) + 1))^2 + 8*(cos(4*x)^2 + sin(4*x)
^2 + 2*cos(4*x) + 1)^(1/4)*cos(1/2*arctan2(sin(4*x), cos(4*x) + 1)) + 4) - 1/4*log(cos(2*x)^2 + sin(2*x)^2 + s
qrt(cos(4*x)^2 + sin(4*x)^2 + 2*cos(4*x) + 1)*(cos(1/2*arctan2(sin(4*x), cos(4*x) + 1))^2 + sin(1/2*arctan2(si
n(4*x), cos(4*x) + 1))^2) + 2*(cos(4*x)^2 + sin(4*x)^2 + 2*cos(4*x) + 1)^(1/4)*(cos(2*x)*cos(1/2*arctan2(sin(4
*x), cos(4*x) + 1)) + sin(2*x)*sin(1/2*arctan2(sin(4*x), cos(4*x) + 1))))

________________________________________________________________________________________

Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 50 vs. \(2 (15) = 30\).
time = 1.36, size = 50, normalized size = 2.94 \begin {gather*} \frac {1}{2} \, \log \left (-\frac {\tan \left (x\right )^{3} - 2 \, \sqrt {2} {\left (\tan \left (x\right )^{2} - 1\right )} \sqrt {-\frac {\tan \left (x\right )^{2}}{\tan \left (x\right )^{2} - 1}} - 3 \, \tan \left (x\right )}{\tan \left (x\right )^{3} + \tan \left (x\right )}\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((tan(x)*tan(2*x))^(1/2),x, algorithm="fricas")

[Out]

1/2*log(-(tan(x)^3 - 2*sqrt(2)*(tan(x)^2 - 1)*sqrt(-tan(x)^2/(tan(x)^2 - 1)) - 3*tan(x))/(tan(x)^3 + tan(x)))

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \sqrt {\tan {\left (x \right )} \tan {\left (2 x \right )}}\, dx \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((tan(x)*tan(2*x))**(1/2),x)

[Out]

Integral(sqrt(tan(x)*tan(2*x)), x)

________________________________________________________________________________________

Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 85 vs. \(2 (15) = 30\).
time = 1.25, size = 85, normalized size = 5.00 \begin {gather*} \frac {1}{4} \, \sqrt {2} {\left ({\left (\sqrt {2} \log \left (\sqrt {2} + \sqrt {-\tan \left (x\right )^{2} + 1}\right ) - \sqrt {2} \log \left (\sqrt {2} - \sqrt {-\tan \left (x\right )^{2} + 1}\right )\right )} \mathrm {sgn}\left (\tan \left (x\right )^{2} - 1\right ) \mathrm {sgn}\left (\tan \left (x\right )\right ) + {\left (\sqrt {2} \log \left (\sqrt {2} + 1\right ) - \sqrt {2} \log \left (\sqrt {2} - 1\right )\right )} \mathrm {sgn}\left (\tan \left (x\right )\right )\right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((tan(x)*tan(2*x))^(1/2),x, algorithm="giac")

[Out]

1/4*sqrt(2)*((sqrt(2)*log(sqrt(2) + sqrt(-tan(x)^2 + 1)) - sqrt(2)*log(sqrt(2) - sqrt(-tan(x)^2 + 1)))*sgn(tan
(x)^2 - 1)*sgn(tan(x)) + (sqrt(2)*log(sqrt(2) + 1) - sqrt(2)*log(sqrt(2) - 1))*sgn(tan(x)))

________________________________________________________________________________________

Mupad [F]
time = 0.00, size = -1, normalized size = -0.06 \begin {gather*} \int \sqrt {\mathrm {tan}\left (2\,x\right )\,\mathrm {tan}\left (x\right )} \,d x \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((tan(2*x)*tan(x))^(1/2),x)

[Out]

int((tan(2*x)*tan(x))^(1/2), x)

________________________________________________________________________________________