\(\int \cos (x) (\sec (x)+\tan (x)) \, dx\) [815]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [A] (verification not implemented)
   Maxima [A] (verification not implemented)
   Giac [B] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 8, antiderivative size = 6 \[ \int \cos (x) (\sec (x)+\tan (x)) \, dx=x-\cos (x) \]

[Out]

x-cos(x)

Rubi [A] (verified)

Time = 0.01 (sec) , antiderivative size = 6, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.250, Rules used = {3240, 2718} \[ \int \cos (x) (\sec (x)+\tan (x)) \, dx=x-\cos (x) \]

[In]

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

[Out]

x - Cos[x]

Rule 2718

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

Rule 3240

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]

Rubi steps \begin{align*} \text {integral}& = \int (1+\sin (x)) \, dx \\ & = x+\int \sin (x) \, dx \\ & = x-\cos (x) \\ \end{align*}

Mathematica [A] (verified)

Time = 0.00 (sec) , antiderivative size = 6, normalized size of antiderivative = 1.00 \[ \int \cos (x) (\sec (x)+\tan (x)) \, dx=x-\cos (x) \]

[In]

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

[Out]

x - Cos[x]

Maple [A] (verified)

Time = 1.20 (sec) , antiderivative size = 7, normalized size of antiderivative = 1.17

method result size
default \(x -\cos \left (x \right )\) \(7\)
risch \(x -\cos \left (x \right )\) \(7\)

[In]

int(cos(x)*(sec(x)+tan(x)),x,method=_RETURNVERBOSE)

[Out]

x-cos(x)

Fricas [A] (verification not implemented)

none

Time = 0.24 (sec) , antiderivative size = 6, normalized size of antiderivative = 1.00 \[ \int \cos (x) (\sec (x)+\tan (x)) \, dx=x - \cos \left (x\right ) \]

[In]

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

[Out]

x - cos(x)

Sympy [A] (verification not implemented)

Time = 0.50 (sec) , antiderivative size = 3, normalized size of antiderivative = 0.50 \[ \int \cos (x) (\sec (x)+\tan (x)) \, dx=x - \cos {\left (x \right )} \]

[In]

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

[Out]

x - cos(x)

Maxima [A] (verification not implemented)

none

Time = 0.21 (sec) , antiderivative size = 6, normalized size of antiderivative = 1.00 \[ \int \cos (x) (\sec (x)+\tan (x)) \, dx=x - \cos \left (x\right ) \]

[In]

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

[Out]

x - cos(x)

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 14 vs. \(2 (6) = 12\).

Time = 0.27 (sec) , antiderivative size = 14, normalized size of antiderivative = 2.33 \[ \int \cos (x) (\sec (x)+\tan (x)) \, dx=x - \frac {2}{\tan \left (\frac {1}{2} \, x\right )^{2} + 1} \]

[In]

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

[Out]

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

Mupad [B] (verification not implemented)

Time = 26.60 (sec) , antiderivative size = 6, normalized size of antiderivative = 1.00 \[ \int \cos (x) (\sec (x)+\tan (x)) \, dx=x-\cos \left (x\right ) \]

[In]

int(cos(x)*(tan(x) + 1/cos(x)),x)

[Out]

x - cos(x)