3.815 \(\int \cos (x) (\sec (x)+\tan (x)) \, dx\)

Optimal. Leaf size=6 \[ x-\cos (x) \]

[Out]

x - Cos[x]

________________________________________________________________________________________

Rubi [A]  time = 0.0106472, antiderivative size = 6, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 2, integrand size = 8, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.25, Rules used = {3161, 2638} \[ x-\cos (x) \]

Antiderivative was successfully verified.

[In]

Int[Cos[x]*(Sec[x] + Tan[x]),x]

[Out]

x - Cos[x]

Rule 3161

Int[cos[(d_.) + (e_.)*(x_)]^(n_.)*((a_.) + (b_.)*sec[(d_.) + (e_.)*(x_)] + (c_.)*tan[(d_.) + (e_.)*(x_)])^(n_.
), x_Symbol] :> Int[(b + a*Cos[d + e*x] + c*Sin[d + e*x])^n, x] /; FreeQ[{a, b, c, d, e}, x] && IntegerQ[n]

Rule 2638

Int[sin[(c_.) + (d_.)*(x_)], x_Symbol] :> -Simp[Cos[c + d*x]/d, x] /; FreeQ[{c, d}, x]

Rubi steps

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

Mathematica [A]  time = 0.0015746, size = 6, normalized size = 1. \[ x-\cos (x) \]

Antiderivative was successfully verified.

[In]

Integrate[Cos[x]*(Sec[x] + Tan[x]),x]

[Out]

x - Cos[x]

________________________________________________________________________________________

Maple [A]  time = 0.031, size = 7, normalized size = 1.2 \begin{align*} x-\cos \left ( x \right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cos(x)*(sec(x)+tan(x)),x)

[Out]

x-cos(x)

________________________________________________________________________________________

Maxima [A]  time = 0.952995, size = 8, normalized size = 1.33 \begin{align*} x - \cos \left (x\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(x)*(sec(x)+tan(x)),x, algorithm="maxima")

[Out]

x - cos(x)

________________________________________________________________________________________

Fricas [A]  time = 2.31247, size = 16, normalized size = 2.67 \begin{align*} x - \cos \left (x\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(x)*(sec(x)+tan(x)),x, algorithm="fricas")

[Out]

x - cos(x)

________________________________________________________________________________________

Sympy [A]  time = 1.80056, size = 3, normalized size = 0.5 \begin{align*} x - \cos{\left (x \right )} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(x)*(sec(x)+tan(x)),x)

[Out]

x - cos(x)

________________________________________________________________________________________

Giac [B]  time = 1.11234, size = 19, normalized size = 3.17 \begin{align*} x - \frac{2}{\tan \left (\frac{1}{2} \, x\right )^{2} + 1} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(x)*(sec(x)+tan(x)),x, algorithm="giac")

[Out]

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