3.1.8 \(\int \sqrt {2+2 \tan (x)+\tan ^2(x)} \, dx\) [8]

Optimal. Leaf size=137 \[ \sinh ^{-1}(1+\tan (x))-\sqrt {\frac {1}{2} \left (1+\sqrt {5}\right )} \tan ^{-1}\left (\frac {2 \sqrt {5}-\left (5+\sqrt {5}\right ) \tan (x)}{\sqrt {10 \left (1+\sqrt {5}\right )} \sqrt {2+2 \tan (x)+\tan ^2(x)}}\right )-\sqrt {\frac {1}{2} \left (-1+\sqrt {5}\right )} \tanh ^{-1}\left (\frac {2 \sqrt {5}+\left (5-\sqrt {5}\right ) \tan (x)}{\sqrt {10 \left (-1+\sqrt {5}\right )} \sqrt {2+2 \tan (x)+\tan ^2(x)}}\right ) \]

[Out]

arcsinh(1+tan(x))-1/2*arctanh((2*5^(1/2)+(5-5^(1/2))*tan(x))/(-10+10*5^(1/2))^(1/2)/(2+2*tan(x)+tan(x)^2)^(1/2
))*(-2+2*5^(1/2))^(1/2)-1/2*arctan((2*5^(1/2)-(5+5^(1/2))*tan(x))/(10+10*5^(1/2))^(1/2)/(2+2*tan(x)+tan(x)^2)^
(1/2))*(2+2*5^(1/2))^(1/2)

________________________________________________________________________________________

Rubi [A]
time = 0.13, antiderivative size = 137, normalized size of antiderivative = 1.00, number of steps used = 9, number of rules used = 7, integrand size = 14, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.500, Rules used = {1004, 633, 221, 1050, 1044, 213, 209} \begin {gather*} -\sqrt {\frac {1}{2} \left (1+\sqrt {5}\right )} \tan ^{-1}\left (\frac {2 \sqrt {5}-\left (5+\sqrt {5}\right ) \tan (x)}{\sqrt {10 \left (1+\sqrt {5}\right )} \sqrt {\tan ^2(x)+2 \tan (x)+2}}\right )-\sqrt {\frac {1}{2} \left (\sqrt {5}-1\right )} \tanh ^{-1}\left (\frac {\left (5-\sqrt {5}\right ) \tan (x)+2 \sqrt {5}}{\sqrt {10 \left (\sqrt {5}-1\right )} \sqrt {\tan ^2(x)+2 \tan (x)+2}}\right )+\sinh ^{-1}(\tan (x)+1) \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

ArcSinh[1 + Tan[x]] - Sqrt[(1 + Sqrt[5])/2]*ArcTan[(2*Sqrt[5] - (5 + Sqrt[5])*Tan[x])/(Sqrt[10*(1 + Sqrt[5])]*
Sqrt[2 + 2*Tan[x] + Tan[x]^2])] - Sqrt[(-1 + Sqrt[5])/2]*ArcTanh[(2*Sqrt[5] + (5 - Sqrt[5])*Tan[x])/(Sqrt[10*(
-1 + Sqrt[5])]*Sqrt[2 + 2*Tan[x] + Tan[x]^2])]

Rule 209

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

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 221

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

Rule 633

Int[((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(p_), x_Symbol] :> Dist[1/(2*c*(-4*(c/(b^2 - 4*a*c)))^p), Subst[Int[Si
mp[1 - x^2/(b^2 - 4*a*c), x]^p, x], x, b + 2*c*x], x] /; FreeQ[{a, b, c, p}, x] && GtQ[4*a - b^2/c, 0]

Rule 1004

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

Rule 1044

Int[((g_) + (h_.)*(x_))/(((a_) + (c_.)*(x_)^2)*Sqrt[(d_.) + (e_.)*(x_) + (f_.)*(x_)^2]), x_Symbol] :> Dist[-2*
a*g*h, Subst[Int[1/Simp[2*a^2*g*h*c + a*e*x^2, x], x], x, Simp[a*h - g*c*x, x]/Sqrt[d + e*x + f*x^2]], x] /; F
reeQ[{a, c, d, e, f, g, h}, x] && EqQ[a*h^2*e + 2*g*h*(c*d - a*f) - g^2*c*e, 0]

Rule 1050

Int[((g_.) + (h_.)*(x_))/(((a_) + (c_.)*(x_)^2)*Sqrt[(d_.) + (e_.)*(x_) + (f_.)*(x_)^2]), x_Symbol] :> With[{q
 = Rt[(c*d - a*f)^2 + a*c*e^2, 2]}, Dist[1/(2*q), Int[Simp[(-a)*h*e - g*(c*d - a*f - q) + (h*(c*d - a*f + q) -
 g*c*e)*x, x]/((a + c*x^2)*Sqrt[d + e*x + f*x^2]), x], x] - Dist[1/(2*q), Int[Simp[(-a)*h*e - g*(c*d - a*f + q
) + (h*(c*d - a*f - q) - g*c*e)*x, x]/((a + c*x^2)*Sqrt[d + e*x + f*x^2]), x], x]] /; FreeQ[{a, c, d, e, f, g,
 h}, x] && NeQ[e^2 - 4*d*f, 0] && NegQ[(-a)*c]

Rubi steps

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

________________________________________________________________________________________

Mathematica [C] Result contains higher order function than in optimal. Order 9 vs. order 3 in optimal.
time = 2.60, size = 340, normalized size = 2.48 \begin {gather*} \frac {\cos (x) \left (2 \sqrt {2} \tanh ^{-1}\left (\frac {2 \sqrt {2} \tan \left (\frac {x}{2}\right )}{2+\sqrt {\sec ^4\left (\frac {x}{2}\right ) (3+\cos (2 x)+2 \sin (2 x))}-2 \tan ^2\left (\frac {x}{2}\right )}\right )+\text {RootSum}\left [20+32 \text {$\#$1}+12 \text {$\#$1}^2+\text {$\#$1}^4\&,\frac {6 \log \left (\tan \left (\frac {x}{2}\right )\right )-6 \log \left (\frac {1}{2} \left (2+\sqrt {\sec ^4\left (\frac {x}{2}\right ) (3+\cos (2 x)+2 \sin (2 x))}-2 \text {$\#$1} \tan \left (\frac {x}{2}\right )-2 \tan ^2\left (\frac {x}{2}\right )\right )\right )+8 \log \left (\tan \left (\frac {x}{2}\right )\right ) \text {$\#$1}-8 \log \left (\frac {1}{2} \left (2+\sqrt {\sec ^4\left (\frac {x}{2}\right ) (3+\cos (2 x)+2 \sin (2 x))}-2 \text {$\#$1} \tan \left (\frac {x}{2}\right )-2 \tan ^2\left (\frac {x}{2}\right )\right )\right ) \text {$\#$1}+\log \left (\tan \left (\frac {x}{2}\right )\right ) \text {$\#$1}^2-\log \left (\frac {1}{2} \left (2+\sqrt {\sec ^4\left (\frac {x}{2}\right ) (3+\cos (2 x)+2 \sin (2 x))}-2 \text {$\#$1} \tan \left (\frac {x}{2}\right )-2 \tan ^2\left (\frac {x}{2}\right )\right )\right ) \text {$\#$1}^2}{8+6 \text {$\#$1}+\text {$\#$1}^3}\&\right ]\right ) \sqrt {2+2 \tan (x)+\tan ^2(x)}}{(1+\cos (x)) \sqrt {\frac {3+\cos (2 x)+2 \sin (2 x)}{(1+\cos (x))^2}}} \end {gather*}

Warning: Unable to verify antiderivative.

[In]

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

[Out]

(Cos[x]*(2*Sqrt[2]*ArcTanh[(2*Sqrt[2]*Tan[x/2])/(2 + Sqrt[Sec[x/2]^4*(3 + Cos[2*x] + 2*Sin[2*x])] - 2*Tan[x/2]
^2)] + RootSum[20 + 32*#1 + 12*#1^2 + #1^4 & , (6*Log[Tan[x/2]] - 6*Log[(2 + Sqrt[Sec[x/2]^4*(3 + Cos[2*x] + 2
*Sin[2*x])] - 2*#1*Tan[x/2] - 2*Tan[x/2]^2)/2] + 8*Log[Tan[x/2]]*#1 - 8*Log[(2 + Sqrt[Sec[x/2]^4*(3 + Cos[2*x]
 + 2*Sin[2*x])] - 2*#1*Tan[x/2] - 2*Tan[x/2]^2)/2]*#1 + Log[Tan[x/2]]*#1^2 - Log[(2 + Sqrt[Sec[x/2]^4*(3 + Cos
[2*x] + 2*Sin[2*x])] - 2*#1*Tan[x/2] - 2*Tan[x/2]^2)/2]*#1^2)/(8 + 6*#1 + #1^3) & ])*Sqrt[2 + 2*Tan[x] + Tan[x
]^2])/((1 + Cos[x])*Sqrt[(3 + Cos[2*x] + 2*Sin[2*x])/(1 + Cos[x])^2])

________________________________________________________________________________________

Mathics [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {cought exception: maximum recursion depth exceeded while calling a Python object} \end {gather*}

Warning: Unable to verify antiderivative.

[In]

mathics('Integrate[Sqrt[Tan[x]^2 + 2*Tan[x] + 2],x]')

[Out]

cought exception: maximum recursion depth exceeded while calling a Python object

________________________________________________________________________________________

Maple [B] Leaf count of result is larger than twice the leaf count of optimal. \(1603\) vs. \(2(105)=210\).
time = 0.46, size = 1604, normalized size = 11.71

method result size
derivativedivides \(\text {Expression too large to display}\) \(1604\)
default \(\text {Expression too large to display}\) \(1604\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

arcsinh(tan(x)+1)-1/10*(10*(-1/2*5^(1/2)+1/2+tan(x))^2/(-1/2*5^(1/2)-1/2-tan(x))^2-2*5^(1/2)*(-1/2*5^(1/2)+1/2
+tan(x))^2/(-1/2*5^(1/2)-1/2-tan(x))^2+10+2*5^(1/2))^(1/2)*5^(1/2)*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5^(1/2)+1/2+tan(x))/(-1/2*5^(1/2)-1/2-tan(x))+1)^2)^(1/2)/((-1/2*5^(1/2)+1/2+tan(x))/(-1/2*5^(1/2)-1/2-tan(x))
+1)/(5^(1/2)-5)/(-10+10*5^(1/2))^(1/2)

________________________________________________________________________________________

Maxima [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: RuntimeError} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

Exception raised: RuntimeError >> ECL says: Error executing code in Maxima: sign: argument cannot be imaginary
; found %i

________________________________________________________________________________________

Fricas [F(-1)] Timed out
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Timed out} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

Timed out

________________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 495 vs. \(2 (104) = 208\).
time = 0.05, size = 975, normalized size = 7.12 \begin {gather*} 2 \left (\frac {1}{8} \sqrt {2 \left (\sqrt {5}-1\right )} \ln \left (\left (16 \left (\sqrt {\tan ^{2}x+2 \tan x+2}-\tan x\right ) \sqrt {5}-32 \left (\sqrt {\tan ^{2}x+2 \tan x+2}-\tan x\right )-16 \sqrt {5} \sqrt {\sqrt {5}-2}-16 \sqrt {5}+32 \sqrt {\sqrt {5}-2}+32\right ) \left (16 \left (\sqrt {\tan ^{2}x+2 \tan x+2}-\tan x\right ) \sqrt {5}-32 \left (\sqrt {\tan ^{2}x+2 \tan x+2}-\tan x\right )-16 \sqrt {5} \sqrt {\sqrt {5}-2}-16 \sqrt {5}+32 \sqrt {\sqrt {5}-2}+32\right )+\left (16 \left (\sqrt {\tan ^{2}x+2 \tan x+2}-\tan x\right ) \sqrt {5}-32 \left (\sqrt {\tan ^{2}x+2 \tan x+2}-\tan x\right )+16 \sqrt {5}-16 \sqrt {\sqrt {5}-2}-32\right ) \left (16 \left (\sqrt {\tan ^{2}x+2 \tan x+2}-\tan x\right ) \sqrt {5}-32 \left (\sqrt {\tan ^{2}x+2 \tan x+2}-\tan x\right )+16 \sqrt {5}-16 \sqrt {\sqrt {5}-2}-32\right )\right )+\frac {32 \sqrt {2 \left (\sqrt {5}-1\right )} \left (\frac {\pi }{4}+\arctan \left (\frac {60368053528205721600+35013471046359318528 \sqrt {5} \sqrt {\sqrt {5}-2}+11671157015453106176 \sqrt {5}+81698099108171743232 \sqrt {\sqrt {5}-2}-25354582481846403072+\left (-32196295215043051520-23342314030906212352 \sqrt {5} \sqrt {\sqrt {5}-2}-11671157015453106176 \sqrt {5}-46684628061812424704 \sqrt {\sqrt {5}-2}-2817175831316267008\right ) \left (\sqrt {\tan ^{2}x+2 \tan x+2}-\tan x\right )}{23342314030906212352}\right )\right )}{4 \left (16 \sqrt {5}-16\right )}-\frac {1}{8} \sqrt {2 \left (\sqrt {5}-1\right )} \ln \left (\left (16 \left (\sqrt {\tan ^{2}x+2 \tan x+2}-\tan x\right ) \sqrt {5}-32 \left (\sqrt {\tan ^{2}x+2 \tan x+2}-\tan x\right )+16 \sqrt {5} \sqrt {\sqrt {5}-2}-16 \sqrt {5}-32 \sqrt {\sqrt {5}-2}+32\right ) \left (16 \left (\sqrt {\tan ^{2}x+2 \tan x+2}-\tan x\right ) \sqrt {5}-32 \left (\sqrt {\tan ^{2}x+2 \tan x+2}-\tan x\right )+16 \sqrt {5} \sqrt {\sqrt {5}-2}-16 \sqrt {5}-32 \sqrt {\sqrt {5}-2}+32\right )+\left (16 \left (\sqrt {\tan ^{2}x+2 \tan x+2}-\tan x\right ) \sqrt {5}-32 \left (\sqrt {\tan ^{2}x+2 \tan x+2}-\tan x\right )+16 \sqrt {5}+16 \sqrt {\sqrt {5}-2}-32\right ) \left (16 \left (\sqrt {\tan ^{2}x+2 \tan x+2}-\tan x\right ) \sqrt {5}-32 \left (\sqrt {\tan ^{2}x+2 \tan x+2}-\tan x\right )+16 \sqrt {5}+16 \sqrt {\sqrt {5}-2}-32\right )\right )-\frac {32 \sqrt {2 \left (\sqrt {5}-1\right )} \left (\frac {\pi }{4}+\arctan \left (\frac {-76466201135727247360-35013471046359318528 \sqrt {5} \sqrt {\sqrt {5}-2}+11671157015453106176 \sqrt {5}-81698099108171743232 \sqrt {\sqrt {5}-2}+111479672182086565888+\left (48294442822564577280+23342314030906212352 \sqrt {5} \sqrt {\sqrt {5}-2}-11671157015453106176 \sqrt {5}+46684628061812424704 \sqrt {\sqrt {5}-2}-83307913868923895808\right ) \left (\sqrt {\tan ^{2}x+2 \tan x+2}-\tan x\right )}{23342314030906212352}\right )\right )}{4 \left (16 \sqrt {5}-16\right )}-\frac {\ln \left (\sqrt {\tan ^{2}x+2 \tan x+2}-\tan x-1\right )}{2}\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-1/4*sqrt(2*sqrt(5) - 2)*log(256*(sqrt(5)*(sqrt(tan(x)^2 + 2*tan(x) + 2) - tan(x)) + sqrt(5)*sqrt(sqrt(5) - 2)
 - sqrt(5) - 2*sqrt(tan(x)^2 + 2*tan(x) + 2) - 2*sqrt(sqrt(5) - 2) + 2*tan(x) + 2)^2 + 256*(sqrt(5)*(sqrt(tan(
x)^2 + 2*tan(x) + 2) - tan(x)) + sqrt(5) - 2*sqrt(tan(x)^2 + 2*tan(x) + 2) + sqrt(sqrt(5) - 2) + 2*tan(x) - 2)
^2) + 1/4*sqrt(2*sqrt(5) - 2)*log(256*(sqrt(5)*(sqrt(tan(x)^2 + 2*tan(x) + 2) - tan(x)) - sqrt(5)*sqrt(sqrt(5)
 - 2) - sqrt(5) - 2*sqrt(tan(x)^2 + 2*tan(x) + 2) + 2*sqrt(sqrt(5) - 2) + 2*tan(x) + 2)^2 + 256*(sqrt(5)*(sqrt
(tan(x)^2 + 2*tan(x) + 2) - tan(x)) + sqrt(5) - 2*sqrt(tan(x)^2 + 2*tan(x) + 2) - sqrt(sqrt(5) - 2) + 2*tan(x)
 - 2)^2) + 1/4*(pi + 4*arctan(-1/2*(2*sqrt(5)*sqrt(sqrt(5) - 2) + sqrt(5) + 4*sqrt(sqrt(5) - 2) + 3)*(sqrt(tan
(x)^2 + 2*tan(x) + 2) - tan(x)) + 3/2*sqrt(5)*sqrt(sqrt(5) - 2) + 1/2*sqrt(5) + 7/2*sqrt(sqrt(5) - 2) + 3/2))*
sqrt(2*sqrt(5) - 2)/(sqrt(5) - 1) - 1/4*(pi + 4*arctan(1/2*(2*sqrt(5)*sqrt(sqrt(5) - 2) - sqrt(5) + 4*sqrt(sqr
t(5) - 2) - 3)*(sqrt(tan(x)^2 + 2*tan(x) + 2) - tan(x)) - 3/2*sqrt(5)*sqrt(sqrt(5) - 2) + 1/2*sqrt(5) - 7/2*sq
rt(sqrt(5) - 2) + 3/2))*sqrt(2*sqrt(5) - 2)/(sqrt(5) - 1) - log(sqrt(tan(x)^2 + 2*tan(x) + 2) - tan(x) - 1)

________________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________