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 + Cos[x]^4])]/3

________________________________________________________________________________________

Rubi [C]  time = 0.491171, antiderivative size = 289, normalized size of antiderivative = 6.42, number of steps used = 5, number of rules used = 4, integrand size = 19, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.21, Rules used = {6719, 1216, 1103, 1706} \[ \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{\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}} F\left (2 \tan ^{-1}\left (\frac{\tan (x)}{\sqrt [4]{3}}\right )|\frac{1}{4} \left (2-\sqrt{3}\right )\right )}{4 \sqrt [4]{3} \sqrt{\cos ^4(x) \left (\tan ^4(x)+3 \tan ^2(x)+3\right )}}+\frac{\left (2+\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 \sqrt [4]{3} \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 + Tan[x]^4])/(2*Sqrt[Cos[x]^4*(3
+ 3*Tan[x]^2 + Tan[x]^4)]) - ((1 + Sqrt[3])*Cos[x]^2*EllipticF[2*ArcTan[Tan[x]/3^(1/4)], (2 - Sqrt[3])/4]*(Sqr
t[3] + Tan[x]^2)*Sqrt[(3 + 3*Tan[x]^2 + Tan[x]^4)/(Sqrt[3] + Tan[x]^2)^2])/(4*3^(1/4)*Sqrt[Cos[x]^4*(3 + 3*Tan
[x]^2 + Tan[x]^4)]) + ((2 + Sqrt[3])*Cos[x]^2*EllipticPi[(3 - 2*Sqrt[3])/6, 2*ArcTan[Tan[x]/3^(1/4)], (2 - Sqr
t[3])/4]*(Sqrt[3] + Tan[x]^2)*Sqrt[(3 + 3*Tan[x]^2 + Tan[x]^4)/(Sqrt[3] + Tan[x]^2)^2])/(4*3^(1/4)*Sqrt[Cos[x]
^4*(3 + 3*Tan[x]^2 + Tan[x]^4)])

Rule 6719

Int[(u_.)*((a_.)*(v_)^(m_.)*(w_)^(n_.))^(p_), x_Symbol] :> Dist[(a^IntPart[p]*(a*v^m*w^n)^FracPart[p])/(v^(m*F
racPart[p])*w^(n*FracPart[p])), Int[u*v^(m*p)*w^(n*p), x], x] /; FreeQ[{a, m, n, p}, x] &&  !IntegerQ[p] &&  !
FreeQ[v, x] &&  !FreeQ[w, x]

Rule 1216

Int[1/(((d_) + (e_.)*(x_)^2)*Sqrt[(a_) + (b_.)*(x_)^2 + (c_.)*(x_)^4]), x_Symbol] :> With[{q = Rt[c/a, 2]}, Di
st[(c*d + a*e*q)/(c*d^2 - a*e^2), Int[1/Sqrt[a + b*x^2 + c*x^4], x], x] - Dist[(a*e*(e + d*q))/(c*d^2 - a*e^2)
, Int[(1 + q*x^2)/((d + e*x^2)*Sqrt[a + b*x^2 + c*x^4]), x], x]] /; FreeQ[{a, b, c, d, e}, x] && NeQ[b^2 - 4*a
*c, 0] && NeQ[c*d^2 - b*d*e + a*e^2, 0] && NeQ[c*d^2 - a*e^2, 0] && PosQ[c/a]

Rule 1103

Int[1/Sqrt[(a_) + (b_.)*(x_)^2 + (c_.)*(x_)^4], x_Symbol] :> With[{q = Rt[c/a, 4]}, Simp[((1 + q^2*x^2)*Sqrt[(
a + b*x^2 + c*x^4)/(a*(1 + q^2*x^2)^2)]*EllipticF[2*ArcTan[q*x], 1/2 - (b*q^2)/(4*c)])/(2*q*Sqrt[a + b*x^2 + c
*x^4]), x]] /; FreeQ[{a, b, c}, x] && NeQ[b^2 - 4*a*c, 0] && PosQ[c/a]

Rule 1706

Int[((A_) + (B_.)*(x_)^2)/(((d_) + (e_.)*(x_)^2)*Sqrt[(a_) + (b_.)*(x_)^2 + (c_.)*(x_)^4]), x_Symbol] :> With[
{q = Rt[B/A, 2]}, -Simp[((B*d - A*e)*ArcTan[(Rt[-b + (c*d)/e + (a*e)/d, 2]*x)/Sqrt[a + b*x^2 + c*x^4]])/(2*d*e
*Rt[-b + (c*d)/e + (a*e)/d, 2]), x] + Simp[((B*d + A*e)*(A + B*x^2)*Sqrt[(A^2*(a + b*x^2 + c*x^4))/(a*(A + B*x
^2)^2)]*EllipticPi[Cancel[-((B*d - A*e)^2/(4*d*e*A*B))], 2*ArcTan[q*x], 1/2 - (b*A)/(4*a*B)])/(4*d*e*A*q*Sqrt[
a + b*x^2 + c*x^4]), x]] /; FreeQ[{a, b, c, d, e, A, B}, x] && NeQ[b^2 - 4*a*c, 0] && NeQ[c*d^2 - b*d*e + a*e^
2, 0] && NeQ[c*d^2 - a*e^2, 0] && PosQ[c/a] && EqQ[c*A^2 - a*B^2, 0]

Rubi steps

\begin{align*} \int \frac{\cos ^2(x)}{\sqrt{1+\cos ^2(x)+\cos ^4(x)}} \, dx &=\operatorname{Subst}\left (\int \frac{1}{\left (1+x^2\right )^2 \sqrt{\frac{3+3 x^2+x^4}{\left (1+x^2\right )^2}}} \, dx,x,\tan (x)\right )\\ &=\frac{\left (\cos ^2(x) \sqrt{3+3 \tan ^2(x)+\tan ^4(x)}\right ) \operatorname{Subst}\left (\int \frac{1}{\left (1+x^2\right ) \sqrt{3+3 x^2+x^4}} \, dx,x,\tan (x)\right )}{\sqrt{\cos ^4(x) \left (3+3 \tan ^2(x)+\tan ^4(x)\right )}}\\ &=\frac{\left (\left (-1-\sqrt{3}\right ) \cos ^2(x) \sqrt{3+3 \tan ^2(x)+\tan ^4(x)}\right ) \operatorname{Subst}\left (\int \frac{1}{\sqrt{3+3 x^2+x^4}} \, dx,x,\tan (x)\right )}{2 \sqrt{\cos ^4(x) \left (3+3 \tan ^2(x)+\tan ^4(x)\right )}}+\frac{\left (\left (3+\sqrt{3}\right ) \cos ^2(x) \sqrt{3+3 \tan ^2(x)+\tan ^4(x)}\right ) \operatorname{Subst}\left (\int \frac{1+\frac{x^2}{\sqrt{3}}}{\left (1+x^2\right ) \sqrt{3+3 x^2+x^4}} \, dx,x,\tan (x)\right )}{2 \sqrt{\cos ^4(x) \left (3+3 \tan ^2(x)+\tan ^4(x)\right )}}\\ &=\frac{\tan ^{-1}\left (\frac{\tan (x)}{\sqrt{3+3 \tan ^2(x)+\tan ^4(x)}}\right ) \cos ^2(x) \sqrt{3+3 \tan ^2(x)+\tan ^4(x)}}{2 \sqrt{\cos ^4(x) \left (3+3 \tan ^2(x)+\tan ^4(x)\right )}}-\frac{\left (1+\sqrt{3}\right ) \cos ^2(x) F\left (2 \tan ^{-1}\left (\frac{\tan (x)}{\sqrt [4]{3}}\right )|\frac{1}{4} \left (2-\sqrt{3}\right )\right ) \left (\sqrt{3}+\tan ^2(x)\right ) \sqrt{\frac{3+3 \tan ^2(x)+\tan ^4(x)}{\left (\sqrt{3}+\tan ^2(x)\right )^2}}}{4 \sqrt [4]{3} \sqrt{\cos ^4(x) \left (3+3 \tan ^2(x)+\tan ^4(x)\right )}}+\frac{\left (2+\sqrt{3}\right ) \cos ^2(x) \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 ) \left (\sqrt{3}+\tan ^2(x)\right ) \sqrt{\frac{3+3 \tan ^2(x)+\tan ^4(x)}{\left (\sqrt{3}+\tan ^2(x)\right )^2}}}{4 \sqrt [4]{3} \sqrt{\cos ^4(x) \left (3+3 \tan ^2(x)+\tan ^4(x)\right )}}\\ \end{align*}

Mathematica [C]  time = 2.02207, 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 + Sqrt[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 + Sqrt[3])]*Sqrt[15 + 8*Cos[2*x] + Cos[4*x]])

________________________________________________________________________________________

Maple [C]  time = 0.421, size = 312, normalized size = 6.9 \begin{align*} -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 ) } \end{align*}

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))*(cos(2*x)-1)/(I*3^(1/2)-3)/(1+co
s(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+cos(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 [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{\cos \left (x\right )^{2}}{\sqrt{\cos \left (x\right )^{4} + \cos \left (x\right )^{2} + 1}}\,{d x} \end{align*}

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, algorithm="maxima")

[Out]

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

________________________________________________________________________________________

Fricas [A]  time = 3.84118, size = 105, normalized size = 2.33 \begin{align*} \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 ) \end{align*}

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, 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. \begin{align*} \text{Timed out} \end{align*}

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 [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{\cos \left (x\right )^{2}}{\sqrt{\cos \left (x\right )^{4} + \cos \left (x\right )^{2} + 1}}\,{d x} \end{align*}

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, algorithm="giac")

[Out]

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