3.3.39 \(\int \text {sech}^2(x) \, dx\) [239]

Optimal. Leaf size=2 \[ \tanh (x) \]

[Out]

tanh(x)

________________________________________________________________________________________

Rubi [A]
time = 0.00, antiderivative size = 2, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, integrand size = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.500, Rules used = {3852, 8} \begin {gather*} \tanh (x) \end {gather*}

Antiderivative was successfully verified.

[In]

Int[Sech[x]^2,x]

[Out]

Tanh[x]

Rule 8

Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]

Rule 3852

Int[csc[(c_.) + (d_.)*(x_)]^(n_), x_Symbol] :> Dist[-d^(-1), Subst[Int[ExpandIntegrand[(1 + x^2)^(n/2 - 1), x]
, x], x, Cot[c + d*x]], x] /; FreeQ[{c, d}, x] && IGtQ[n/2, 0]

Rubi steps

\begin {gather*} \begin {aligned} \text {Integral} &=i \text {Subst}(\int 1 \, dx,x,-i \tanh (x))\\ &=\tanh (x)\\ \end {aligned} \end {gather*}

________________________________________________________________________________________

Mathematica [A]
time = 0.01, size = 2, normalized size = 1.00 \begin {gather*} \tanh (x) \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[Sech[x]^2,x]

[Out]

Tanh[x]

________________________________________________________________________________________

Maple [A]
time = 0.09, size = 3, normalized size = 1.50

method result size
default \(\tanh \left (x \right )\) \(3\)
parallelrisch \(\tanh \left (x \right )\) \(3\)
risch \(-\frac {2}{1+{\mathrm e}^{2 x}}\) \(11\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(1/cosh(x)^2,x,method=_RETURNVERBOSE)

[Out]

tanh(x)

________________________________________________________________________________________

Maxima [B] Leaf count of result is larger than twice the leaf count of optimal. 10 vs. \(2 (2) = 4\).
time = 0.34, size = 10, normalized size = 5.00 \begin {gather*} \frac {2}{e^{\left (-2 \, x\right )} + 1} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/cosh(x)^2,x, algorithm="maxima")

[Out]

2/(e^(-2*x) + 1)

________________________________________________________________________________________

Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 20 vs. \(2 (2) = 4\).
time = 0.55, size = 20, normalized size = 10.00 \begin {gather*} -\frac {2}{\cosh \left (x\right )^{2} + 2 \, \cosh \left (x\right ) \sinh \left (x\right ) + \sinh \left (x\right )^{2} + 1} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/cosh(x)^2,x, algorithm="fricas")

[Out]

-2/(cosh(x)^2 + 2*cosh(x)*sinh(x) + sinh(x)^2 + 1)

________________________________________________________________________________________

Sympy [B] Leaf count of result is larger than twice the leaf count of optimal. 14 vs. \(2 (2) = 4\).
time = 0.32, size = 14, normalized size = 7.00 \begin {gather*} \frac {2 \tanh {\left (\frac {x}{2} \right )}}{\tanh ^{2}{\left (\frac {x}{2} \right )} + 1} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/cosh(x)**2,x)

[Out]

2*tanh(x/2)/(tanh(x/2)**2 + 1)

________________________________________________________________________________________

Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 10 vs. \(2 (2) = 4\).
time = 0.46, size = 10, normalized size = 5.00 \begin {gather*} -\frac {2}{e^{\left (2 \, x\right )} + 1} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/cosh(x)^2,x, algorithm="giac")

[Out]

-2/(e^(2*x) + 1)

________________________________________________________________________________________

Mupad [B]
time = 0.01, size = 2, normalized size = 1.00 \begin {gather*} \mathrm {tanh}\left (x\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(1/cosh(x)^2,x)

[Out]

tanh(x)

________________________________________________________________________________________

Chatgpt [F] Failed to verify
time = 1.00, size = 9, normalized size = 4.50 \begin {gather*} \tanh \left (x \right )-\frac {\left (\tanh ^{3}\left (x \right )\right )}{3} \end {gather*}

Warning: Unable to verify antiderivative.

[In]

int(1/cosh(x)^2,x)

[Out]

tanh(x)-1/3*tanh(x)^3

________________________________________________________________________________________