3.816 \(\int \cos (x) (\sec ^3(x)+\tan (x)) \, dx\)

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

[Out]

-Cos[x] + Tan[x]

________________________________________________________________________________________

Rubi [A]  time = 0.0376473, antiderivative size = 7, normalized size of antiderivative = 1., number of steps used = 5, number of rules used = 4, integrand size = 10, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.4, Rules used = {4401, 3767, 8, 2638} \[ \tan (x)-\cos (x) \]

Antiderivative was successfully verified.

[In]

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

[Out]

-Cos[x] + Tan[x]

Rule 4401

Int[u_, x_Symbol] :> With[{v = ExpandTrig[u, x]}, Int[v, x] /; SumQ[v]] /;  !InertTrigFreeQ[u]

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]

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) \left (\sec ^3(x)+\tan (x)\right ) \, dx &=\int \left (\sec ^2(x)+\sin (x)\right ) \, dx\\ &=\int \sec ^2(x) \, dx+\int \sin (x) \, dx\\ &=-\cos (x)-\operatorname{Subst}(\int 1 \, dx,x,-\tan (x))\\ &=-\cos (x)+\tan (x)\\ \end{align*}

Mathematica [A]  time = 0.0036795, size = 7, normalized size = 1. \[ \tan (x)-\cos (x) \]

Antiderivative was successfully verified.

[In]

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

[Out]

-Cos[x] + Tan[x]

________________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-cos(x)+tan(x)

________________________________________________________________________________________

Maxima [A]  time = 0.959994, size = 9, normalized size = 1.29 \begin{align*} -\cos \left (x\right ) + \tan \left (x\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-cos(x) + tan(x)

________________________________________________________________________________________

Fricas [B]  time = 2.36697, size = 39, normalized size = 5.57 \begin{align*} -\frac{\cos \left (x\right )^{2} - \sin \left (x\right )}{\cos \left (x\right )} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-(cos(x)^2 - sin(x))/cos(x)

________________________________________________________________________________________

Sympy [A]  time = 23.3179, size = 8, normalized size = 1.14 \begin{align*} \frac{\sin{\left (x \right )}}{\cos{\left (x \right )}} - \cos{\left (x \right )} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

sin(x)/cos(x) - cos(x)

________________________________________________________________________________________

Giac [B]  time = 1.0972, size = 41, normalized size = 5.86 \begin{align*} -\frac{2 \,{\left (\tan \left (\frac{1}{2} \, x\right )^{3} + \tan \left (\frac{1}{2} \, x\right )^{2} + \tan \left (\frac{1}{2} \, x\right ) - 1\right )}}{\tan \left (\frac{1}{2} \, x\right )^{4} - 1} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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