3.136 \(\int \tanh (c-b x) \tanh (a+b x) \, dx\)

Optimal. Leaf size=36 \[ -\frac {\coth (a+c) \log (\cosh (c-b x))}{b}+\frac {\coth (a+c) \log (\cosh (a+b x))}{b}-x \]

[Out]

-x-coth(a+c)*ln(cosh(b*x-c))/b+coth(a+c)*ln(cosh(b*x+a))/b

________________________________________________________________________________________

Rubi [A]  time = 0.07, antiderivative size = 36, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 3, integrand size = 14, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.214, Rules used = {5646, 5644, 3475} \[ -\frac {\coth (a+c) \log (\cosh (c-b x))}{b}+\frac {\coth (a+c) \log (\cosh (a+b x))}{b}-x \]

Antiderivative was successfully verified.

[In]

Int[Tanh[c - b*x]*Tanh[a + b*x],x]

[Out]

-x - (Coth[a + c]*Log[Cosh[c - b*x]])/b + (Coth[a + c]*Log[Cosh[a + b*x]])/b

Rule 3475

Int[tan[(c_.) + (d_.)*(x_)], x_Symbol] :> -Simp[Log[RemoveContent[Cos[c + d*x], x]]/d, x] /; FreeQ[{c, d}, x]

Rule 5644

Int[Sech[(a_.) + (b_.)*(x_)]*Sech[(c_) + (d_.)*(x_)], x_Symbol] :> -Dist[Csch[(b*c - a*d)/d], Int[Tanh[a + b*x
], x], x] + Dist[Csch[(b*c - a*d)/b], Int[Tanh[c + d*x], x], x] /; FreeQ[{a, b, c, d}, x] && EqQ[b^2 - d^2, 0]
 && NeQ[b*c - a*d, 0]

Rule 5646

Int[Tanh[(a_.) + (b_.)*(x_)]*Tanh[(c_) + (d_.)*(x_)], x_Symbol] :> Simp[(b*x)/d, x] - Dist[(b*Cosh[(b*c - a*d)
/d])/d, Int[Sech[a + b*x]*Sech[c + d*x], x], x] /; FreeQ[{a, b, c, d}, x] && EqQ[b^2 - d^2, 0] && NeQ[b*c - a*
d, 0]

Rubi steps

\begin {align*} \int \tanh (c-b x) \tanh (a+b x) \, dx &=-x+\cosh (a+c) \int \text {sech}(c-b x) \text {sech}(a+b x) \, dx\\ &=-x+\coth (a+c) \int \tanh (c-b x) \, dx+\coth (a+c) \int \tanh (a+b x) \, dx\\ &=-x-\frac {\coth (a+c) \log (\cosh (c-b x))}{b}+\frac {\coth (a+c) \log (\cosh (a+b x))}{b}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.52, size = 30, normalized size = 0.83 \[ \frac {\coth (a+c) (\log (\cosh (a+b x))-\log (\cosh (c-b x)))}{b}-x \]

Antiderivative was successfully verified.

[In]

Integrate[Tanh[c - b*x]*Tanh[a + b*x],x]

[Out]

-x + (Coth[a + c]*(-Log[Cosh[c - b*x]] + Log[Cosh[a + b*x]]))/b

________________________________________________________________________________________

fricas [B]  time = 0.44, size = 216, normalized size = 6.00 \[ -\frac {b x \cosh \left (a + c\right )^{2} - 2 \, b x \cosh \left (a + c\right ) \sinh \left (a + c\right ) + b x \sinh \left (a + c\right )^{2} - b x - {\left (\cosh \left (a + c\right )^{2} - 2 \, \cosh \left (a + c\right ) \sinh \left (a + c\right ) + \sinh \left (a + c\right )^{2} + 1\right )} \log \left (\frac {2 \, {\left (\cosh \left (b x + a\right ) \cosh \left (a + c\right ) - \sinh \left (b x + a\right ) \sinh \left (a + c\right )\right )}}{\cosh \left (b x + a\right ) \cosh \left (a + c\right ) - {\left (\cosh \left (a + c\right ) + \sinh \left (a + c\right )\right )} \sinh \left (b x + a\right ) + \cosh \left (b x + a\right ) \sinh \left (a + c\right )}\right ) + {\left (\cosh \left (a + c\right )^{2} - 2 \, \cosh \left (a + c\right ) \sinh \left (a + c\right ) + \sinh \left (a + c\right )^{2} + 1\right )} \log \left (\frac {2 \, \cosh \left (b x + a\right )}{\cosh \left (b x + a\right ) - \sinh \left (b x + a\right )}\right )}{b \cosh \left (a + c\right )^{2} - 2 \, b \cosh \left (a + c\right ) \sinh \left (a + c\right ) + b \sinh \left (a + c\right )^{2} - b} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(-tanh(b*x-c)*tanh(b*x+a),x, algorithm="fricas")

[Out]

-(b*x*cosh(a + c)^2 - 2*b*x*cosh(a + c)*sinh(a + c) + b*x*sinh(a + c)^2 - b*x - (cosh(a + c)^2 - 2*cosh(a + c)
*sinh(a + c) + sinh(a + c)^2 + 1)*log(2*(cosh(b*x + a)*cosh(a + c) - sinh(b*x + a)*sinh(a + c))/(cosh(b*x + a)
*cosh(a + c) - (cosh(a + c) + sinh(a + c))*sinh(b*x + a) + cosh(b*x + a)*sinh(a + c))) + (cosh(a + c)^2 - 2*co
sh(a + c)*sinh(a + c) + sinh(a + c)^2 + 1)*log(2*cosh(b*x + a)/(cosh(b*x + a) - sinh(b*x + a))))/(b*cosh(a + c
)^2 - 2*b*cosh(a + c)*sinh(a + c) + b*sinh(a + c)^2 - b)

________________________________________________________________________________________

giac [B]  time = 0.19, size = 86, normalized size = 2.39 \[ -\frac {b x + \frac {{\left (e^{\left (2 \, a + 2 \, c\right )} + 1\right )} \log \left (e^{\left (2 \, b x\right )} + e^{\left (2 \, c\right )}\right )}{e^{\left (2 \, a + 2 \, c\right )} - 1} + \frac {{\left (e^{\left (2 \, a\right )} + e^{\left (4 \, a + 2 \, c\right )}\right )} \log \left (e^{\left (2 \, b x + 2 \, a\right )} + 1\right )}{e^{\left (2 \, a\right )} - e^{\left (4 \, a + 2 \, c\right )}}}{b} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(-tanh(b*x-c)*tanh(b*x+a),x, algorithm="giac")

[Out]

-(b*x + (e^(2*a + 2*c) + 1)*log(e^(2*b*x) + e^(2*c))/(e^(2*a + 2*c) - 1) + (e^(2*a) + e^(4*a + 2*c))*log(e^(2*
b*x + 2*a) + 1)/(e^(2*a) - e^(4*a + 2*c)))/b

________________________________________________________________________________________

maple [B]  time = 0.23, size = 149, normalized size = 4.14 \[ -x -\frac {\ln \left ({\mathrm e}^{2 a +2 c}+{\mathrm e}^{2 b x +2 a}\right ) {\mathrm e}^{2 a +2 c}}{b \left ({\mathrm e}^{2 a +2 c}-1\right )}-\frac {\ln \left ({\mathrm e}^{2 a +2 c}+{\mathrm e}^{2 b x +2 a}\right )}{b \left ({\mathrm e}^{2 a +2 c}-1\right )}+\frac {\ln \left (1+{\mathrm e}^{2 b x +2 a}\right ) {\mathrm e}^{2 a +2 c}}{b \left ({\mathrm e}^{2 a +2 c}-1\right )}+\frac {\ln \left (1+{\mathrm e}^{2 b x +2 a}\right )}{b \left ({\mathrm e}^{2 a +2 c}-1\right )} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(-tanh(b*x-c)*tanh(b*x+a),x)

[Out]

-x-1/b/(exp(2*a+2*c)-1)*ln(exp(2*a+2*c)+exp(2*b*x+2*a))*exp(2*a+2*c)-1/b/(exp(2*a+2*c)-1)*ln(exp(2*a+2*c)+exp(
2*b*x+2*a))+1/b/(exp(2*a+2*c)-1)*ln(1+exp(2*b*x+2*a))*exp(2*a+2*c)+1/b/(exp(2*a+2*c)-1)*ln(1+exp(2*b*x+2*a))

________________________________________________________________________________________

maxima [B]  time = 0.41, size = 87, normalized size = 2.42 \[ -x - \frac {a}{b} + \frac {{\left (e^{\left (2 \, a + 2 \, c\right )} + 1\right )} \log \left (e^{\left (-2 \, b x - 2 \, a\right )} + 1\right )}{b {\left (e^{\left (2 \, a + 2 \, c\right )} - 1\right )}} - \frac {{\left (e^{\left (2 \, a + 2 \, c\right )} + 1\right )} \log \left (e^{\left (-2 \, b x + 2 \, c\right )} + 1\right )}{b {\left (e^{\left (2 \, a + 2 \, c\right )} - 1\right )}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(-tanh(b*x-c)*tanh(b*x+a),x, algorithm="maxima")

[Out]

-x - a/b + (e^(2*a + 2*c) + 1)*log(e^(-2*b*x - 2*a) + 1)/(b*(e^(2*a + 2*c) - 1)) - (e^(2*a + 2*c) + 1)*log(e^(
-2*b*x + 2*c) + 1)/(b*(e^(2*a + 2*c) - 1))

________________________________________________________________________________________

mupad [B]  time = 1.89, size = 121, normalized size = 3.36 \[ \frac {\mathrm {coth}\left (a+c\right )\,\ln \left (4\,{\mathrm {e}}^{2\,a}\,{\mathrm {e}}^{2\,c}+4\,{\mathrm {e}}^{4\,a}\,{\mathrm {e}}^{4\,c}+4\,{\mathrm {e}}^{4\,a}\,{\mathrm {e}}^{2\,c}\,{\mathrm {e}}^{2\,b\,x}+4\,{\mathrm {e}}^{6\,a}\,{\mathrm {e}}^{4\,c}\,{\mathrm {e}}^{2\,b\,x}\right )}{b}-\frac {\mathrm {coth}\left (a+c\right )\,\ln \left (4\,{\mathrm {e}}^{2\,a}\,{\mathrm {e}}^{2\,b\,x}+4\,{\mathrm {e}}^{2\,a}\,{\mathrm {e}}^{2\,c}+4\,{\mathrm {e}}^{4\,a}\,{\mathrm {e}}^{4\,c}+4\,{\mathrm {e}}^{4\,a}\,{\mathrm {e}}^{2\,c}\,{\mathrm {e}}^{2\,b\,x}\right )}{b}-x \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(tanh(a + b*x)*tanh(c - b*x),x)

[Out]

(coth(a + c)*log(4*exp(2*a)*exp(2*c) + 4*exp(4*a)*exp(4*c) + 4*exp(4*a)*exp(2*c)*exp(2*b*x) + 4*exp(6*a)*exp(4
*c)*exp(2*b*x)))/b - (coth(a + c)*log(4*exp(2*a)*exp(2*b*x) + 4*exp(2*a)*exp(2*c) + 4*exp(4*a)*exp(4*c) + 4*ex
p(4*a)*exp(2*c)*exp(2*b*x)))/b - x

________________________________________________________________________________________

sympy [F]  time = 0.00, size = 0, normalized size = 0.00 \[ - \int \tanh {\left (a + b x \right )} \tanh {\left (b x - c \right )}\, dx \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(-tanh(b*x-c)*tanh(b*x+a),x)

[Out]

-Integral(tanh(a + b*x)*tanh(b*x - c), x)

________________________________________________________________________________________