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.02, antiderivative size = 5, normalized size of antiderivative = 1.00, 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 8

Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, 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]

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.00, size = 5, normalized size = 1.00 \[ \tan (x)+\sec (x) \]

Antiderivative was successfully verified.

[In]

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

[Out]

Sec[x] + Tan[x]

________________________________________________________________________________________

fricas [B]  time = 0.85, size = 17, normalized size = 3.40 \[ \frac {\cos \relax (x) + \sin \relax (x) + 1}{\cos \relax (x) - \sin \relax (x) + 1} \]

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)

________________________________________________________________________________________

giac [A]  time = 0.13, size = 10, normalized size = 2.00 \[ -\frac {2}{\tan \left (\frac {1}{2} \, x\right ) - 1} \]

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)

________________________________________________________________________________________

maple [A]  time = 0.06, size = 8, normalized size = 1.60 \[ \tan \relax (x )+\frac {1}{\cos \relax (x )} \]

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.32, size = 7, normalized size = 1.40 \[ \frac {1}{\cos \relax (x)} + \tan \relax (x) \]

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)

________________________________________________________________________________________

mupad [B]  time = 2.97, size = 10, normalized size = 2.00 \[ -\frac {2}{\mathrm {tan}\left (\frac {x}{2}\right )-1} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((sin(x) + 1)/cos(x)^2,x)

[Out]

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

________________________________________________________________________________________

sympy [A]  time = 2.18, size = 7, normalized size = 1.40 \[ \tan {\relax (x )} + \frac {1}{\cos {\relax (x )}} \]

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)

________________________________________________________________________________________