3.277 \(\int (\sec (x)+\tan (x)) \, dx\)

Optimal. Leaf size=13 \[ -2 \log \left (\cos \left (\frac{1}{4} (2 x+\pi )\right )\right ) \]

[Out]

-2*Log[Cos[(Pi + 2*x)/4]]

________________________________________________________________________________________

Rubi [A]  time = 0.0056346, antiderivative size = 9, normalized size of antiderivative = 0.69, 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 = {3770, 3475} \[ \tanh ^{-1}(\sin (x))-\log (\cos (x)) \]

Antiderivative was successfully verified.

[In]

Int[Sec[x] + Tan[x],x]

[Out]

ArcTanh[Sin[x]] - Log[Cos[x]]

Rule 3770

Int[csc[(c_.) + (d_.)*(x_)], x_Symbol] :> -Simp[ArcTanh[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 (\sec (x)+\tan (x)) \, dx &=\int \sec (x) \, dx+\int \tan (x) \, dx\\ &=\tanh ^{-1}(\sin (x))-\log (\cos (x))\\ \end{align*}

Mathematica [B]  time = 0.0052144, size = 38, normalized size = 2.92 \[ -\log (\cos (x))-\log \left (\cos \left (\frac{x}{2}\right )-\sin \left (\frac{x}{2}\right )\right )+\log \left (\sin \left (\frac{x}{2}\right )+\cos \left (\frac{x}{2}\right )\right ) \]

Antiderivative was successfully verified.

[In]

Integrate[Sec[x] + Tan[x],x]

[Out]

-Log[Cos[x]] - Log[Cos[x/2] - Sin[x/2]] + Log[Cos[x/2] + Sin[x/2]]

________________________________________________________________________________________

Maple [A]  time = 0.001, size = 13, normalized size = 1. \begin{align*} \ln \left ( \sec \left ( x \right ) +\tan \left ( x \right ) \right ) -\ln \left ( \cos \left ( x \right ) \right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

ln(sec(x)+tan(x))-ln(cos(x))

________________________________________________________________________________________

Maxima [A]  time = 0.967093, size = 14, normalized size = 1.08 \begin{align*} \log \left (\sec \left (x\right ) + \tan \left (x\right )\right ) + \log \left (\sec \left (x\right )\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

log(sec(x) + tan(x)) + log(sec(x))

________________________________________________________________________________________

Fricas [A]  time = 2.05595, size = 26, normalized size = 2. \begin{align*} -\log \left (-\sin \left (x\right ) + 1\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-log(-sin(x) + 1)

________________________________________________________________________________________

Sympy [A]  time = 0.112976, size = 20, normalized size = 1.54 \begin{align*} - \frac{\log{\left (\sin{\left (x \right )} - 1 \right )}}{2} + \frac{\log{\left (\sin{\left (x \right )} + 1 \right )}}{2} - \log{\left (\cos{\left (x \right )} \right )} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-log(sin(x) - 1)/2 + log(sin(x) + 1)/2 - log(cos(x))

________________________________________________________________________________________

Giac [B]  time = 1.17835, size = 42, normalized size = 3.23 \begin{align*} \frac{1}{4} \, \log \left ({\left | \frac{1}{\sin \left (x\right )} + \sin \left (x\right ) + 2 \right |}\right ) - \frac{1}{4} \, \log \left ({\left | \frac{1}{\sin \left (x\right )} + \sin \left (x\right ) - 2 \right |}\right ) - \log \left ({\left | \cos \left (x\right ) \right |}\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

1/4*log(abs(1/sin(x) + sin(x) + 2)) - 1/4*log(abs(1/sin(x) + sin(x) - 2)) - log(abs(cos(x)))