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

Optimal. Leaf size=3 \[ \tanh ^{-1}(\sin (x)) \]

[Out]

arctanh(sin(x))

________________________________________________________________________________________

Rubi [A]
time = 0.00, antiderivative size = 3, normalized size of antiderivative = 1.00, number of steps used = 1, number of rules used = 1, integrand size = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.500, Rules used = {3855} \begin {gather*} \tanh ^{-1}(\sin (x)) \end {gather*}

Antiderivative was successfully verified.

[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*} \int \sec (x) \, dx &=\tanh ^{-1}(\sin (x))\\ \end {align*}

________________________________________________________________________________________

Mathematica [B] Leaf count is larger than twice the leaf count of optimal. \(33\) vs. \(2(3)=6\).
time = 0.00, size = 33, normalized size = 11.00 \begin {gather*} -\log \left (\cos \left (\frac {x}{2}\right )-\sin \left (\frac {x}{2}\right )\right )+\log \left (\cos \left (\frac {x}{2}\right )+\sin \left (\frac {x}{2}\right )\right ) \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[Sec[x],x]

[Out]

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

________________________________________________________________________________________

Maple [A]
time = 0.02, size = 7, normalized size = 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\)
risch \(\ln \left ({\mathrm e}^{i x}+i\right )-\ln \left ({\mathrm e}^{i x}-i\right )\) \(22\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Maxima [B] Leaf count of result is larger than twice the leaf count of optimal. 15 vs. \(2 (3) = 6\).
time = 1.92, size = 15, normalized size = 5.00 \begin {gather*} \frac {1}{2} \, \log \left (\sin \left (x\right ) + 1\right ) - \frac {1}{2} \, \log \left (\sin \left (x\right ) - 1\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 17 vs. \(2 (3) = 6\).
time = 1.20, size = 17, normalized size = 5.67 \begin {gather*} \frac {1}{2} \, \log \left (\sin \left (x\right ) + 1\right ) - \frac {1}{2} \, \log \left (-\sin \left (x\right ) + 1\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Sympy [B] Leaf count of result is larger than twice the leaf count of optimal. 15 vs. \(2 (3) = 6\).
time = 0.05, size = 15, normalized size = 5.00 \begin {gather*} - \frac {\log {\left (\sin {\left (x \right )} - 1 \right )}}{2} + \frac {\log {\left (\sin {\left (x \right )} + 1 \right )}}{2} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/cos(x),x)

[Out]

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

________________________________________________________________________________________

Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 17 vs. \(2 (3) = 6\).
time = 0.57, size = 17, normalized size = 5.67 \begin {gather*} \frac {1}{2} \, \log \left (\sin \left (x\right ) + 1\right ) - \frac {1}{2} \, \log \left (-\sin \left (x\right ) + 1\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Mupad [B]
time = 0.13, size = 11, normalized size = 3.67 \begin {gather*} \ln \left (\frac {1}{\cos \left (x\right )}\right )+\ln \left (\sin \left (x\right )+1\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(1/cos(x),x)

[Out]

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

________________________________________________________________________________________