3.344 \(\int (\sin (x)+\tan (x)) \, dx\)

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

[Out]

-Cos[x] - Log[Cos[x]]

________________________________________________________________________________________

Rubi [A]  time = 0.0049923, antiderivative size = 10, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 2, integrand size = 5, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.4, Rules used = {2638, 3475} \[ -\cos (x)-\log (\cos (x)) \]

Antiderivative was successfully verified.

[In]

Int[Sin[x] + Tan[x],x]

[Out]

-Cos[x] - Log[Cos[x]]

Rule 2638

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

Rule 3475

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

Rubi steps

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

Mathematica [A]  time = 0.0029032, size = 10, normalized size = 1. \[ -\cos (x)-\log (\cos (x)) \]

Antiderivative was successfully verified.

[In]

Integrate[Sin[x] + Tan[x],x]

[Out]

-Cos[x] - Log[Cos[x]]

________________________________________________________________________________________

Maple [A]  time = 0.002, size = 11, normalized size = 1.1 \begin{align*} -\cos \left ( x \right ) -\ln \left ( \cos \left ( x \right ) \right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(sin(x)+tan(x),x)

[Out]

-cos(x)-ln(cos(x))

________________________________________________________________________________________

Maxima [A]  time = 0.982502, size = 11, normalized size = 1.1 \begin{align*} -\cos \left (x\right ) + \log \left (\sec \left (x\right )\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sin(x)+tan(x),x, algorithm="maxima")

[Out]

-cos(x) + log(sec(x))

________________________________________________________________________________________

Fricas [A]  time = 2.26663, size = 32, normalized size = 3.2 \begin{align*} -\cos \left (x\right ) - \log \left (-\cos \left (x\right )\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sin(x)+tan(x),x, algorithm="fricas")

[Out]

-cos(x) - log(-cos(x))

________________________________________________________________________________________

Sympy [A]  time = 0.065387, size = 8, normalized size = 0.8 \begin{align*} - \log{\left (\cos{\left (x \right )} \right )} - \cos{\left (x \right )} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sin(x)+tan(x),x)

[Out]

-log(cos(x)) - cos(x)

________________________________________________________________________________________

Giac [A]  time = 1.12834, size = 15, normalized size = 1.5 \begin{align*} -\cos \left (x\right ) - \log \left ({\left | \cos \left (x\right ) \right |}\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sin(x)+tan(x),x, algorithm="giac")

[Out]

-cos(x) - log(abs(cos(x)))