3.1057 \(\int \frac {-\text {csch}^2(a+b x)+\text {sech}^2(a+b x)}{\text {csch}^2(a+b x)+\text {sech}^2(a+b x)} \, dx\)

Optimal. Leaf size=12 \[ -\frac {\tan ^{-1}(\tanh (a+b x))}{b} \]

[Out]

-arctan(tanh(b*x+a))/b

________________________________________________________________________________________

Rubi [A]  time = 0.26, antiderivative size = 12, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 1, integrand size = 39, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.026, Rules used = {204} \[ -\frac {\tan ^{-1}(\tanh (a+b x))}{b} \]

Antiderivative was successfully verified.

[In]

Int[(-Csch[a + b*x]^2 + Sech[a + b*x]^2)/(Csch[a + b*x]^2 + Sech[a + b*x]^2),x]

[Out]

-(ArcTan[Tanh[a + b*x]]/b)

Rule 204

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> -Simp[ArcTan[(Rt[-b, 2]*x)/Rt[-a, 2]]/(Rt[-a, 2]*Rt[-b, 2]), x] /
; FreeQ[{a, b}, x] && PosQ[a/b] && (LtQ[a, 0] || LtQ[b, 0])

Rubi steps

\begin {align*} \int \frac {-\text {csch}^2(a+b x)+\text {sech}^2(a+b x)}{\text {csch}^2(a+b x)+\text {sech}^2(a+b x)} \, dx &=\frac {\operatorname {Subst}\left (\int \frac {1}{-1-x^2} \, dx,x,\tanh (a+b x)\right )}{b}\\ &=-\frac {\tan ^{-1}(\tanh (a+b x))}{b}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.01, size = 17, normalized size = 1.42 \[ -\frac {\tan ^{-1}(\sinh (2 a+2 b x))}{2 b} \]

Antiderivative was successfully verified.

[In]

Integrate[(-Csch[a + b*x]^2 + Sech[a + b*x]^2)/(Csch[a + b*x]^2 + Sech[a + b*x]^2),x]

[Out]

-1/2*ArcTan[Sinh[2*a + 2*b*x]]/b

________________________________________________________________________________________

fricas [B]  time = 0.43, size = 37, normalized size = 3.08 \[ \frac {\arctan \left (-\frac {\cosh \left (b x + a\right ) + \sinh \left (b x + a\right )}{\cosh \left (b x + a\right ) - \sinh \left (b x + a\right )}\right )}{b} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((-csch(b*x+a)^2+sech(b*x+a)^2)/(csch(b*x+a)^2+sech(b*x+a)^2),x, algorithm="fricas")

[Out]

arctan(-(cosh(b*x + a) + sinh(b*x + a))/(cosh(b*x + a) - sinh(b*x + a)))/b

________________________________________________________________________________________

giac [B]  time = 0.17, size = 43, normalized size = 3.58 \[ \frac {\arctan \left (\frac {1}{2} \, \sqrt {2} {\left (\sqrt {2} + 2 \, e^{\left (b x + a\right )}\right )}\right ) - \arctan \left (-\frac {1}{2} \, \sqrt {2} {\left (\sqrt {2} - 2 \, e^{\left (b x + a\right )}\right )}\right )}{b} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((-csch(b*x+a)^2+sech(b*x+a)^2)/(csch(b*x+a)^2+sech(b*x+a)^2),x, algorithm="giac")

[Out]

(arctan(1/2*sqrt(2)*(sqrt(2) + 2*e^(b*x + a))) - arctan(-1/2*sqrt(2)*(sqrt(2) - 2*e^(b*x + a))))/b

________________________________________________________________________________________

maple [B]  time = 0.80, size = 148, normalized size = 12.33 \[ -\frac {2 \sqrt {2}\, \arctan \left (\frac {2 \tanh \left (\frac {b x}{2}+\frac {a}{2}\right )}{-2+2 \sqrt {2}}\right )}{b \left (-2+2 \sqrt {2}\right )}+\frac {2 \arctan \left (\frac {2 \tanh \left (\frac {b x}{2}+\frac {a}{2}\right )}{-2+2 \sqrt {2}}\right )}{b \left (-2+2 \sqrt {2}\right )}+\frac {2 \sqrt {2}\, \arctan \left (\frac {2 \tanh \left (\frac {b x}{2}+\frac {a}{2}\right )}{2+2 \sqrt {2}}\right )}{b \left (2+2 \sqrt {2}\right )}+\frac {2 \arctan \left (\frac {2 \tanh \left (\frac {b x}{2}+\frac {a}{2}\right )}{2+2 \sqrt {2}}\right )}{b \left (2+2 \sqrt {2}\right )} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((-csch(b*x+a)^2+sech(b*x+a)^2)/(csch(b*x+a)^2+sech(b*x+a)^2),x)

[Out]

-2/b*2^(1/2)/(-2+2*2^(1/2))*arctan(2*tanh(1/2*b*x+1/2*a)/(-2+2*2^(1/2)))+2/b/(-2+2*2^(1/2))*arctan(2*tanh(1/2*
b*x+1/2*a)/(-2+2*2^(1/2)))+2/b*2^(1/2)/(2+2*2^(1/2))*arctan(2*tanh(1/2*b*x+1/2*a)/(2+2*2^(1/2)))+2/b/(2+2*2^(1
/2))*arctan(2*tanh(1/2*b*x+1/2*a)/(2+2*2^(1/2)))

________________________________________________________________________________________

maxima [B]  time = 0.44, size = 50, normalized size = 4.17 \[ -\frac {\arctan \left (\frac {1}{2} \, \sqrt {2} {\left (\sqrt {2} + 2 \, e^{\left (-b x - a\right )}\right )}\right ) - \arctan \left (-\frac {1}{2} \, \sqrt {2} {\left (\sqrt {2} - 2 \, e^{\left (-b x - a\right )}\right )}\right )}{b} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((-csch(b*x+a)^2+sech(b*x+a)^2)/(csch(b*x+a)^2+sech(b*x+a)^2),x, algorithm="maxima")

[Out]

-(arctan(1/2*sqrt(2)*(sqrt(2) + 2*e^(-b*x - a))) - arctan(-1/2*sqrt(2)*(sqrt(2) - 2*e^(-b*x - a))))/b

________________________________________________________________________________________

mupad [B]  time = 1.96, size = 26, normalized size = 2.17 \[ -\frac {\mathrm {atan}\left (\frac {{\mathrm {e}}^{2\,a}\,{\mathrm {e}}^{2\,b\,x}\,\sqrt {b^2}}{b}\right )}{\sqrt {b^2}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((1/cosh(a + b*x)^2 - 1/sinh(a + b*x)^2)/(1/cosh(a + b*x)^2 + 1/sinh(a + b*x)^2),x)

[Out]

-atan((exp(2*a)*exp(2*b*x)*(b^2)^(1/2))/b)/(b^2)^(1/2)

________________________________________________________________________________________

sympy [F]  time = 0.00, size = 0, normalized size = 0.00 \[ - \int \frac {\operatorname {csch}^{2}{\left (a + b x \right )}}{\operatorname {csch}^{2}{\left (a + b x \right )} + \operatorname {sech}^{2}{\left (a + b x \right )}}\, dx - \int \left (- \frac {\operatorname {sech}^{2}{\left (a + b x \right )}}{\operatorname {csch}^{2}{\left (a + b x \right )} + \operatorname {sech}^{2}{\left (a + b x \right )}}\right )\, dx \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((-csch(b*x+a)**2+sech(b*x+a)**2)/(csch(b*x+a)**2+sech(b*x+a)**2),x)

[Out]

-Integral(csch(a + b*x)**2/(csch(a + b*x)**2 + sech(a + b*x)**2), x) - Integral(-sech(a + b*x)**2/(csch(a + b*
x)**2 + sech(a + b*x)**2), x)

________________________________________________________________________________________