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

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

[Out]

x+tan(x)

________________________________________________________________________________________

Rubi [A]  time = 0.06, antiderivative size = 4, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 3, integrand size = 19, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.158, Rules used = {3657, 3473, 8} \[ x+\tan (x) \]

Antiderivative was successfully verified.

[In]

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

[Out]

x + Tan[x]

Rule 8

Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]

Rule 3473

Int[((b_.)*tan[(c_.) + (d_.)*(x_)])^(n_), x_Symbol] :> Simp[(b*(b*Tan[c + d*x])^(n - 1))/(d*(n - 1)), x] - Dis
t[b^2, Int[(b*Tan[c + d*x])^(n - 2), x], x] /; FreeQ[{b, c, d}, x] && GtQ[n, 1]

Rule 3657

Int[(u_.)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)]^2)^(p_), x_Symbol] :> Int[ActivateTrig[u*(a*sec[e + f*x]^2)^p]
, x] /; FreeQ[{a, b, e, f, p}, x] && EqQ[a, b]

Rubi steps

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

________________________________________________________________________________________

Mathematica [A]  time = 0.00, size = 4, normalized size = 1.00 \[ x+\tan (x) \]

Antiderivative was successfully verified.

[In]

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

[Out]

x + Tan[x]

________________________________________________________________________________________

fricas [B]  time = 0.89, size = 12, normalized size = 3.00 \[ \frac {x \cos \relax (x) + \sin \relax (x)}{\cos \relax (x)} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

giac [A]  time = 0.12, size = 4, normalized size = 1.00 \[ x + \tan \relax (x) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

x + tan(x)

________________________________________________________________________________________

maple [A]  time = 0.11, size = 5, normalized size = 1.25 \[ x +\tan \relax (x ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

x+tan(x)

________________________________________________________________________________________

maxima [A]  time = 0.50, size = 4, normalized size = 1.00 \[ x + \tan \relax (x) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

x + tan(x)

________________________________________________________________________________________

mupad [B]  time = 3.00, size = 4, normalized size = 1.00 \[ x+\mathrm {tan}\relax (x) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

x + tan(x)

________________________________________________________________________________________

sympy [B]  time = 0.74, size = 27, normalized size = 6.75 \[ \frac {x \sec ^{2}{\relax (x )}}{\tan ^{2}{\relax (x )} + 1} + \frac {\tan {\relax (x )} \sec ^{2}{\relax (x )}}{\tan ^{2}{\relax (x )} + 1} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________