3.691 \(\int \frac{\sec ^2(x)}{1-\tan ^2(x)} \, dx\)

Optimal. Leaf size=11 \[ \frac{1}{2} \tanh ^{-1}(2 \sin (x) \cos (x)) \]

[Out]

ArcTanh[2*Cos[x]*Sin[x]]/2

________________________________________________________________________________________

Rubi [A]  time = 0.0307602, antiderivative size = 11, normalized size of antiderivative = 1., number of steps used = 2, number of rules used = 2, integrand size = 15, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.133, Rules used = {3675, 206} \[ \frac{1}{2} \tanh ^{-1}(2 \sin (x) \cos (x)) \]

Antiderivative was successfully verified.

[In]

Int[Sec[x]^2/(1 - Tan[x]^2),x]

[Out]

ArcTanh[2*Cos[x]*Sin[x]]/2

Rule 3675

Int[sec[(e_.) + (f_.)*(x_)]^(m_)*((a_) + (b_.)*((c_.)*tan[(e_.) + (f_.)*(x_)])^(n_))^(p_.), x_Symbol] :> With[
{ff = FreeFactors[Tan[e + f*x], x]}, Dist[ff/(c^(m - 1)*f), Subst[Int[(c^2 + ff^2*x^2)^(m/2 - 1)*(a + b*(ff*x)
^n)^p, x], x, (c*Tan[e + f*x])/ff], x]] /; FreeQ[{a, b, c, e, f, n, p}, x] && IntegerQ[m/2] && (IntegersQ[n, p
] || IGtQ[m, 0] || IGtQ[p, 0] || EqQ[n^2, 4] || EqQ[n^2, 16])

Rule 206

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1*ArcTanh[(Rt[-b, 2]*x)/Rt[a, 2]])/(Rt[a, 2]*Rt[-b, 2]), x]
 /; FreeQ[{a, b}, x] && NegQ[a/b] && (GtQ[a, 0] || LtQ[b, 0])

Rubi steps

\begin{align*} \int \frac{\sec ^2(x)}{1-\tan ^2(x)} \, dx &=\operatorname{Subst}\left (\int \frac{1}{1-x^2} \, dx,x,\tan (x)\right )\\ &=\frac{1}{2} \tanh ^{-1}(2 \cos (x) \sin (x))\\ \end{align*}

Mathematica [B]  time = 0.005647, size = 23, normalized size = 2.09 \[ \frac{1}{2} \log (\sin (x)+\cos (x))-\frac{1}{2} \log (\cos (x)-\sin (x)) \]

Antiderivative was successfully verified.

[In]

Integrate[Sec[x]^2/(1 - Tan[x]^2),x]

[Out]

-Log[Cos[x] - Sin[x]]/2 + Log[Cos[x] + Sin[x]]/2

________________________________________________________________________________________

Maple [A]  time = 0.029, size = 4, normalized size = 0.4 \begin{align*}{\it Artanh} \left ( \tan \left ( x \right ) \right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(sec(x)^2/(1-tan(x)^2),x)

[Out]

arctanh(tan(x))

________________________________________________________________________________________

Maxima [A]  time = 0.955928, size = 20, normalized size = 1.82 \begin{align*} \frac{1}{2} \, \log \left (\tan \left (x\right ) + 1\right ) - \frac{1}{2} \, \log \left (\tan \left (x\right ) - 1\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(x)^2/(1-tan(x)^2),x, algorithm="maxima")

[Out]

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

________________________________________________________________________________________

Fricas [B]  time = 2.05936, size = 84, normalized size = 7.64 \begin{align*} \frac{1}{4} \, \log \left (2 \, \cos \left (x\right ) \sin \left (x\right ) + 1\right ) - \frac{1}{4} \, \log \left (-2 \, \cos \left (x\right ) \sin \left (x\right ) + 1\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(x)^2/(1-tan(x)^2),x, algorithm="fricas")

[Out]

1/4*log(2*cos(x)*sin(x) + 1) - 1/4*log(-2*cos(x)*sin(x) + 1)

________________________________________________________________________________________

Sympy [F]  time = 0., size = 0, normalized size = 0. \begin{align*} - \int \frac{\sec ^{2}{\left (x \right )}}{\tan ^{2}{\left (x \right )} - 1}\, dx \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(x)**2/(1-tan(x)**2),x)

[Out]

-Integral(sec(x)**2/(tan(x)**2 - 1), x)

________________________________________________________________________________________

Giac [A]  time = 1.11568, size = 23, normalized size = 2.09 \begin{align*} \frac{1}{2} \, \log \left ({\left | \tan \left (x\right ) + 1 \right |}\right ) - \frac{1}{2} \, \log \left ({\left | \tan \left (x\right ) - 1 \right |}\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(x)^2/(1-tan(x)^2),x, algorithm="giac")

[Out]

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