3.11.52 \(\int \frac {\cosh ^4(a+b x)-\sinh ^4(a+b x)}{\cosh ^4(a+b x)+\sinh ^4(a+b x)} \, dx\) [1052]

Optimal. Leaf size=51 \[ -\frac {\text {ArcTan}\left (1-\sqrt {2} \tanh (a+b x)\right )}{\sqrt {2} b}+\frac {\text {ArcTan}\left (1+\sqrt {2} \tanh (a+b x)\right )}{\sqrt {2} b} \]

[Out]

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

________________________________________________________________________________________

Rubi [A]
time = 0.13, antiderivative size = 51, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 3, integrand size = 39, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.077, Rules used = {1176, 631, 210} \begin {gather*} \frac {\text {ArcTan}\left (\sqrt {2} \tanh (a+b x)+1\right )}{\sqrt {2} b}-\frac {\text {ArcTan}\left (1-\sqrt {2} \tanh (a+b x)\right )}{\sqrt {2} b} \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

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

Rule 210

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

Rule 631

Int[((a_) + (b_.)*(x_) + (c_.)*(x_)^2)^(-1), x_Symbol] :> With[{q = 1 - 4*Simplify[a*(c/b^2)]}, Dist[-2/b, Sub
st[Int[1/(q - x^2), x], x, 1 + 2*c*(x/b)], x] /; RationalQ[q] && (EqQ[q^2, 1] ||  !RationalQ[b^2 - 4*a*c])] /;
 FreeQ[{a, b, c}, x] && NeQ[b^2 - 4*a*c, 0]

Rule 1176

Int[((d_) + (e_.)*(x_)^2)/((a_) + (c_.)*(x_)^4), x_Symbol] :> With[{q = Rt[2*(d/e), 2]}, Dist[e/(2*c), Int[1/S
imp[d/e + q*x + x^2, x], x], x] + Dist[e/(2*c), Int[1/Simp[d/e - q*x + x^2, x], x], x]] /; FreeQ[{a, c, d, e},
 x] && EqQ[c*d^2 - a*e^2, 0] && PosQ[d*e]

Rubi steps

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

________________________________________________________________________________________

Mathematica [A]
time = 0.02, size = 25, normalized size = 0.49 \begin {gather*} \frac {\text {ArcTan}\left (\frac {\sinh (2 a+2 b x)}{\sqrt {2}}\right )}{\sqrt {2} b} \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

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

________________________________________________________________________________________

Maple [C] Result contains complex when optimal does not.
time = 5.04, size = 136, normalized size = 2.67

method result size
risch \(\frac {i \sqrt {2}\, \ln \left ({\mathrm e}^{4 b x +4 a}+2 i \sqrt {2}\, {\mathrm e}^{2 b x +2 a}-1\right )}{4 b}-\frac {i \sqrt {2}\, \ln \left ({\mathrm e}^{4 b x +4 a}-2 i \sqrt {2}\, {\mathrm e}^{2 b x +2 a}-1\right )}{4 b}\) \(74\)
derivativedivides \(\frac {\frac {i \sqrt {2}\, \ln \left (-2 i \sqrt {2}\, \left (\tanh ^{3}\left (\frac {b x}{2}+\frac {a}{2}\right )\right )+\tanh ^{4}\left (\frac {b x}{2}+\frac {a}{2}\right )-2 i \sqrt {2}\, \tanh \left (\frac {b x}{2}+\frac {a}{2}\right )-2 \left (\tanh ^{2}\left (\frac {b x}{2}+\frac {a}{2}\right )\right )+1\right )}{4}-\frac {i \sqrt {2}\, \ln \left (2 i \sqrt {2}\, \left (\tanh ^{3}\left (\frac {b x}{2}+\frac {a}{2}\right )\right )+\tanh ^{4}\left (\frac {b x}{2}+\frac {a}{2}\right )+2 i \sqrt {2}\, \tanh \left (\frac {b x}{2}+\frac {a}{2}\right )-2 \left (\tanh ^{2}\left (\frac {b x}{2}+\frac {a}{2}\right )\right )+1\right )}{4}}{b}\) \(136\)
default \(\frac {\frac {i \sqrt {2}\, \ln \left (-2 i \sqrt {2}\, \left (\tanh ^{3}\left (\frac {b x}{2}+\frac {a}{2}\right )\right )+\tanh ^{4}\left (\frac {b x}{2}+\frac {a}{2}\right )-2 i \sqrt {2}\, \tanh \left (\frac {b x}{2}+\frac {a}{2}\right )-2 \left (\tanh ^{2}\left (\frac {b x}{2}+\frac {a}{2}\right )\right )+1\right )}{4}-\frac {i \sqrt {2}\, \ln \left (2 i \sqrt {2}\, \left (\tanh ^{3}\left (\frac {b x}{2}+\frac {a}{2}\right )\right )+\tanh ^{4}\left (\frac {b x}{2}+\frac {a}{2}\right )+2 i \sqrt {2}\, \tanh \left (\frac {b x}{2}+\frac {a}{2}\right )-2 \left (\tanh ^{2}\left (\frac {b x}{2}+\frac {a}{2}\right )\right )+1\right )}{4}}{b}\) \(136\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((cosh(b*x+a)^4-sinh(b*x+a)^4)/(cosh(b*x+a)^4+sinh(b*x+a)^4),x,method=_RETURNVERBOSE)

[Out]

1/b*(1/4*I*2^(1/2)*ln(-2*I*2^(1/2)*tanh(1/2*b*x+1/2*a)^3+tanh(1/2*b*x+1/2*a)^4-2*I*2^(1/2)*tanh(1/2*b*x+1/2*a)
-2*tanh(1/2*b*x+1/2*a)^2+1)-1/4*I*2^(1/2)*ln(2*I*2^(1/2)*tanh(1/2*b*x+1/2*a)^3+tanh(1/2*b*x+1/2*a)^4+2*I*2^(1/
2)*tanh(1/2*b*x+1/2*a)-2*tanh(1/2*b*x+1/2*a)^2+1))

________________________________________________________________________________________

Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

2*integrate((e^(-b*x - a) + e^(-5*b*x - 5*a))*e^(-b*x - a)/(6*e^(-4*b*x - 4*a) + e^(-8*b*x - 8*a) + 1), x) + 2
*integrate(e^(6*b*x + 6*a)/(e^(8*b*x + 8*a) + 6*e^(4*b*x + 4*a) + 1), x) + 2*integrate(e^(-6*b*x - 6*a)/(6*e^(
-4*b*x - 4*a) + e^(-8*b*x - 8*a) + 1), x)

________________________________________________________________________________________

Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 192 vs. \(2 (43) = 86\).
time = 0.35, size = 192, normalized size = 3.76 \begin {gather*} -\frac {\sqrt {2} \arctan \left (-\frac {\sqrt {2} \cosh \left (b x + a\right )^{3} + 3 \, \sqrt {2} \cosh \left (b x + a\right ) \sinh \left (b x + a\right )^{2} + \sqrt {2} \sinh \left (b x + a\right )^{3} + {\left (3 \, \sqrt {2} \cosh \left (b x + a\right )^{2} - 7 \, \sqrt {2}\right )} \sinh \left (b x + a\right ) + 7 \, \sqrt {2} \cosh \left (b x + a\right )}{4 \, {\left (\cosh \left (b x + a\right )^{3} - 3 \, \cosh \left (b x + a\right )^{2} \sinh \left (b x + a\right ) + 3 \, \cosh \left (b x + a\right ) \sinh \left (b x + a\right )^{2} - \sinh \left (b x + a\right )^{3}\right )}}\right ) + \sqrt {2} \arctan \left (-\frac {\sqrt {2} \cosh \left (b x + a\right ) + \sqrt {2} \sinh \left (b x + a\right )}{4 \, {\left (\cosh \left (b x + a\right ) - \sinh \left (b x + a\right )\right )}}\right )}{2 \, b} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-1/2*(sqrt(2)*arctan(-1/4*(sqrt(2)*cosh(b*x + a)^3 + 3*sqrt(2)*cosh(b*x + a)*sinh(b*x + a)^2 + sqrt(2)*sinh(b*
x + a)^3 + (3*sqrt(2)*cosh(b*x + a)^2 - 7*sqrt(2))*sinh(b*x + a) + 7*sqrt(2)*cosh(b*x + a))/(cosh(b*x + a)^3 -
 3*cosh(b*x + a)^2*sinh(b*x + a) + 3*cosh(b*x + a)*sinh(b*x + a)^2 - sinh(b*x + a)^3)) + sqrt(2)*arctan(-1/4*(
sqrt(2)*cosh(b*x + a) + sqrt(2)*sinh(b*x + a))/(cosh(b*x + a) - sinh(b*x + a))))/b

________________________________________________________________________________________

Sympy [B] Leaf count of result is larger than twice the leaf count of optimal. 318 vs. \(2 (46) = 92\).
time = 2.97, size = 318, normalized size = 6.24 \begin {gather*} \begin {cases} \frac {x \left (- \sinh ^{4}{\left (a \right )} + \cosh ^{4}{\left (a \right )}\right )}{\sinh ^{4}{\left (a \right )} + \cosh ^{4}{\left (a \right )}} & \text {for}\: b = 0 \\\frac {\log {\left (- e^{- b x} \right )} \sinh ^{4}{\left (b x + \log {\left (- e^{- b x} \right )} \right )}}{b \sinh ^{4}{\left (b x + \log {\left (- e^{- b x} \right )} \right )} + b \cosh ^{4}{\left (b x + \log {\left (- e^{- b x} \right )} \right )}} - \frac {\log {\left (- e^{- b x} \right )} \cosh ^{4}{\left (b x + \log {\left (- e^{- b x} \right )} \right )}}{b \sinh ^{4}{\left (b x + \log {\left (- e^{- b x} \right )} \right )} + b \cosh ^{4}{\left (b x + \log {\left (- e^{- b x} \right )} \right )}} & \text {for}\: a = \log {\left (- e^{- b x} \right )} \\- \frac {x \sinh ^{4}{\left (b x + \log {\left (e^{- b x} \right )} \right )}}{\sinh ^{4}{\left (b x + \log {\left (e^{- b x} \right )} \right )} + \cosh ^{4}{\left (b x + \log {\left (e^{- b x} \right )} \right )}} + \frac {x \cosh ^{4}{\left (b x + \log {\left (e^{- b x} \right )} \right )}}{\sinh ^{4}{\left (b x + \log {\left (e^{- b x} \right )} \right )} + \cosh ^{4}{\left (b x + \log {\left (e^{- b x} \right )} \right )}} & \text {for}\: a = \log {\left (e^{- b x} \right )} \\\frac {\sqrt {2} \operatorname {atan}{\left (1 - \frac {\sqrt {2} \cosh {\left (a + b x \right )}}{\sinh {\left (a + b x \right )}} \right )}}{2 b} - \frac {\sqrt {2} \operatorname {atan}{\left (1 + \frac {\sqrt {2} \cosh {\left (a + b x \right )}}{\sinh {\left (a + b x \right )}} \right )}}{2 b} & \text {otherwise} \end {cases} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

Piecewise((x*(-sinh(a)**4 + cosh(a)**4)/(sinh(a)**4 + cosh(a)**4), Eq(b, 0)), (log(-exp(-b*x))*sinh(b*x + log(
-exp(-b*x)))**4/(b*sinh(b*x + log(-exp(-b*x)))**4 + b*cosh(b*x + log(-exp(-b*x)))**4) - log(-exp(-b*x))*cosh(b
*x + log(-exp(-b*x)))**4/(b*sinh(b*x + log(-exp(-b*x)))**4 + b*cosh(b*x + log(-exp(-b*x)))**4), Eq(a, log(-exp
(-b*x)))), (-x*sinh(b*x + log(exp(-b*x)))**4/(sinh(b*x + log(exp(-b*x)))**4 + cosh(b*x + log(exp(-b*x)))**4) +
 x*cosh(b*x + log(exp(-b*x)))**4/(sinh(b*x + log(exp(-b*x)))**4 + cosh(b*x + log(exp(-b*x)))**4), Eq(a, log(ex
p(-b*x)))), (sqrt(2)*atan(1 - sqrt(2)*cosh(a + b*x)/sinh(a + b*x))/(2*b) - sqrt(2)*atan(1 + sqrt(2)*cosh(a + b
*x)/sinh(a + b*x))/(2*b), True))

________________________________________________________________________________________

Giac [A]
time = 0.74, size = 34, normalized size = 0.67 \begin {gather*} \frac {\sqrt {2} \arctan \left (\frac {1}{4} \, \sqrt {2} {\left (e^{\left (4 \, b x + 4 \, a\right )} - 1\right )} e^{\left (-2 \, b x - 2 \, a\right )}\right )}{2 \, b} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Mupad [B]
time = 0.25, size = 77, normalized size = 1.51 \begin {gather*} \frac {\sqrt {2}\,\left (\mathrm {atan}\left (\frac {\sqrt {2}\,{\mathrm {e}}^{2\,a}\,{\mathrm {e}}^{2\,b\,x}\,\sqrt {b^2}}{4\,b}\right )+\mathrm {atan}\left (\frac {\sqrt {b^2}\,\left (\frac {56\,\sqrt {2}\,{\mathrm {e}}^{2\,a}\,{\mathrm {e}}^{2\,b\,x}}{b}+\frac {8\,\sqrt {2}\,{\mathrm {e}}^{6\,a}\,{\mathrm {e}}^{6\,b\,x}}{b}\right )}{32}\right )\right )}{2\,\sqrt {b^2}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

(2^(1/2)*(atan((2^(1/2)*exp(2*a)*exp(2*b*x)*(b^2)^(1/2))/(4*b)) + atan(((b^2)^(1/2)*((56*2^(1/2)*exp(2*a)*exp(
2*b*x))/b + (8*2^(1/2)*exp(6*a)*exp(6*b*x))/b))/32)))/(2*(b^2)^(1/2))

________________________________________________________________________________________