3.707 \(\int (1+\cos ^2(x)) \sec ^2(x) \, dx\)

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

[Out]

x + Tan[x]

________________________________________________________________________________________

Rubi [A]  time = 0.0182728, antiderivative size = 4, normalized size of antiderivative = 1., number of steps used = 2, number of rules used = 2, integrand size = 11, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.182, Rules used = {3012, 8} \[ x+\tan (x) \]

Antiderivative was successfully verified.

[In]

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

[Out]

x + Tan[x]

Rule 3012

Int[((b_.)*sin[(e_.) + (f_.)*(x_)])^(m_)*((A_) + (C_.)*sin[(e_.) + (f_.)*(x_)]^2), x_Symbol] :> Simp[(A*Cos[e
+ f*x]*(b*Sin[e + f*x])^(m + 1))/(b*f*(m + 1)), x] + Dist[(A*(m + 2) + C*(m + 1))/(b^2*(m + 1)), Int[(b*Sin[e
+ f*x])^(m + 2), x], x] /; FreeQ[{b, e, f, A, C}, x] && LtQ[m, -1]

Rule 8

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

Rubi steps

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

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

Antiderivative was successfully verified.

[In]

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

[Out]

x + Tan[x]

________________________________________________________________________________________

Maple [A]  time = 0.032, 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((1+cos(x)^2)*sec(x)^2,x)

[Out]

x+tan(x)

________________________________________________________________________________________

Maxima [A]  time = 1.46473, 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((1+cos(x)^2)*sec(x)^2,x, algorithm="maxima")

[Out]

x + tan(x)

________________________________________________________________________________________

Fricas [B]  time = 1.95409, 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((1+cos(x)^2)*sec(x)^2,x, algorithm="fricas")

[Out]

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

________________________________________________________________________________________

Sympy [A]  time = 23.6743, size = 3, normalized size = 0.75 \begin{align*} x + \tan{\left (x \right )} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((1+cos(x)**2)*sec(x)**2,x)

[Out]

x + tan(x)

________________________________________________________________________________________

Giac [B]  time = 1.12031, size = 20, normalized size = 5. \begin{align*} -\pi \left \lfloor \frac{x}{\pi } + \frac{1}{2} \right \rfloor + x + \tan \left (x\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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