3.575 \(\int \frac {1-\sinh ^2(x)}{1+\sinh ^2(x)} \, dx\)

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

[Out]

-x+2*tanh(x)

________________________________________________________________________________________

Rubi [A]  time = 0.04, antiderivative size = 8, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 4, integrand size = 17, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.235, Rules used = {3171, 3175, 3767, 8} \[ 2 \tanh (x)-x \]

Antiderivative was successfully verified.

[In]

Int[(1 - Sinh[x]^2)/(1 + Sinh[x]^2),x]

[Out]

-x + 2*Tanh[x]

Rule 8

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

Rule 3171

Int[((A_.) + (B_.)*sin[(e_.) + (f_.)*(x_)]^2)/((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)]^2), x_Symbol] :> Simp[(B*x
)/b, x] + Dist[(A*b - a*B)/b, Int[1/(a + b*Sin[e + f*x]^2), x], x] /; FreeQ[{a, b, e, f, A, B}, x]

Rule 3175

Int[(u_.)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)]^2)^(p_), x_Symbol] :> Dist[a^p, Int[ActivateTrig[u*cos[e + f*x
]^(2*p)], x], x] /; FreeQ[{a, b, e, f, p}, x] && EqQ[a + b, 0] && IntegerQ[p]

Rule 3767

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 {align*} \int \frac {1-\sinh ^2(x)}{1+\sinh ^2(x)} \, dx &=-x+2 \int \frac {1}{1+\sinh ^2(x)} \, dx\\ &=-x+2 \int \text {sech}^2(x) \, dx\\ &=-x+2 i \operatorname {Subst}(\int 1 \, dx,x,-i \tanh (x))\\ &=-x+2 \tanh (x)\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.02, size = 8, normalized size = 1.00 \[ 2 \tanh (x)-x \]

Antiderivative was successfully verified.

[In]

Integrate[(1 - Sinh[x]^2)/(1 + Sinh[x]^2),x]

[Out]

-x + 2*Tanh[x]

________________________________________________________________________________________

fricas [B]  time = 0.40, size = 17, normalized size = 2.12 \[ -\frac {{\left (x + 2\right )} \cosh \relax (x) - 2 \, \sinh \relax (x)}{\cosh \relax (x)} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((1-sinh(x)^2)/(1+sinh(x)^2),x, algorithm="fricas")

[Out]

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

________________________________________________________________________________________

giac [A]  time = 0.13, size = 14, normalized size = 1.75 \[ -x - \frac {4}{e^{\left (2 \, x\right )} + 1} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((1-sinh(x)^2)/(1+sinh(x)^2),x, algorithm="giac")

[Out]

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

________________________________________________________________________________________

maple [B]  time = 0.15, size = 34, normalized size = 4.25 \[ \ln \left (\tanh \left (\frac {x}{2}\right )-1\right )-\ln \left (\tanh \left (\frac {x}{2}\right )+1\right )+\frac {4 \tanh \left (\frac {x}{2}\right )}{\tanh ^{2}\left (\frac {x}{2}\right )+1} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((1-sinh(x)^2)/(1+sinh(x)^2),x)

[Out]

ln(tanh(1/2*x)-1)-ln(tanh(1/2*x)+1)+4*tanh(1/2*x)/(tanh(1/2*x)^2+1)

________________________________________________________________________________________

maxima [A]  time = 0.34, size = 14, normalized size = 1.75 \[ -x + \frac {4}{e^{\left (-2 \, x\right )} + 1} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((1-sinh(x)^2)/(1+sinh(x)^2),x, algorithm="maxima")

[Out]

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

________________________________________________________________________________________

mupad [B]  time = 0.04, size = 14, normalized size = 1.75 \[ -x-\frac {4}{{\mathrm {e}}^{2\,x}+1} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(-(sinh(x)^2 - 1)/(sinh(x)^2 + 1),x)

[Out]

- x - 4/(exp(2*x) + 1)

________________________________________________________________________________________

sympy [B]  time = 1.03, size = 41, normalized size = 5.12 \[ - \frac {x \tanh ^{2}{\left (\frac {x}{2} \right )}}{\tanh ^{2}{\left (\frac {x}{2} \right )} + 1} - \frac {x}{\tanh ^{2}{\left (\frac {x}{2} \right )} + 1} + \frac {4 \tanh {\left (\frac {x}{2} \right )}}{\tanh ^{2}{\left (\frac {x}{2} \right )} + 1} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((1-sinh(x)**2)/(1+sinh(x)**2),x)

[Out]

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

________________________________________________________________________________________