3.5 \(\int \frac{\cos ^2(x)}{\sqrt{1+\cos ^2(x)+\cos ^4(x)}} \, dx\)

Optimal. Leaf size=45 \[ \frac{x}{3}+\frac{1}{3} \tan ^{-1}\left (\frac{\sin (x) \cos (x) \left (\cos ^2(x)+1\right )}{\sqrt{\cos ^4(x)+\cos ^2(x)+1} \cos ^2(x)+1}\right ) \]

[Out]

x/3 + ArcTan[(Cos[x]*(1 + Cos[x]^2)*Sin[x])/(1 + Cos[x]^2*Sqrt[1 + Cos[x]^2 + Co
s[x]^4])]/3

_______________________________________________________________________________________

Rubi [C]  time = 0.752164, antiderivative size = 304, normalized size of antiderivative = 6.76, number of steps used = 4, number of rules used = 3, integrand size = 19, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.158 \[ \frac{\cos ^2(x) \tan ^{-1}\left (\frac{\tan (x)}{\sqrt{\tan ^4(x)+3 \tan ^2(x)+3}}\right ) \sqrt{\tan ^4(x)+3 \tan ^2(x)+3}}{2 \sqrt{\cos ^4(x) \left (\tan ^4(x)+3 \tan ^2(x)+3\right )}}-\frac{\sqrt [4]{3} \cos ^2(x) \left (\tan ^2(x)+\sqrt{3}\right ) \sqrt{\frac{\tan ^4(x)+3 \tan ^2(x)+3}{\left (\tan ^2(x)+\sqrt{3}\right )^2}} F\left (2 \tan ^{-1}\left (\frac{\tan (x)}{\sqrt [4]{3}}\right )|\frac{1}{4} \left (2-\sqrt{3}\right )\right )}{2 \left (3-\sqrt{3}\right ) \sqrt{\cos ^4(x) \left (\tan ^4(x)+3 \tan ^2(x)+3\right )}}+\frac{\sqrt [4]{3} \left (1+\sqrt{3}\right ) \cos ^2(x) \left (\tan ^2(x)+\sqrt{3}\right ) \sqrt{\frac{\tan ^4(x)+3 \tan ^2(x)+3}{\left (\tan ^2(x)+\sqrt{3}\right )^2}} \Pi \left (\frac{1}{6} \left (3-2 \sqrt{3}\right );2 \tan ^{-1}\left (\frac{\tan (x)}{\sqrt [4]{3}}\right )|\frac{1}{4} \left (2-\sqrt{3}\right )\right )}{4 \left (3-\sqrt{3}\right ) \sqrt{\cos ^4(x) \left (\tan ^4(x)+3 \tan ^2(x)+3\right )}} \]

Warning: Unable to verify antiderivative.

[In]  Int[Cos[x]^2/Sqrt[1 + Cos[x]^2 + Cos[x]^4],x]

[Out]

(ArcTan[Tan[x]/Sqrt[3 + 3*Tan[x]^2 + Tan[x]^4]]*Cos[x]^2*Sqrt[3 + 3*Tan[x]^2 + T
an[x]^4])/(2*Sqrt[Cos[x]^4*(3 + 3*Tan[x]^2 + Tan[x]^4)]) - (3^(1/4)*Cos[x]^2*Ell
ipticF[2*ArcTan[Tan[x]/3^(1/4)], (2 - Sqrt[3])/4]*(Sqrt[3] + Tan[x]^2)*Sqrt[(3 +
 3*Tan[x]^2 + Tan[x]^4)/(Sqrt[3] + Tan[x]^2)^2])/(2*(3 - Sqrt[3])*Sqrt[Cos[x]^4*
(3 + 3*Tan[x]^2 + Tan[x]^4)]) + (3^(1/4)*(1 + Sqrt[3])*Cos[x]^2*EllipticPi[(3 -
2*Sqrt[3])/6, 2*ArcTan[Tan[x]/3^(1/4)], (2 - Sqrt[3])/4]*(Sqrt[3] + Tan[x]^2)*Sq
rt[(3 + 3*Tan[x]^2 + Tan[x]^4)/(Sqrt[3] + Tan[x]^2)^2])/(4*(3 - Sqrt[3])*Sqrt[Co
s[x]^4*(3 + 3*Tan[x]^2 + Tan[x]^4)])

_______________________________________________________________________________________

Rubi in Sympy [F(-1)]  time = 0., size = 0, normalized size = 0. \[ \text{Timed out} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  rubi_integrate(cos(x)**2/(1+cos(x)**2+cos(x)**4)**(1/2),x)

[Out]

Timed out

_______________________________________________________________________________________

Mathematica [C]  time = 3.87583, size = 159, normalized size = 3.53 \[ -\frac{2 i \cos ^2(x) \sqrt{1-\frac{2 i \tan ^2(x)}{\sqrt{3}-3 i}} \sqrt{1+\frac{2 i \tan ^2(x)}{\sqrt{3}+3 i}} \Pi \left (\frac{3}{2}+\frac{i \sqrt{3}}{2};i \sinh ^{-1}\left (\sqrt{-\frac{2 i}{-3 i+\sqrt{3}}} \tan (x)\right )|\frac{3 i-\sqrt{3}}{3 i+\sqrt{3}}\right )}{\sqrt{-\frac{i}{\sqrt{3}-3 i}} \sqrt{8 \cos (2 x)+\cos (4 x)+15}} \]

Antiderivative was successfully verified.

[In]  Integrate[Cos[x]^2/Sqrt[1 + Cos[x]^2 + Cos[x]^4],x]

[Out]

((-2*I)*Cos[x]^2*EllipticPi[3/2 + (I/2)*Sqrt[3], I*ArcSinh[Sqrt[(-2*I)/(-3*I + S
qrt[3])]*Tan[x]], (3*I - Sqrt[3])/(3*I + Sqrt[3])]*Sqrt[1 - ((2*I)*Tan[x]^2)/(-3
*I + Sqrt[3])]*Sqrt[1 + ((2*I)*Tan[x]^2)/(3*I + Sqrt[3])])/(Sqrt[(-I)/(-3*I + Sq
rt[3])]*Sqrt[15 + 8*Cos[2*x] + Cos[4*x]])

_______________________________________________________________________________________

Maple [C]  time = 0.585, size = 312, normalized size = 6.9 \[ -2\,{\frac{\sqrt{ \left ( \left ( \cos \left ( 2\,x \right ) \right ) ^{2}+4\,\cos \left ( 2\,x \right ) +7 \right ) \left ( \sin \left ( 2\,x \right ) \right ) ^{2}} \left ( i\sqrt{3}-3 \right ) \left ( 1+\cos \left ( 2\,x \right ) \right ) ^{2}}{ \left ( -1+i\sqrt{3} \right ) \sqrt{ \left ( \cos \left ( 2\,x \right ) -1 \right ) \left ( 1+\cos \left ( 2\,x \right ) \right ) \left ( \cos \left ( 2\,x \right ) +2+i\sqrt{3} \right ) \left ( i\sqrt{3}-\cos \left ( 2\,x \right ) -2 \right ) }\sin \left ( 2\,x \right ) \sqrt{ \left ( \cos \left ( 2\,x \right ) \right ) ^{2}+4\,\cos \left ( 2\,x \right ) +7}}\sqrt{{\frac{ \left ( -1+i\sqrt{3} \right ) \left ( \cos \left ( 2\,x \right ) -1 \right ) }{ \left ( i\sqrt{3}-3 \right ) \left ( 1+\cos \left ( 2\,x \right ) \right ) }}}\sqrt{{\frac{\cos \left ( 2\,x \right ) +2+i\sqrt{3}}{ \left ( i\sqrt{3}+3 \right ) \left ( 1+\cos \left ( 2\,x \right ) \right ) }}}\sqrt{{\frac{i\sqrt{3}-\cos \left ( 2\,x \right ) -2}{ \left ( i\sqrt{3}-3 \right ) \left ( 1+\cos \left ( 2\,x \right ) \right ) }}}{\it EllipticPi} \left ( \sqrt{{\frac{ \left ( -1+i\sqrt{3} \right ) \left ( \cos \left ( 2\,x \right ) -1 \right ) }{ \left ( i\sqrt{3}-3 \right ) \left ( 1+\cos \left ( 2\,x \right ) \right ) }}},{\frac{i\sqrt{3}-3}{-1+i\sqrt{3}}},\sqrt{{\frac{ \left ( i\sqrt{3}-3 \right ) \left ( 1+i\sqrt{3} \right ) }{ \left ( i\sqrt{3}+3 \right ) \left ( -1+i\sqrt{3} \right ) }}} \right ) } \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  int(cos(x)^2/(1+cos(x)^2+cos(x)^4)^(1/2),x)

[Out]

-2*((cos(2*x)^2+4*cos(2*x)+7)*sin(2*x)^2)^(1/2)*(I*3^(1/2)-3)*((-1+I*3^(1/2))*(c
os(2*x)-1)/(I*3^(1/2)-3)/(1+cos(2*x)))^(1/2)*(1+cos(2*x))^2*((cos(2*x)+2+I*3^(1/
2))/(I*3^(1/2)+3)/(1+cos(2*x)))^(1/2)*((I*3^(1/2)-cos(2*x)-2)/(I*3^(1/2)-3)/(1+c
os(2*x)))^(1/2)*EllipticPi(((-1+I*3^(1/2))*(cos(2*x)-1)/(I*3^(1/2)-3)/(1+cos(2*x
)))^(1/2),(I*3^(1/2)-3)/(-1+I*3^(1/2)),((I*3^(1/2)-3)*(1+I*3^(1/2))/(I*3^(1/2)+3
)/(-1+I*3^(1/2)))^(1/2))/(-1+I*3^(1/2))/((cos(2*x)-1)*(1+cos(2*x))*(cos(2*x)+2+I
*3^(1/2))*(I*3^(1/2)-cos(2*x)-2))^(1/2)/sin(2*x)/(cos(2*x)^2+4*cos(2*x)+7)^(1/2)

_______________________________________________________________________________________

Maxima [A]  time = 65.1339, size = 47, normalized size = 1.04 \[ 2 \, \log \left (\cos \left (x\right )^{2} + \sin \left (x\right )^{2} + 2 \, \cos \left (x\right ) + 1\right ) + 2 \, \log \left (\cos \left (x\right )^{2} + \sin \left (x\right )^{2} - 2 \, \cos \left (x\right ) + 1\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate(cos(x)^2/sqrt(cos(x)^4 + cos(x)^2 + 1),x, algorithm="maxima")

[Out]

2*log(cos(x)^2 + sin(x)^2 + 2*cos(x) + 1) + 2*log(cos(x)^2 + sin(x)^2 - 2*cos(x)
 + 1)

_______________________________________________________________________________________

Fricas [A]  time = 0.281681, size = 45, normalized size = 1. \[ \frac{1}{6} \, \arctan \left (\frac{2 \, \sqrt{\cos \left (x\right )^{4} + \cos \left (x\right )^{2} + 1} \cos \left (x\right )^{3} \sin \left (x\right )}{2 \, \cos \left (x\right )^{6} - 1}\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate(cos(x)^2/sqrt(cos(x)^4 + cos(x)^2 + 1),x, algorithm="fricas")

[Out]

1/6*arctan(2*sqrt(cos(x)^4 + cos(x)^2 + 1)*cos(x)^3*sin(x)/(2*cos(x)^6 - 1))

_______________________________________________________________________________________

Sympy [F(-1)]  time = 0., size = 0, normalized size = 0. \[ \text{Timed out} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate(cos(x)**2/(1+cos(x)**2+cos(x)**4)**(1/2),x)

[Out]

Timed out

_______________________________________________________________________________________

GIAC/XCAS [F]  time = 0., size = 0, normalized size = 0. \[ \int \frac{\cos \left (x\right )^{2}}{\sqrt{\cos \left (x\right )^{4} + \cos \left (x\right )^{2} + 1}}\,{d x} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate(cos(x)^2/sqrt(cos(x)^4 + cos(x)^2 + 1),x, algorithm="giac")

[Out]

integrate(cos(x)^2/sqrt(cos(x)^4 + cos(x)^2 + 1), x)