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

Optimal. Leaf size=8 \[ -x-2 \cot (x) \]

[Out]

-x - 2*Cot[x]

_______________________________________________________________________________________

Rubi [A]  time = 0.0578814, antiderivative size = 8, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 4, integrand size = 17, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.235 \[ -x-2 \cot (x) \]

Antiderivative was successfully verified.

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

[Out]

-x - 2*Cot[x]

_______________________________________________________________________________________

Rubi in Sympy [F]  time = 0., size = 0, normalized size = 0. \[ \int \frac{\cos ^{2}{\left (x \right )} + 1}{\sin ^{2}{\left (x \right )}}\, dx \]

Verification of antiderivative is not currently implemented for this CAS.

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

[Out]

Integral((cos(x)**2 + 1)/sin(x)**2, x)

_______________________________________________________________________________________

Mathematica [A]  time = 0.0130457, size = 8, normalized size = 1. \[ -x-2 \cot (x) \]

Antiderivative was successfully verified.

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

[Out]

-x - 2*Cot[x]

_______________________________________________________________________________________

Maple [A]  time = 0.062, size = 11, normalized size = 1.4 \[ -2\, \left ( \tan \left ( x \right ) \right ) ^{-1}-x \]

Verification of antiderivative is not currently implemented for this CAS.

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

[Out]

-2/tan(x)-x

_______________________________________________________________________________________

Maxima [A]  time = 1.51114, size = 14, normalized size = 1.75 \[ -x - \frac{2}{\tan \left (x\right )} \]

Verification of antiderivative is not currently implemented for this CAS.

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

[Out]

-x - 2/tan(x)

_______________________________________________________________________________________

Fricas [A]  time = 0.21793, size = 20, normalized size = 2.5 \[ -\frac{x \sin \left (x\right ) + 2 \, \cos \left (x\right )}{\sin \left (x\right )} \]

Verification of antiderivative is not currently implemented for this CAS.

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

[Out]

-(x*sin(x) + 2*cos(x))/sin(x)

_______________________________________________________________________________________

Sympy [A]  time = 2.37255, size = 12, normalized size = 1.5 \[ - x + \tan{\left (\frac{x}{2} \right )} - \frac{1}{\tan{\left (\frac{x}{2} \right )}} \]

Verification of antiderivative is not currently implemented for this CAS.

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

[Out]

-x + tan(x/2) - 1/tan(x/2)

_______________________________________________________________________________________

GIAC/XCAS [A]  time = 0.225478, size = 22, normalized size = 2.75 \[ -x - \frac{1}{\tan \left (\frac{1}{2} \, x\right )} + \tan \left (\frac{1}{2} \, x\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

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

[Out]

-x - 1/tan(1/2*x) + tan(1/2*x)