\(\int \sec (x) \, dx\) [81]

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

Optimal result

Integrand size = 2, antiderivative size = 3 \[ \int \sec (x) \, dx=\text {arctanh}(\sin (x)) \]

[Out]

arctanh(sin(x))

Rubi [A] (verified)

Time = 0.00 (sec) , antiderivative size = 3, normalized size of antiderivative = 1.00, number of steps used = 1, number of rules used = 1, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.500, Rules used = {3855} \[ \int \sec (x) \, dx=\text {arctanh}(\sin (x)) \]

[In]

Int[Sec[x],x]

[Out]

ArcTanh[Sin[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}& = \text {arctanh}(\sin (x)) \\ \end{align*}

Mathematica [A] (verified)

Time = 0.00 (sec) , antiderivative size = 3, normalized size of antiderivative = 1.00 \[ \int \sec (x) \, dx=\text {arctanh}(\sin (x)) \]

[In]

Integrate[Sec[x],x]

[Out]

ArcTanh[Sin[x]]

Maple [A] (verified)

Time = 0.12 (sec) , antiderivative size = 7, normalized size of antiderivative = 2.33

method result size
default \(\ln \left (\sec \left (x \right )+\tan \left (x \right )\right )\) \(7\)
norman \(-\ln \left (\tan \left (\frac {x}{2}\right )-1\right )+\ln \left (1+\tan \left (\frac {x}{2}\right )\right )\) \(18\)
parallelrisch \(-\ln \left (\tan \left (\frac {x}{2}\right )-1\right )+\ln \left (1+\tan \left (\frac {x}{2}\right )\right )\) \(18\)
risch \(\ln \left (i+{\mathrm e}^{i x}\right )-\ln \left ({\mathrm e}^{i x}-i\right )\) \(22\)

[In]

int(1/cos(x),x,method=_RETURNVERBOSE)

[Out]

ln(sec(x)+tan(x))

Fricas [B] (verification not implemented)

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

Time = 0.25 (sec) , antiderivative size = 17, normalized size of antiderivative = 5.67 \[ \int \sec (x) \, dx=\frac {1}{2} \, \log \left (\sin \left (x\right ) + 1\right ) - \frac {1}{2} \, \log \left (-\sin \left (x\right ) + 1\right ) \]

[In]

integrate(1/cos(x),x, algorithm="fricas")

[Out]

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

Sympy [B] (verification not implemented)

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

Time = 0.07 (sec) , antiderivative size = 15, normalized size of antiderivative = 5.00 \[ \int \sec (x) \, dx=- \frac {\log {\left (\sin {\left (x \right )} - 1 \right )}}{2} + \frac {\log {\left (\sin {\left (x \right )} + 1 \right )}}{2} \]

[In]

integrate(1/cos(x),x)

[Out]

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

Maxima [B] (verification not implemented)

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

Time = 0.17 (sec) , antiderivative size = 15, normalized size of antiderivative = 5.00 \[ \int \sec (x) \, dx=\frac {1}{2} \, \log \left (\sin \left (x\right ) + 1\right ) - \frac {1}{2} \, \log \left (\sin \left (x\right ) - 1\right ) \]

[In]

integrate(1/cos(x),x, algorithm="maxima")

[Out]

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

Giac [B] (verification not implemented)

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

Time = 0.28 (sec) , antiderivative size = 17, normalized size of antiderivative = 5.67 \[ \int \sec (x) \, dx=\frac {1}{2} \, \log \left (\sin \left (x\right ) + 1\right ) - \frac {1}{2} \, \log \left (-\sin \left (x\right ) + 1\right ) \]

[In]

integrate(1/cos(x),x, algorithm="giac")

[Out]

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

Mupad [B] (verification not implemented)

Time = 0.13 (sec) , antiderivative size = 11, normalized size of antiderivative = 3.67 \[ \int \sec (x) \, dx=\ln \left (\frac {1}{\cos \left (x\right )}\right )+\ln \left (\sin \left (x\right )+1\right ) \]

[In]

int(1/cos(x),x)

[Out]

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