3.1054 \(\int \frac{\cosh ^2(a+b x)-\sinh ^2(a+b x)}{\cosh ^2(a+b x)+\sinh ^2(a+b x)} \, dx\)

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

[Out]

ArcTan[Tanh[a + b*x]]/b

________________________________________________________________________________________

Rubi [A]  time = 0.0616019, antiderivative size = 11, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 2, integrand size = 39, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.051, Rules used = {4380, 203} \[ \frac{\tan ^{-1}(\tanh (a+b x))}{b} \]

Antiderivative was successfully verified.

[In]

Int[(Cosh[a + b*x]^2 - Sinh[a + b*x]^2)/(Cosh[a + b*x]^2 + Sinh[a + b*x]^2),x]

[Out]

ArcTan[Tanh[a + b*x]]/b

Rule 4380

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

Rule 203

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

Rubi steps

\begin{align*} \int \frac{\cosh ^2(a+b x)-\sinh ^2(a+b x)}{\cosh ^2(a+b x)+\sinh ^2(a+b x)} \, dx &=\int \frac{1}{\cosh ^2(a+b x)+\sinh ^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.004128, size = 17, normalized size = 1.55 \[ \frac{\tan ^{-1}(\sinh (2 a+2 b x))}{2 b} \]

Antiderivative was successfully verified.

[In]

Integrate[(Cosh[a + b*x]^2 - Sinh[a + b*x]^2)/(Cosh[a + b*x]^2 + Sinh[a + b*x]^2),x]

[Out]

ArcTan[Sinh[2*a + 2*b*x]]/(2*b)

________________________________________________________________________________________

Maple [B]  time = 0.063, size = 148, normalized size = 13.5 \begin{align*} -2\,{\frac{\sqrt{2}}{b \left ( 2+2\,\sqrt{2} \right ) }\arctan \left ( 2\,{\frac{\tanh \left ( 1/2\,bx+a/2 \right ) }{2+2\,\sqrt{2}}} \right ) }-2\,{\frac{1}{b \left ( 2+2\,\sqrt{2} \right ) }\arctan \left ( 2\,{\frac{\tanh \left ( 1/2\,bx+a/2 \right ) }{2+2\,\sqrt{2}}} \right ) }+2\,{\frac{\sqrt{2}}{b \left ( -2+2\,\sqrt{2} \right ) }\arctan \left ( 2\,{\frac{\tanh \left ( 1/2\,bx+a/2 \right ) }{-2+2\,\sqrt{2}}} \right ) }-2\,{\frac{1}{b \left ( -2+2\,\sqrt{2} \right ) }\arctan \left ( 2\,{\frac{\tanh \left ( 1/2\,bx+a/2 \right ) }{-2+2\,\sqrt{2}}} \right ) } \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((cosh(b*x+a)^2-sinh(b*x+a)^2)/(cosh(b*x+a)^2+sinh(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 = 1.75337, size = 66, normalized size = 6. \begin{align*} \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} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((cosh(b*x+a)^2-sinh(b*x+a)^2)/(cosh(b*x+a)^2+sinh(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

________________________________________________________________________________________

Fricas [B]  time = 2.01314, size = 104, normalized size = 9.45 \begin{align*} -\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} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((cosh(b*x+a)^2-sinh(b*x+a)^2)/(cosh(b*x+a)^2+sinh(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

________________________________________________________________________________________

Sympy [F(-2)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: TypeError} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((cosh(b*x+a)**2-sinh(b*x+a)**2)/(cosh(b*x+a)**2+sinh(b*x+a)**2),x)

[Out]

Exception raised: TypeError

________________________________________________________________________________________

Giac [A]  time = 1.16033, size = 19, normalized size = 1.73 \begin{align*} \frac{\arctan \left (e^{\left (2 \, b x + 2 \, a\right )}\right )}{b} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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