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

   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 = 5, antiderivative size = 13 \[ \int (\sec (x)+\tan (x)) \, dx=-2 \log \left (\cos \left (\frac {1}{4} (\pi +2 x)\right )\right ) \]

[Out]

-2*ln(cos(1/4*Pi+1/2*x))

Rubi [A] (verified)

Time = 0.01 (sec) , antiderivative size = 9, normalized size of antiderivative = 0.69, number of steps used = 3, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.400, Rules used = {3855, 3556} \[ \int (\sec (x)+\tan (x)) \, dx=\text {arctanh}(\sin (x))-\log (\cos (x)) \]

[In]

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

[Out]

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

Rule 3556

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

Rule 3855

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

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

Mathematica [A] (verified)

Time = 0.00 (sec) , antiderivative size = 9, normalized size of antiderivative = 0.69 \[ \int (\sec (x)+\tan (x)) \, dx=\text {arctanh}(\sin (x))-\log (\cos (x)) \]

[In]

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

[Out]

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

Maple [A] (verified)

Time = 0.32 (sec) , antiderivative size = 13, normalized size of antiderivative = 1.00

method result size
default \(\ln \left (\sec \left (x \right )+\tan \left (x \right )\right )-\ln \left (\cos \left (x \right )\right )\) \(13\)
parts \(\ln \left (\sec \left (x \right )+\tan \left (x \right )\right )-\ln \left (\cos \left (x \right )\right )\) \(13\)
norman \(-\ln \left (\tan \left (\frac {x}{2}\right )-1\right )+\frac {\ln \left (1+\tan \left (x \right )^{2}\right )}{2}+\ln \left (\tan \left (\frac {x}{2}\right )+1\right )\) \(27\)
parallelrisch \(-\ln \left (-\cot \left (x \right )+\csc \left (x \right )-1\right )+\ln \left (\sqrt {\sec \left (x \right )^{2}}\right )+\ln \left (\csc \left (x \right )-\cot \left (x \right )+1\right )\) \(29\)
risch \(\ln \left (i+{\mathrm e}^{i x}\right )-\ln \left ({\mathrm e}^{i x}-i\right )+i x -\ln \left ({\mathrm e}^{2 i x}+1\right )\) \(36\)

[In]

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

[Out]

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

Fricas [A] (verification not implemented)

none

Time = 0.24 (sec) , antiderivative size = 9, normalized size of antiderivative = 0.69 \[ \int (\sec (x)+\tan (x)) \, dx=-\log \left (-\sin \left (x\right ) + 1\right ) \]

[In]

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

[Out]

-log(-sin(x) + 1)

Sympy [A] (verification not implemented)

Time = 0.06 (sec) , antiderivative size = 20, normalized size of antiderivative = 1.54 \[ \int (\sec (x)+\tan (x)) \, dx=- \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 )} \]

[In]

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

[Out]

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

Maxima [A] (verification not implemented)

none

Time = 0.23 (sec) , antiderivative size = 10, normalized size of antiderivative = 0.77 \[ \int (\sec (x)+\tan (x)) \, dx=\log \left (\sec \left (x\right ) + \tan \left (x\right )\right ) + \log \left (\sec \left (x\right )\right ) \]

[In]

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

[Out]

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

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 31 vs. \(2 (11) = 22\).

Time = 0.27 (sec) , antiderivative size = 31, normalized size of antiderivative = 2.38 \[ \int (\sec (x)+\tan (x)) \, dx=\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 ) \]

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

Mupad [B] (verification not implemented)

Time = 30.08 (sec) , antiderivative size = 19, normalized size of antiderivative = 1.46 \[ \int (\sec (x)+\tan (x)) \, dx=\ln \left ({\mathrm {tan}\left (\frac {x}{2}\right )}^2+1\right )-2\,\ln \left (\mathrm {tan}\left (\frac {x}{2}\right )-1\right ) \]

[In]

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

[Out]

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