### 3.135 $$\int \tanh (a+b x) \tanh (c+b x) \, dx$$

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

[Out]

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

________________________________________________________________________________________

Rubi [A]  time = 0.0695035, antiderivative size = 37, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 3, integrand size = 13, $$\frac{\text{number of rules}}{\text{integrand size}}$$ = 0.231, Rules used = {5646, 5644, 3475} $-\frac{\coth (a-c) \log (\cosh (a+b x))}{b}+\frac{\coth (a-c) \log (\cosh (b x+c))}{b}+x$

Antiderivative was successfully veriﬁed.

[In]

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

[Out]

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

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]

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 3475

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

Rubi steps

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

Mathematica [A]  time = 0.472242, size = 29, normalized size = 0.78 $\frac{\coth (a-c) (\log (\cosh (b x+c))-\log (\cosh (a+b x)))}{b}+x$

Antiderivative was successfully veriﬁed.

[In]

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

[Out]

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

________________________________________________________________________________________

Maple [B]  time = 0.044, size = 151, normalized size = 4.1 \begin{align*} x-{\frac{\ln \left ( 1+{{\rm e}^{2\,bx+2\,a}} \right ){{\rm e}^{2\,a}}}{b \left ({{\rm e}^{2\,a}}-{{\rm e}^{2\,c}} \right ) }}-{\frac{\ln \left ( 1+{{\rm e}^{2\,bx+2\,a}} \right ){{\rm e}^{2\,c}}}{b \left ({{\rm e}^{2\,a}}-{{\rm e}^{2\,c}} \right ) }}+{\frac{\ln \left ({{\rm e}^{2\,bx+2\,a}}+{{\rm e}^{2\,a-2\,c}} \right ){{\rm e}^{2\,a}}}{b \left ({{\rm e}^{2\,a}}-{{\rm e}^{2\,c}} \right ) }}+{\frac{\ln \left ({{\rm e}^{2\,bx+2\,a}}+{{\rm e}^{2\,a-2\,c}} \right ){{\rm e}^{2\,c}}}{b \left ({{\rm e}^{2\,a}}-{{\rm e}^{2\,c}} \right ) }} \end{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Maxima [B]  time = 1.71078, size = 112, normalized size = 3.03 \begin{align*} x + \frac{a}{b} - \frac{{\left (e^{\left (2 \, a\right )} + e^{\left (2 \, c\right )}\right )} \log \left (e^{\left (-2 \, b x - 2 \, a\right )} + 1\right )}{b{\left (e^{\left (2 \, a\right )} - e^{\left (2 \, c\right )}\right )}} + \frac{{\left (e^{\left (2 \, a\right )} + e^{\left (2 \, c\right )}\right )} \log \left (e^{\left (-2 \, b x\right )} + e^{\left (2 \, c\right )}\right )}{b{\left (e^{\left (2 \, a\right )} - e^{\left (2 \, c\right )}\right )}} \end{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Fricas [B]  time = 1.98148, size = 701, normalized size = 18.95 \begin{align*} \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 + c\right ) \cosh \left (-a + c\right ) - \sinh \left (b x + c\right ) \sinh \left (-a + c\right )\right )}}{\cosh \left (b x + c\right ) \cosh \left (-a + c\right ) -{\left (\cosh \left (-a + c\right ) + \sinh \left (-a + c\right )\right )} \sinh \left (b x + c\right ) + \cosh \left (b x + c\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 + c\right )}{\cosh \left (b x + c\right ) - \sinh \left (b x + c\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} \end{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

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

________________________________________________________________________________________

Sympy [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \tanh{\left (a + b x \right )} \tanh{\left (b x + c \right )}\, dx \end{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Giac [B]  time = 1.47571, size = 149, normalized size = 4.03 \begin{align*} \frac{b x - \frac{{\left (e^{\left (2 \, a\right )} + e^{\left (2 \, c\right )}\right )} \log \left (\frac{{\left | -{\left | e^{\left (2 \, a\right )} - e^{\left (2 \, c\right )} \right |} + 2 \, e^{\left (2 \, b x + 2 \, a + 2 \, c\right )} + e^{\left (2 \, a\right )} + e^{\left (2 \, c\right )} \right |}}{{\left | e^{\left (2 \, a\right )} - e^{\left (2 \, c\right )} \right |} + 2 \, e^{\left (2 \, b x + 2 \, a + 2 \, c\right )} + e^{\left (2 \, a\right )} + e^{\left (2 \, c\right )}}\right )}{{\left | e^{\left (2 \, a\right )} - e^{\left (2 \, c\right )} \right |}}}{b} \end{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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