3.913 \(\int \sec ^2(x) (1+\sin (x)) \, dx\)

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

[Out]

Sec[x] + Tan[x]

________________________________________________________________________________________

Rubi [A]  time = 0.0231152, antiderivative size = 5, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 3, integrand size = 9, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.333, Rules used = {2669, 3767, 8} \[ \tan (x)+\sec (x) \]

Antiderivative was successfully verified.

[In]

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

[Out]

Sec[x] + Tan[x]

Rule 2669

Int[(cos[(e_.) + (f_.)*(x_)]*(g_.))^(p_)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)]), x_Symbol] :> -Simp[(b*(g*Cos[
e + f*x])^(p + 1))/(f*g*(p + 1)), x] + Dist[a, Int[(g*Cos[e + f*x])^p, x], x] /; FreeQ[{a, b, e, f, g, p}, x]
&& (IntegerQ[2*p] || NeQ[a^2 - b^2, 0])

Rule 3767

Int[csc[(c_.) + (d_.)*(x_)]^(n_), x_Symbol] :> -Dist[d^(-1), Subst[Int[ExpandIntegrand[(1 + x^2)^(n/2 - 1), x]
, x], x, Cot[c + d*x]], x] /; FreeQ[{c, d}, x] && IGtQ[n/2, 0]

Rule 8

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

Rubi steps

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

Mathematica [A]  time = 0.0037442, size = 5, normalized size = 1. \[ \tan (x)+\sec (x) \]

Antiderivative was successfully verified.

[In]

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

[Out]

Sec[x] + Tan[x]

________________________________________________________________________________________

Maple [A]  time = 0.018, size = 8, normalized size = 1.6 \begin{align*} \tan \left ( x \right ) + \left ( \cos \left ( x \right ) \right ) ^{-1} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(sec(x)^2*(1+sin(x)),x)

[Out]

tan(x)+1/cos(x)

________________________________________________________________________________________

Maxima [A]  time = 0.94676, size = 9, normalized size = 1.8 \begin{align*} \frac{1}{\cos \left (x\right )} + \tan \left (x\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

1/cos(x) + tan(x)

________________________________________________________________________________________

Fricas [B]  time = 2.04508, size = 61, normalized size = 12.2 \begin{align*} \frac{\cos \left (x\right ) + \sin \left (x\right ) + 1}{\cos \left (x\right ) - \sin \left (x\right ) + 1} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

(cos(x) + sin(x) + 1)/(cos(x) - sin(x) + 1)

________________________________________________________________________________________

Sympy [A]  time = 5.50021, size = 7, normalized size = 1.4 \begin{align*} \tan{\left (x \right )} + \frac{1}{\cos{\left (x \right )}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

tan(x) + 1/cos(x)

________________________________________________________________________________________

Giac [A]  time = 1.08856, size = 14, normalized size = 2.8 \begin{align*} -\frac{2}{\tan \left (\frac{1}{2} \, x\right ) - 1} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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