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*ln(cos(1/4*Pi+1/2*x))

________________________________________________________________________________________

Rubi [A]  time = 0.01, 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.400, 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 3475

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

Rule 3770

Int[csc[(c_.) + (d_.)*(x_)], x_Symbol] :> -Simp[ArcTanh[Cos[c + d*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.00, 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]]

________________________________________________________________________________________

fricas [A]  time = 3.01, size = 9, normalized size = 0.69 \[ -\log \left (-\sin \relax (x) + 1\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-log(-sin(x) + 1)

________________________________________________________________________________________

giac [B]  time = 0.15, size = 31, normalized size = 2.38 \[ \frac {1}{4} \, \log \left ({\left | \frac {1}{\sin \relax (x)} + \sin \relax (x) + 2 \right |}\right ) - \frac {1}{4} \, \log \left ({\left | \frac {1}{\sin \relax (x)} + \sin \relax (x) - 2 \right |}\right ) - \log \left ({\left | \cos \relax (x) \right |}\right ) \]

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)))

________________________________________________________________________________________

maple [A]  time = 0.00, size = 13, normalized size = 1.00 \[ \ln \left (\sec \relax (x )+\tan \relax (x )\right )-\ln \left (\cos \relax (x )\right ) \]

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.31, size = 10, normalized size = 0.77 \[ \log \left (\sec \relax (x) + \tan \relax (x)\right ) + \log \left (\sec \relax (x)\right ) \]

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))

________________________________________________________________________________________

mupad [B]  time = 2.40, size = 19, normalized size = 1.46 \[ \ln \left ({\mathrm {tan}\left (\frac {x}{2}\right )}^2+1\right )-2\,\ln \left (\mathrm {tan}\left (\frac {x}{2}\right )-1\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

sympy [A]  time = 0.09, size = 20, normalized size = 1.54 \[ - \frac {\log {\left (\sin {\relax (x )} - 1 \right )}}{2} + \frac {\log {\left (\sin {\relax (x )} + 1 \right )}}{2} - \log {\left (\cos {\relax (x )} \right )} \]

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))

________________________________________________________________________________________