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]

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

________________________________________________________________________________________

Rubi [C]  time = 0.49, 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.210, 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 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 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 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]

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]

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.21, 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]])

________________________________________________________________________________________

fricas [A]  time = 0.54, size = 33, normalized size = 0.73 \[ \frac {1}{6} \, \arctan \left (\frac {2 \, \sqrt {\cos \relax (x)^{4} + \cos \relax (x)^{2} + 1} \cos \relax (x)^{3} \sin \relax (x)}{2 \, \cos \relax (x)^{6} - 1}\right ) \]

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))

________________________________________________________________________________________

giac [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \int \frac {\cos \relax (x)^{2}}{\sqrt {\cos \relax (x)^{4} + \cos \relax (x)^{2} + 1}}\,{d x} \]

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)

________________________________________________________________________________________

maple [C]  time = 0.60, size = 312, normalized size = 6.93 \[ -\frac {2 \sqrt {\left (\cos ^{2}\left (2 x \right )+4 \cos \left (2 x \right )+7\right ) \left (\sin ^{2}\left (2 x \right )\right )}\, \left (i \sqrt {3}-3\right ) \sqrt {\frac {\left (-1+i \sqrt {3}\right ) \left (\cos \left (2 x \right )-1\right )}{\left (i \sqrt {3}-3\right ) \left (\cos \left (2 x \right )+1\right )}}\, \left (\cos \left (2 x \right )+1\right )^{2} \sqrt {\frac {\cos \left (2 x \right )+2+i \sqrt {3}}{\left (i \sqrt {3}+3\right ) \left (\cos \left (2 x \right )+1\right )}}\, \sqrt {\frac {-\cos \left (2 x \right )+i \sqrt {3}-2}{\left (i \sqrt {3}-3\right ) \left (\cos \left (2 x \right )+1\right )}}\, \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 (\cos \left (2 x \right )+1\right )}}, \frac {i \sqrt {3}-3}{-1+i \sqrt {3}}, \sqrt {\frac {\left (1+i \sqrt {3}\right ) \left (i \sqrt {3}-3\right )}{\left (i \sqrt {3}+3\right ) \left (-1+i \sqrt {3}\right )}}\right )}{\left (-1+i \sqrt {3}\right ) \sqrt {\left (\cos \left (2 x \right )-1\right ) \left (\cos \left (2 x \right )+1\right ) \left (\cos \left (2 x \right )+2+i \sqrt {3}\right ) \left (-\cos \left (2 x \right )+i \sqrt {3}-2\right )}\, \sqrt {\cos ^{2}\left (2 x \right )+4 \cos \left (2 x \right )+7}\, \sin \left (2 x \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))*(cos(2*x)-1)/(I*3^(1/2)-3)/(cos(
2*x)+1))^(1/2)*(cos(2*x)+1)^2*((cos(2*x)+2+I*3^(1/2))/(I*3^(1/2)+3)/(cos(2*x)+1))^(1/2)*((I*3^(1/2)-cos(2*x)-2
)/(I*3^(1/2)-3)/(cos(2*x)+1))^(1/2)*EllipticPi(((-1+I*3^(1/2))*(cos(2*x)-1)/(I*3^(1/2)-3)/(cos(2*x)+1))^(1/2),
(I*3^(1/2)-3)/(-1+I*3^(1/2)),((1+I*3^(1/2))*(I*3^(1/2)-3)/(I*3^(1/2)+3)/(-1+I*3^(1/2)))^(1/2))/(-1+I*3^(1/2))/
((cos(2*x)-1)*(cos(2*x)+1)*(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.00, size = 0, normalized size = 0.00 \[ \int \frac {\cos \relax (x)^{2}}{\sqrt {\cos \relax (x)^{4} + \cos \relax (x)^{2} + 1}}\,{d x} \]

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)

________________________________________________________________________________________

mupad [F]  time = 0.00, size = -1, normalized size = -0.02 \[ \int \frac {{\cos \relax (x)}^2}{\sqrt {{\cos \relax (x)}^4+{\cos \relax (x)}^2+1}} \,d x \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

sympy [F(-1)]  time = 0.00, size = 0, normalized size = 0.00 \[ \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

________________________________________________________________________________________