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

Optimal. Leaf size=47 \[ -\frac {1}{3 b (\tanh (a+b x)+1)}-\frac {4 \tan ^{-1}\left (\frac {1-2 \tanh (a+b x)}{\sqrt {3}}\right )}{3 \sqrt {3} b} \]

[Out]

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

________________________________________________________________________________________

Rubi [A]  time = 0.33, antiderivative size = 47, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 3, integrand size = 39, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.077, Rules used = {2074, 618, 204} \[ -\frac {1}{3 b (\tanh (a+b x)+1)}-\frac {4 \tan ^{-1}\left (\frac {1-2 \tanh (a+b x)}{\sqrt {3}}\right )}{3 \sqrt {3} b} \]

Antiderivative was successfully verified.

[In]

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

[Out]

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

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])

Rule 618

Int[((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(-1), x_Symbol] :> Dist[-2, Subst[Int[1/Simp[b^2 - 4*a*c - x^2, x], x]
, x, b + 2*c*x], x] /; FreeQ[{a, b, c}, x] && NeQ[b^2 - 4*a*c, 0]

Rule 2074

Int[(P_)^(p_)*(Q_)^(q_.), x_Symbol] :> With[{PP = Factor[P]}, Int[ExpandIntegrand[PP^p*Q^q, x], x] /;  !SumQ[N
onfreeFactors[PP, x]]] /; FreeQ[q, x] && PolyQ[P, x] && PolyQ[Q, x] && IntegerQ[p] && NeQ[P, x]

Rubi steps

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

________________________________________________________________________________________

Mathematica [B]  time = 1.35, size = 115, normalized size = 2.45 \[ \frac {(\sinh (a+b x)-\cosh (a+b x)) \left (\cosh (a+b x) \left (8 \sqrt {3} \tan ^{-1}\left (\frac {\text {sech}(b x) (\cosh (2 a+b x)-2 \sinh (2 a+b x))}{\sqrt {3}}\right )+3\right )+\sinh (a+b x) \left (8 \sqrt {3} \tan ^{-1}\left (\frac {\text {sech}(b x) (\cosh (2 a+b x)-2 \sinh (2 a+b x))}{\sqrt {3}}\right )-3\right )\right )}{18 b} \]

Antiderivative was successfully verified.

[In]

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

[Out]

((-Cosh[a + b*x] + Sinh[a + b*x])*((3 + 8*Sqrt[3]*ArcTan[(Sech[b*x]*(Cosh[2*a + b*x] - 2*Sinh[2*a + b*x]))/Sqr
t[3]])*Cosh[a + b*x] + (-3 + 8*Sqrt[3]*ArcTan[(Sech[b*x]*(Cosh[2*a + b*x] - 2*Sinh[2*a + b*x]))/Sqrt[3]])*Sinh
[a + b*x]))/(18*b)

________________________________________________________________________________________

fricas [B]  time = 0.45, size = 127, normalized size = 2.70 \[ -\frac {8 \, {\left (\sqrt {3} \cosh \left (b x + a\right )^{2} + 2 \, \sqrt {3} \cosh \left (b x + a\right ) \sinh \left (b x + a\right ) + \sqrt {3} \sinh \left (b x + a\right )^{2}\right )} \arctan \left (-\frac {\sqrt {3} \cosh \left (b x + a\right ) + \sqrt {3} \sinh \left (b x + a\right )}{3 \, {\left (\cosh \left (b x + a\right ) - \sinh \left (b x + a\right )\right )}}\right ) + 3}{18 \, {\left (b \cosh \left (b x + a\right )^{2} + 2 \, b \cosh \left (b x + a\right ) \sinh \left (b x + a\right ) + b \sinh \left (b x + a\right )^{2}\right )}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

giac [A]  time = 0.22, size = 37, normalized size = 0.79 \[ \frac {8 \, \sqrt {3} \arctan \left (\frac {1}{3} \, \sqrt {3} e^{\left (2 \, b x + 2 \, a\right )}\right ) - 3 \, e^{\left (-2 \, b x - 2 \, a\right )}}{18 \, b} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

maple [C]  time = 1.12, size = 120, normalized size = 2.55 \[ \frac {2 i \sqrt {3}\, \ln \left (\tanh ^{2}\left (\frac {b x}{2}+\frac {a}{2}\right )+\left (-i \sqrt {3}-1\right ) \tanh \left (\frac {b x}{2}+\frac {a}{2}\right )+1\right )}{9 b}-\frac {2 i \sqrt {3}\, \ln \left (\tanh ^{2}\left (\frac {b x}{2}+\frac {a}{2}\right )+\left (i \sqrt {3}-1\right ) \tanh \left (\frac {b x}{2}+\frac {a}{2}\right )+1\right )}{9 b}-\frac {2}{3 b \left (\tanh \left (\frac {b x}{2}+\frac {a}{2}\right )+1\right )^{2}}+\frac {2}{3 b \left (\tanh \left (\frac {b x}{2}+\frac {a}{2}\right )+1\right )} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

maxima [B]  time = 0.46, size = 93, normalized size = 1.98 \[ \frac {4 \, {\left (\sqrt {3} \arctan \left (\frac {1}{6} \cdot 3^{\frac {3}{4}} \sqrt {2} {\left (2 \, \sqrt {3} e^{\left (-b x - a\right )} + 3^{\frac {1}{4}} \sqrt {2}\right )}\right ) - \sqrt {3} \arctan \left (\frac {1}{6} \cdot 3^{\frac {3}{4}} \sqrt {2} {\left (2 \, \sqrt {3} e^{\left (-b x - a\right )} - 3^{\frac {1}{4}} \sqrt {2}\right )}\right )\right )}}{9 \, b} - \frac {e^{\left (-2 \, b x - 2 \, a\right )}}{6 \, b} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

mupad [B]  time = 1.82, size = 48, normalized size = 1.02 \[ \frac {4\,\sqrt {3}\,\mathrm {atan}\left (\frac {\sqrt {3}\,{\mathrm {e}}^{2\,a}\,{\mathrm {e}}^{2\,b\,x}\,\sqrt {b^2}}{3\,b}\right )}{9\,\sqrt {b^2}}-\frac {{\mathrm {e}}^{-2\,a-2\,b\,x}}{6\,b} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

(4*3^(1/2)*atan((3^(1/2)*exp(2*a)*exp(2*b*x)*(b^2)^(1/2))/(3*b)))/(9*(b^2)^(1/2)) - exp(- 2*a - 2*b*x)/(6*b)

________________________________________________________________________________________

sympy [A]  time = 15.24, size = 197, normalized size = 4.19 \[ \begin {cases} - x & \text {for}\: a = \log {\left (- i e^{- b x} \right )} \vee a = \log {\left (i e^{- b x} \right )} \\\frac {x \left (- \sinh ^{3}{\relax (a )} + \cosh ^{3}{\relax (a )}\right )}{\sinh ^{3}{\relax (a )} + \cosh ^{3}{\relax (a )}} & \text {for}\: b = 0 \\\frac {4 \sqrt {3} \sinh {\left (a + b x \right )} \operatorname {atan}{\left (\frac {2 \sqrt {3} \sinh {\left (a + b x \right )}}{3 \cosh {\left (a + b x \right )}} - \frac {\sqrt {3}}{3} \right )}}{9 b \sinh {\left (a + b x \right )} + 9 b \cosh {\left (a + b x \right )}} + \frac {3 \sinh {\left (a + b x \right )}}{9 b \sinh {\left (a + b x \right )} + 9 b \cosh {\left (a + b x \right )}} + \frac {4 \sqrt {3} \cosh {\left (a + b x \right )} \operatorname {atan}{\left (\frac {2 \sqrt {3} \sinh {\left (a + b x \right )}}{3 \cosh {\left (a + b x \right )}} - \frac {\sqrt {3}}{3} \right )}}{9 b \sinh {\left (a + b x \right )} + 9 b \cosh {\left (a + b x \right )}} & \text {otherwise} \end {cases} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

Piecewise((-x, Eq(a, log(I*exp(-b*x))) | Eq(a, log(-I*exp(-b*x)))), (x*(-sinh(a)**3 + cosh(a)**3)/(sinh(a)**3
+ cosh(a)**3), Eq(b, 0)), (4*sqrt(3)*sinh(a + b*x)*atan(2*sqrt(3)*sinh(a + b*x)/(3*cosh(a + b*x)) - sqrt(3)/3)
/(9*b*sinh(a + b*x) + 9*b*cosh(a + b*x)) + 3*sinh(a + b*x)/(9*b*sinh(a + b*x) + 9*b*cosh(a + b*x)) + 4*sqrt(3)
*cosh(a + b*x)*atan(2*sqrt(3)*sinh(a + b*x)/(3*cosh(a + b*x)) - sqrt(3)/3)/(9*b*sinh(a + b*x) + 9*b*cosh(a + b
*x)), True))

________________________________________________________________________________________