3.8 \(\int \frac{2}{1+\cos ^2(x)} \, dx\)

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

[Out]

Sqrt[2]*x - Sqrt[2]*ArcTan[(Cos[x]*Sin[x])/(1 + Sqrt[2] + Cos[x]^2)]

_______________________________________________________________________________________

Rubi [A]  time = 0.0326872, antiderivative size = 34, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 3, integrand size = 10, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.3 \[ \sqrt{2} x-\sqrt{2} \tan ^{-1}\left (\frac{\sin (x) \cos (x)}{\cos ^2(x)+\sqrt{2}+1}\right ) \]

Antiderivative was successfully verified.

[In]  Int[2/(1 + Cos[x]^2),x]

[Out]

Sqrt[2]*x - Sqrt[2]*ArcTan[(Cos[x]*Sin[x])/(1 + Sqrt[2] + Cos[x]^2)]

_______________________________________________________________________________________

Rubi in Sympy [A]  time = 0.926085, size = 15, normalized size = 0.44 \[ \sqrt{2} \operatorname{atan}{\left (\frac{\sqrt{2} \tan{\left (x \right )}}{2} \right )} \]

Verification of antiderivative is not currently implemented for this CAS.

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

[Out]

sqrt(2)*atan(sqrt(2)*tan(x)/2)

_______________________________________________________________________________________

Mathematica [A]  time = 0.0159547, size = 15, normalized size = 0.44 \[ \sqrt{2} \tan ^{-1}\left (\frac{\tan (x)}{\sqrt{2}}\right ) \]

Antiderivative was successfully verified.

[In]  Integrate[2/(1 + Cos[x]^2),x]

[Out]

Sqrt[2]*ArcTan[Tan[x]/Sqrt[2]]

_______________________________________________________________________________________

Maple [A]  time = 0.019, size = 13, normalized size = 0.4 \[ \sqrt{2}\arctan \left ({\frac{\tan \left ( x \right ) \sqrt{2}}{2}} \right ) \]

Verification of antiderivative is not currently implemented for this CAS.

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

[Out]

2^(1/2)*arctan(1/2*tan(x)*2^(1/2))

_______________________________________________________________________________________

Maxima [A]  time = 1.50807, size = 16, normalized size = 0.47 \[ \sqrt{2} \arctan \left (\frac{1}{2} \, \sqrt{2} \tan \left (x\right )\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

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

[Out]

sqrt(2)*arctan(1/2*sqrt(2)*tan(x))

_______________________________________________________________________________________

Fricas [A]  time = 0.232637, size = 36, normalized size = 1.06 \[ -\frac{1}{2} \, \sqrt{2} \arctan \left (\frac{\sqrt{2}{\left (3 \, \cos \left (x\right )^{2} - 1\right )}}{4 \, \cos \left (x\right ) \sin \left (x\right )}\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

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

[Out]

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

_______________________________________________________________________________________

Sympy [A]  time = 1.55694, size = 60, normalized size = 1.76 \[ \sqrt{2} \left (\operatorname{atan}{\left (\sqrt{2} \tan{\left (\frac{x}{2} \right )} - 1 \right )} + \pi \lfloor{\frac{\frac{x}{2} - \frac{\pi }{2}}{\pi }}\rfloor \right ) + \sqrt{2} \left (\operatorname{atan}{\left (\sqrt{2} \tan{\left (\frac{x}{2} \right )} + 1 \right )} + \pi \lfloor{\frac{\frac{x}{2} - \frac{\pi }{2}}{\pi }}\rfloor \right ) \]

Verification of antiderivative is not currently implemented for this CAS.

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

[Out]

sqrt(2)*(atan(sqrt(2)*tan(x/2) - 1) + pi*floor((x/2 - pi/2)/pi)) + sqrt(2)*(atan
(sqrt(2)*tan(x/2) + 1) + pi*floor((x/2 - pi/2)/pi))

_______________________________________________________________________________________

GIAC/XCAS [A]  time = 0.199924, size = 61, normalized size = 1.79 \[ \sqrt{2}{\left (x + \arctan \left (-\frac{\sqrt{2} \sin \left (2 \, x\right ) - \sin \left (2 \, x\right )}{\sqrt{2} \cos \left (2 \, x\right ) + \sqrt{2} - \cos \left (2 \, x\right ) + 1}\right )\right )} \]

Verification of antiderivative is not currently implemented for this CAS.

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

[Out]

sqrt(2)*(x + arctan(-(sqrt(2)*sin(2*x) - sin(2*x))/(sqrt(2)*cos(2*x) + sqrt(2) -
 cos(2*x) + 1)))