3.694 \(\int \sec ^2(x) (1+\frac{1}{1+\tan ^2(x)}) \, dx\)

Optimal. Leaf size=4 \[ x+\tan (x) \]

[Out]

x + Tan[x]

________________________________________________________________________________________

Rubi [A]  time = 0.0426197, antiderivative size = 4, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 1, integrand size = 15, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.067, Rules used = {203} \[ x+\tan (x) \]

Antiderivative was successfully verified.

[In]

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

[Out]

x + Tan[x]

Rule 203

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

Rubi steps

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

Mathematica [A]  time = 0.0063568, size = 4, normalized size = 1. \[ x+\tan (x) \]

Antiderivative was successfully verified.

[In]

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

[Out]

x + Tan[x]

________________________________________________________________________________________

Maple [A]  time = 0.046, size = 5, normalized size = 1.3 \begin{align*} x+\tan \left ( x \right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(sec(x)^2*(1+1/(1+tan(x)^2)),x)

[Out]

x+tan(x)

________________________________________________________________________________________

Maxima [A]  time = 1.45915, size = 5, normalized size = 1.25 \begin{align*} x + \tan \left (x\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

x + tan(x)

________________________________________________________________________________________

Fricas [B]  time = 2.02879, size = 38, normalized size = 9.5 \begin{align*} \frac{x \cos \left (x\right ) + \sin \left (x\right )}{\cos \left (x\right )} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Sympy [B]  time = 0.930394, size = 27, normalized size = 6.75 \begin{align*} \frac{x \sec ^{2}{\left (x \right )}}{\tan ^{2}{\left (x \right )} + 1} + \frac{\tan{\left (x \right )} \sec ^{2}{\left (x \right )}}{\tan ^{2}{\left (x \right )} + 1} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Giac [A]  time = 1.1106, size = 5, normalized size = 1.25 \begin{align*} x + \tan \left (x\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

x + tan(x)