ClearAll[x]; integrand = Sqrt[Tan[x]^2 + 2 Tan[x] + 2]; res = Integrate[integrand, x]; TeXForm[res]
\[ \sinh ^{-1}(\tan (x)+1)+\frac {1}{2} i \left (\sqrt {1+2 i} \tanh ^{-1}\left (\frac {(1+i) \tan (x)+(2+i)}{\sqrt {1+2 i} \sqrt {\tan ^2(x)+2 \tan (x)+2}}\right )-\sqrt {1-2 i} \tanh ^{-1}\left (\frac {(2-2 i) \tan (x)+(4-2 i)}{2 \sqrt {1-2 i} \sqrt {\tan ^2(x)+2 \tan (x)+2}}\right )\right ) \]
<< Rubi` ClearAll[x] integrand = Sqrt[Tan[x]^2 + 2 Tan[x] + 2]; res = Int[integrand, x]; TeXForm[res]
\[ -\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) \]
restart; integrand := sqrt(tan(x)^2 + 2*tan(x) + 2); res:=simplify(int(integrand,x)); latex(res)
\[ -10\,{\frac {1}{\sqrt {-10+10\,\sqrt {5}}\cos \left ( x \right ) \left ( \sqrt {5}-5 \right ) } \left ( -\sqrt {2}\sqrt {{\frac {2\,\sin \left ( x \right ) \cos \left ( x \right ) + \left ( \cos \left ( x \right ) \right ) ^{2}+1}{\cos \left ( x \right ) \left ( 2\,\sin \left ( x \right ) +\cos \left ( x \right ) \right ) \sqrt {5}+ \left ( \cos \left ( x \right ) \right ) ^{2}+2\,\sin \left ( x \right ) \cos \left ( x \right ) +2}}} \left ( \left ( \cos \left ( x \right ) -\sin \left ( x \right ) \right ) \sqrt {5}-\cos \left ( x \right ) +3\,\sin \left ( x \right ) \right ) {\rm arctanh} \left (2\,{\frac {\sqrt {5} \sqrt {2}}{\sqrt {-10+10\,\sqrt {5}}}\sqrt {{\frac {2\,\sin \left ( x \right ) \cos \left ( x \right ) + \left ( \cos \left ( x \right ) \right ) ^{2}+1}{\cos \left ( x \right ) \left ( 2\,\sin \left ( x \right ) +\cos \left ( x \right ) \right ) \sqrt {5}+ \left ( \cos \left ( x \right ) \right ) ^{2}+2\,\sin \left ( x \right ) \cos \left ( x \right ) +2}}}}\right )+\arctan \left ( {\frac {\sqrt {-22+10\,\sqrt {5} } \left ( \sqrt {5}-5 \right ) \left ( 7+3\,\sqrt {5} \right ) \sqrt {5} \sqrt {2} \left ( 2\, \left ( \cos \left ( x \right ) \right ) ^{2}-\sin \left ( x \right ) \cos \left ( x \right ) -1 \right ) }{80\,\sin \left ( x \right ) \cos \left ( x \right ) +40\, \left ( \cos \left ( x \right ) \right ) ^{2}+40}\sqrt {{\frac {2\,\sin \left ( x \right ) \cos \left ( x \right ) + \left ( \cos \left ( x \right ) \right ) ^{2}+1}{\cos \left ( x \right ) \left ( 2\,\sin \left ( x \right ) +\cos \left ( x \right ) \right ) \sqrt {5}+ \left ( \cos \left ( x \right ) \right ) ^{2}+2\,\sin \left ( x \right ) \cos \left ( x \right ) +2}}}} \right ) \sqrt {2} \left ( \sin \left ( x \right ) \sqrt {5}+2\,\cos \left ( x \right ) -\sin \left ( x \right ) \right ) \sqrt {{\frac {2\,\sin \left ( x \right ) \cos \left ( x \right ) + \left ( \cos \left ( x \right ) \right ) ^{2}+1}{ \cos \left ( x \right ) \left ( 2\,\sin \left ( x \right ) +\cos \left ( x \right ) \right ) \sqrt {5}+ \left ( \cos \left ( x \right ) \right ) ^{2 }+2\,\sin \left ( x \right ) \cos \left ( x \right ) +2}}}-1/10\, {\rm arcsinh} \left ({\frac {\sin \left ( x \right ) +\cos \left ( x \right ) }{\cos \left ( x \right ) }}\right )\sqrt {{\frac {2\,\sin \left ( x \right ) \cos \left ( x \right ) + \left ( \cos \left ( x \right ) \right ) ^{2}+1}{ \left ( \cos \left ( x \right ) \right ) ^{2}} }}\sqrt {-10+10\,\sqrt {5}}\cos \left ( x \right ) \left ( \sqrt {5}-5 \right ) \right ) {\frac {1}{\sqrt {{\frac {2\,\sin \left ( x \right ) \cos \left ( x \right ) + \left ( \cos \left ( x \right ) \right ) ^{2}+1}{ \left ( \cos \left ( x \right ) \right ) ^{2}}}}}}} \]
integrand := sqrt(tan(x)^2 + 2*tan(x) + 2); res:=integrate(integrand,x); latex(res)
\[ {{8 \ {\root {4} \of {5}} \ {\arctan \left ( {{{{{\left ( {{\left ( {{24} \ {\sqrt {5}}} -{24} \right )} \ {\cos \left ( {x} \right )} \ {\sin \left ( {x} \right )}}+{{\left ( {7 \ {\sqrt {5}}} -7 \right )} \ {{{\cos \left ( {x} \right )}} \sp {2}}} \right )} \ {\sqrt {{{{\sqrt {5}} -5} \over {{\sqrt {5}} -3}}} } \ {\sqrt {{{{2 \ {\cos \left ( {x} \right )} \ {\sin \left ( {x} \right )}}+ {{{\cos \left ( {x} \right )}} \sp {2}}+1} \over {{{\cos \left ( {x} \right )}} \sp {2}}}}}}+{{\left ( {7 \ {\sqrt {5}}}+{41} \right )} \ {\root {4} \of {5}} \ {\cos \left ( {x} \right )} \ {\sin \left ( {x} \right )}}+{{\left ( -{{24} \ {\sqrt {5}}}+{38} \right )} \ {\root {4} \of {5}} \ {{{\cos \left ( {x} \right )}} \sp {2}}}+{{\left ( {9 \ {\sqrt {5}}}+{17} \right )} \ {\root {4} \of { 5}}}} \over {{{\left ( {\sqrt {5}} -1 \right )} \ {\sqrt {{{{\sqrt {5}} -5} \over {{\sqrt {5}} -3}}}} \ {\sqrt {{{{{\left ( {{\left ( -{{375} \ {\sqrt {5}} }+{625} \right )} \ {\root {4} \of {5}} \ {\cos \left ( {x} \right )} \ {\sin \left ( {x} \right )}}+{{\left ( {{125} \ {\sqrt {5}}} -{625} \right )} \ {\root {4} \of {5}} \ {{{\cos \left ( {x} \right )}} \sp {2}}} \right )} \ {\sqrt {{{{\sqrt {5}} -5} \over {{\sqrt {5}} -3}}}} \ {\sqrt {{{{2 \ {\cos \left ( {x} \right )} \ {\sin \left ( {x} \right )}}+{{{\cos \left ( {x} \right )}} \sp { 2}}+1} \over {{{\cos \left ( {x} \right )}} \sp {2}}}}}}+{{\left ( {{\left ( {{1500} \ {\sqrt {5}}} -{3750} \right )} \ {{{\root {4} \of {5}}} \sp {2}}}+{{2500} \ {\sqrt {5}}} -{6250} \right )} \ {\cos \left ( {x} \right )} \ {\sin \left ( {x} \right )}}+{{\left ( {{\left ( {{750} \ {\sqrt {5}}} -{1875} \right )} \ {{{\root {4} \of {5}}} \sp {2}}}+{{1250} \ {\sqrt {5}}} -{3125} \right )} \ {{{\cos \left ( {x} \right )}} \sp {2}}}+{{\left ( {{500} \ {\sqrt {5}}} -{1250} \right )} \ {{{\root {4} \of {5}}} \sp {2}}}+{{1250} \ {\sqrt {5}}} - {3125}} \over {{2 \ {\sqrt {5}}} -5}}}}}+{{\left ( {{\left ( -{7 \ {\sqrt {5}}} +7 \right )} \ {\cos \left ( {x} \right )} \ {\sin \left ( {x} \right )}}+{{\left ( {{24} \ {\sqrt {5}}} -{24} \right )} \ {{{\cos \left ( {x} \right )}} \sp { 2}}} \right )} \ {\sqrt {{{{\sqrt {5}} -5} \over {{\sqrt {5}} -3}}}} \ {\sqrt {{{{2 \ {\cos \left ( {x} \right )} \ {\sin \left ( {x} \right )}}+{{{\cos \left ( {x} \right )}} \sp {2}}+1} \over {{{\cos \left ( {x} \right )}} \sp {2}}}}} }+{{\left ( {{24} \ {\sqrt {5}}} -{38} \right )} \ {\root {4} \of {5}} \ {\cos \left ( {x} \right )} \ {\sin \left ( {x} \right )}}+{{\left ( {7 \ {\sqrt {5}}}+{41} \right )} \ {\root {4} \of {5}} \ {{{\cos \left ( {x} \right )}} \sp {2}}}+{{\left ( {{13} \ {\sqrt {5}}} -{31} \right )} \ {\root {4} \of {5}}}}} } \right )}} -{8 \ {\root {4} \of {5}} \ {\arctan \left ( {{{{{\left ( {{\left ( {{24} \ {\sqrt {5}}} -{24} \right )} \ {\cos \left ( {x} \right )} \ {\sin \left ( {x} \right )}}+{{\left ( {7 \ {\sqrt {5}}} -7 \right )} \ {{{\cos \left ( {x} \right )}} \sp {2}}} \right )} \ {\sqrt {{{{\sqrt {5}} -5} \over {{\sqrt {5}} -3}}}} \ {\sqrt {{{{2 \ {\cos \left ( {x} \right )} \ {\sin \left ( {x} \right )}}+{{{\cos \left ( {x} \right )}} \sp {2}}+1} \over {{{\cos \left ( {x} \right )}} \sp {2}}}}}}+{{\left ( -{7 \ {\sqrt {5}}} -{41} \right )} \ {\root {4} \of {5}} \ {\cos \left ( {x} \right )} \ {\sin \left ( {x} \right )}}+{{ \left ( {{24} \ {\sqrt {5}}} -{38} \right )} \ {\root {4} \of {5}} \ {{{\cos \left ( {x} \right )}} \sp {2}}}+{{\left ( -{9 \ {\sqrt {5}}} -{17} \right )} \ { \root {4} \of {5}}}} \over {{{\left ( {\sqrt {5}} -1 \right )} \ {\sqrt {{{{\sqrt {5}} -5} \over {{\sqrt {5}} -3}}}} \ {\sqrt {{{{{\left ( {{\left ( {{375} \ {\sqrt {5}}} -{625} \right )} \ {\root {4} \of {5}} \ {\cos \left ( {x} \right )} \ {\sin \left ( {x} \right )}}+{{\left ( -{{125} \ {\sqrt {5}}}+{625} \right )} \ {\root {4} \of {5}} \ {{{\cos \left ( {x} \right )}} \sp {2}}} \right )} \ {\sqrt {{{{\sqrt {5}} -5} \over {{\sqrt {5}} -3}}}} \ {\sqrt {{{{2 \ {\cos \left ( {x} \right )} \ {\sin \left ( {x} \right )}}+{{{\cos \left ( {x} \right )}} \sp {2}}+1} \over {{{\cos \left ( {x} \right )}} \sp {2}}}}}}+{{\left ( {{\left ( {{1500} \ {\sqrt {5}}} -{3750} \right )} \ {{{\root {4} \of {5}}} \sp {2}}}+{{2500} \ {\sqrt {5}}} -{6250} \right )} \ {\cos \left ( {x} \right )} \ {\sin \left ( {x} \right )}}+{{\left ( {{\left ( {{750} \ {\sqrt {5}}} -{ 1875} \right )} \ {{{\root {4} \of {5}}} \sp {2}}}+{{1250} \ {\sqrt {5}}} -{ 3125} \right )} \ {{{\cos \left ( {x} \right )}} \sp {2}}}+{{\left ( {{500} \ { \sqrt {5}}} -{1250} \right )} \ {{{\root {4} \of {5}}} \sp {2}}}+{{1250} \ { \sqrt {5}}} -{3125}} \over {{2 \ {\sqrt {5}}} -5}}}}}+{{\left ( {{\left ( -{7 \ {\sqrt {5}}}+7 \right )} \ {\cos \left ( {x} \right )} \ {\sin \left ( {x} \right )}}+{{\left ( {{24} \ {\sqrt {5}}} -{24} \right )} \ {{{\cos \left ( {x} \right )}} \sp {2}}} \right )} \ {\sqrt {{{{\sqrt {5}} -5} \over {{\sqrt {5}} -3}}}} \ {\sqrt {{{{2 \ {\cos \left ( {x} \right )} \ {\sin \left ( {x} \right )}}+{{{\cos \left ( {x} \right )}} \sp {2}}+1} \over {{{\cos \left ( {x} \right )}} \sp {2}}}}}}+{{\left ( -{{24} \ {\sqrt {5}}}+{38} \right )} \ {\root {4} \of {5}} \ {\cos \left ( {x} \right )} \ {\sin \left ( {x} \right )}}+{{\left ( -{7 \ {\sqrt {5}}} -{41} \right )} \ {\root {4} \of {5}} \ {{{\cos \left ( { x} \right )}} \sp {2}}}+{{\left ( -{{13} \ {\sqrt {5}}}+{31} \right )} \ {\root {4} \of {5}}}}}} \right )}}+{{\left ( {\sqrt {5}} -1 \right )} \ {\root {4} \of {5}} \ {\log \left ( {{{{{\left ( {{\left ( {{375} \ {\sqrt {5}}} -{625} \right )} \ {\root {4} \of {5}} \ {\cos \left ( {x} \right )} \ {\sin \left ( {x } \right )}}+{{\left ( -{{125} \ {\sqrt {5}}}+{625} \right )} \ {\root {4} \of {5}} \ {{{\cos \left ( {x} \right )}} \sp {2}}} \right )} \ {\sqrt {{{{\sqrt {5}} -5} \over {{\sqrt {5}} -3}}}} \ {\sqrt {{{{2 \ {\cos \left ( {x} \right )} \ {\sin \left ( {x} \right )}}+{{{\cos \left ( {x} \right )}} \sp {2}}+1} \over {{{\cos \left ( {x} \right )}} \sp {2}}}}}}+{{\left ( {{\left ( {{1500} \ {\sqrt {5}}} -{3750} \right )} \ {{{\root {4} \of {5}}} \sp {2}}}+{{2500} \ {\sqrt {5}}} -{6250} \right )} \ {\cos \left ( {x} \right )} \ {\sin \left ( {x} \right )}}+{{\left ( {{\left ( {{750} \ {\sqrt {5}}} -{1875} \right )} \ {{{\root {4} \of {5}}} \sp {2}}}+{{1250} \ {\sqrt {5}}} -{3125} \right )} \ {{{\cos \left ( {x} \right )}} \sp {2}}}+{{\left ( {{500} \ {\sqrt {5}}} -{1250} \right )} \ {{{\root {4} \of {5}}} \sp {2}}}+{{1250} \ {\sqrt {5}}} -{3125}} \over {{2 \ {\sqrt {5}}} -5}}} \right )}}+{{\left ( {2 \ {\sqrt {5}}} -2 \right )} \ {\sqrt {{{{\sqrt {5}} -5} \over {{\sqrt {5}} -3}}}} \ {\log \left ( {{{{{ \left ( {2 \ {\cos \left ( {x} \right )} \ {\sin \left ( {x} \right )}}+{2 \ {{ {\cos \left ( {x} \right )}} \sp {2}}} \right )} \ {\sqrt {{{{2 \ {\cos \left ( {x} \right )} \ {\sin \left ( {x} \right )}}+{{{\cos \left ( {x} \right )}} \sp {2}}+1} \over {{{\cos \left ( {x} \right )}} \sp {2}}}}}}+{4 \ {\cos \left ( {x } \right )} \ {\sin \left ( {x} \right )}}+{{{\cos \left ( {x} \right )}} \sp {2} }+2} \over {{{\cos \left ( {x} \right )}} \sp {2}}}} \right )}}+{{\left ( -{\sqrt {5}}+1 \right )} \ {\root {4} \of {5}} \ {\log \left ( {{{{{\left ( {{\left ( -{{375} \ {\sqrt {5}}}+{625} \right )} \ {\root {4} \of {5}} \ {\cos \left ( {x} \right )} \ {\sin \left ( {x} \right )}}+{{\left ( {{125} \ {\sqrt {5}}} - {625} \right )} \ {\root {4} \of {5}} \ {{{\cos \left ( {x} \right )}} \sp {2} }} \right )} \ {\sqrt {{{{\sqrt {5}} -5} \over {{\sqrt {5}} -3}}}} \ {\sqrt {{{{2 \ {\cos \left ( {x} \right )} \ {\sin \left ( {x} \right )}}+{{{\cos \left ( {x} \right )}} \sp {2}}+1} \over {{{\cos \left ( {x} \right )}} \sp {2}}}}}}+ {{\left ( {{\left ( {{1500} \ {\sqrt {5}}} -{3750} \right )} \ {{{\root {4} \of {5}}} \sp {2}}}+{{2500} \ {\sqrt {5}}} -{6250} \right )} \ {\cos \left ( {x } \right )} \ {\sin \left ( {x} \right )}}+{{\left ( {{\left ( {{750} \ {\sqrt { 5}}} -{1875} \right )} \ {{{\root {4} \of {5}}} \sp {2}}}+{{1250} \ {\sqrt {5}}} -{3125} \right )} \ {{{\cos \left ( {x} \right )}} \sp {2}}}+{{\left ( {{500} \ {\sqrt {5}}} -{1250} \right )} \ {{{\root {4} \of {5}}} \sp {2}}} +{{1250} \ {\sqrt {5}}} -{3125}} \over {{2 \ {\sqrt {5}}} -5}}} \right )}}} \over {{\left ( {4 \ {\sqrt {5}}} -4 \right )} \ {\sqrt {{{{\sqrt {5}} -5} \over {{\sqrt {5}} -3}}}}} \]
integrand : sqrt(tan(x)^2 + 2*tan(x) + 2); res : integrate(integrand,x);
\[ \text {did not solve} \]
integrand := sqrt(tan(x)^2 + 2*tan(x) + 2); res := integrate(integrand,x); latex(res)
\[ 2 \left (-\frac {\ln \left (\sqrt {\tan ^{2}x+2 \tan x+2}-\tan x-1\right )}{2}+\frac {1}{8} \sqrt {2 \left (\sqrt {5}-1\right )} \left (1-\frac {32 \mathrm {i}}{16 \sqrt {5}-16}\right ) \ln \left (-16 \left (1+\frac {512 \mathrm {i}}{512 \sqrt {5}-1024}\right ) \sqrt {\sqrt {5}-2}+\left (-16+16 \mathrm {i}\right )+\left (16+16 \mathrm {i}\right ) \left (\sqrt {\tan ^{2}x+2 \tan x+2}-\tan x\right )\right )-\frac {1}{8} \sqrt {2 \left (\sqrt {5}-1\right )} \left (1-\frac {32 \mathrm {i}}{16 \sqrt {5}-16}\right ) \ln \left (16 \left (1+\frac {512 \mathrm {i}}{512 \sqrt {5}-1024}\right ) \sqrt {\sqrt {5}-2}+\left (-16+16 \mathrm {i}\right )+\left (16+16 \mathrm {i}\right ) \left (\sqrt {\tan ^{2}x+2 \tan x+2}-\tan x\right )\right )+\frac {1}{8} \sqrt {2 \left (\sqrt {5}-1\right )} \left (1+\frac {32 \mathrm {i}}{16 \sqrt {5}-16}\right ) \ln \left (-16 \left (1+\frac {512 \mathrm {i}}{512 \sqrt {5}+1024}\right ) \sqrt {\sqrt {5}+2}+\left (16-16 \mathrm {i}\right )+\left (16+16 \mathrm {i}\right ) \left (\sqrt {\tan ^{2}x+2 \tan x+2}-\tan x\right )\right )-\frac {1}{8} \sqrt {2 \left (\sqrt {5}-1\right )} \left (1+\frac {32 \mathrm {i}}{16 \sqrt {5}-16}\right ) \ln \left (16 \left (1+\frac {512 \mathrm {i}}{512 \sqrt {5}+1024}\right ) \sqrt {\sqrt {5}+2}+\left (16-16 \mathrm {i}\right )+\left (16+16 \mathrm {i}\right ) \left (\sqrt {\tan ^{2}x+2 \tan x+2}-\tan x\right )\right )\right ) \]
>python Python 3.7.3 (default, Mar 27 2019, 22:11:17) [GCC 7.3.0] :: Anaconda, Inc. on linux from sympy import * x = symbols('x') integrand = sqrt(tan(x)**2 + 2*tan(x) + 2); res = integrate(integrand,x); latex(res)
\[ \text {did not solve} \]
evalin(symengine,'int(sqrt(tan(x)^2 + 2*tan(x) + 2),x)')
\[ \text {did not solve} \]