3.61 \(\int \frac {1}{a+b \tanh (c+d x)} \, dx\)

Optimal. Leaf size=50 \[ \frac {a x}{a^2-b^2}-\frac {b \log (a \cosh (c+d x)+b \sinh (c+d x))}{d \left (a^2-b^2\right )} \]

[Out]

a*x/(a^2-b^2)-b*ln(a*cosh(d*x+c)+b*sinh(d*x+c))/(a^2-b^2)/d

________________________________________________________________________________________

Rubi [A]  time = 0.05, antiderivative size = 50, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, integrand size = 12, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.167, Rules used = {3484, 3530} \[ \frac {a x}{a^2-b^2}-\frac {b \log (a \cosh (c+d x)+b \sinh (c+d x))}{d \left (a^2-b^2\right )} \]

Antiderivative was successfully verified.

[In]

Int[(a + b*Tanh[c + d*x])^(-1),x]

[Out]

(a*x)/(a^2 - b^2) - (b*Log[a*Cosh[c + d*x] + b*Sinh[c + d*x]])/((a^2 - b^2)*d)

Rule 3484

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

Rule 3530

Int[((c_) + (d_.)*tan[(e_.) + (f_.)*(x_)])/((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[(c*Log[Re
moveContent[a*Cos[e + f*x] + b*Sin[e + f*x], x]])/(b*f), x] /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d,
0] && NeQ[a^2 + b^2, 0] && EqQ[a*c + b*d, 0]

Rubi steps

\begin {align*} \int \frac {1}{a+b \tanh (c+d x)} \, dx &=\frac {a x}{a^2-b^2}-\frac {(i b) \int \frac {-i b-i a \tanh (c+d x)}{a+b \tanh (c+d x)} \, dx}{a^2-b^2}\\ &=\frac {a x}{a^2-b^2}-\frac {b \log (a \cosh (c+d x)+b \sinh (c+d x))}{\left (a^2-b^2\right ) d}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.09, size = 64, normalized size = 1.28 \[ \frac {(b-a) \log (1-\tanh (c+d x))+(a+b) \log (\tanh (c+d x)+1)-2 b \log (a+b \tanh (c+d x))}{2 d (a-b) (a+b)} \]

Antiderivative was successfully verified.

[In]

Integrate[(a + b*Tanh[c + d*x])^(-1),x]

[Out]

((-a + b)*Log[1 - Tanh[c + d*x]] + (a + b)*Log[1 + Tanh[c + d*x]] - 2*b*Log[a + b*Tanh[c + d*x]])/(2*(a - b)*(
a + b)*d)

________________________________________________________________________________________

fricas [A]  time = 0.52, size = 62, normalized size = 1.24 \[ \frac {{\left (a + b\right )} d x - b \log \left (\frac {2 \, {\left (a \cosh \left (d x + c\right ) + b \sinh \left (d x + c\right )\right )}}{\cosh \left (d x + c\right ) - \sinh \left (d x + c\right )}\right )}{{\left (a^{2} - b^{2}\right )} d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(a+b*tanh(d*x+c)),x, algorithm="fricas")

[Out]

((a + b)*d*x - b*log(2*(a*cosh(d*x + c) + b*sinh(d*x + c))/(cosh(d*x + c) - sinh(d*x + c))))/((a^2 - b^2)*d)

________________________________________________________________________________________

giac [A]  time = 0.13, size = 62, normalized size = 1.24 \[ -\frac {\frac {b \log \left ({\left | a e^{\left (2 \, d x + 2 \, c\right )} + b e^{\left (2 \, d x + 2 \, c\right )} + a - b \right |}\right )}{a^{2} - b^{2}} - \frac {d x + c}{a - b}}{d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

maple [A]  time = 0.09, size = 76, normalized size = 1.52 \[ -\frac {\ln \left (\tanh \left (d x +c \right )-1\right )}{d \left (2 b +2 a \right )}+\frac {\ln \left (1+\tanh \left (d x +c \right )\right )}{d \left (2 a -2 b \right )}-\frac {b \ln \left (a +b \tanh \left (d x +c \right )\right )}{d \left (a -b \right ) \left (a +b \right )} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(1/(a+b*tanh(d*x+c)),x)

[Out]

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

________________________________________________________________________________________

maxima [A]  time = 0.32, size = 56, normalized size = 1.12 \[ -\frac {b \log \left (-{\left (a - b\right )} e^{\left (-2 \, d x - 2 \, c\right )} - a - b\right )}{{\left (a^{2} - b^{2}\right )} d} + \frac {d x + c}{{\left (a + b\right )} d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

mupad [B]  time = 1.14, size = 60, normalized size = 1.20 \[ \frac {a\,x-b\,x}{a^2-b^2}+\frac {b\,\left (\ln \left (\mathrm {tanh}\left (c+d\,x\right )+1\right )-\ln \left (a+b\,\mathrm {tanh}\left (c+d\,x\right )\right )\right )}{d\,\left (a^2-b^2\right )} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(1/(a + b*tanh(c + d*x)),x)

[Out]

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

________________________________________________________________________________________

sympy [A]  time = 2.13, size = 224, normalized size = 4.48 \[ \begin {cases} \frac {\tilde {\infty } x}{\tanh {\relax (c )}} & \text {for}\: a = 0 \wedge b = 0 \wedge d = 0 \\- \frac {d x \tanh {\left (c + d x \right )}}{2 b d \tanh {\left (c + d x \right )} - 2 b d} + \frac {d x}{2 b d \tanh {\left (c + d x \right )} - 2 b d} + \frac {1}{2 b d \tanh {\left (c + d x \right )} - 2 b d} & \text {for}\: a = - b \\\frac {d x \tanh {\left (c + d x \right )}}{2 b d \tanh {\left (c + d x \right )} + 2 b d} + \frac {d x}{2 b d \tanh {\left (c + d x \right )} + 2 b d} - \frac {1}{2 b d \tanh {\left (c + d x \right )} + 2 b d} & \text {for}\: a = b \\\frac {x}{a + b \tanh {\relax (c )}} & \text {for}\: d = 0 \\\frac {x}{a} & \text {for}\: b = 0 \\\frac {a d x}{a^{2} d - b^{2} d} - \frac {b d x}{a^{2} d - b^{2} d} - \frac {b \log {\left (\frac {a}{b} + \tanh {\left (c + d x \right )} \right )}}{a^{2} d - b^{2} d} + \frac {b \log {\left (\tanh {\left (c + d x \right )} + 1 \right )}}{a^{2} d - b^{2} d} & \text {otherwise} \end {cases} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(a+b*tanh(d*x+c)),x)

[Out]

Piecewise((zoo*x/tanh(c), Eq(a, 0) & Eq(b, 0) & Eq(d, 0)), (-d*x*tanh(c + d*x)/(2*b*d*tanh(c + d*x) - 2*b*d) +
 d*x/(2*b*d*tanh(c + d*x) - 2*b*d) + 1/(2*b*d*tanh(c + d*x) - 2*b*d), Eq(a, -b)), (d*x*tanh(c + d*x)/(2*b*d*ta
nh(c + d*x) + 2*b*d) + d*x/(2*b*d*tanh(c + d*x) + 2*b*d) - 1/(2*b*d*tanh(c + d*x) + 2*b*d), Eq(a, b)), (x/(a +
 b*tanh(c)), Eq(d, 0)), (x/a, Eq(b, 0)), (a*d*x/(a**2*d - b**2*d) - b*d*x/(a**2*d - b**2*d) - b*log(a/b + tanh
(c + d*x))/(a**2*d - b**2*d) + b*log(tanh(c + d*x) + 1)/(a**2*d - b**2*d), True))

________________________________________________________________________________________