Integrand size = 11, antiderivative size = 51 \[ \int \frac {\coth (x)}{a+b \tanh (x)} \, dx=-\frac {b x}{a^2-b^2}+\frac {\log (\sinh (x))}{a}+\frac {b^2 \log (a \cosh (x)+b \sinh (x))}{a \left (a^2-b^2\right )} \] Output:
-b*x/(a^2-b^2)+ln(sinh(x))/a+b^2*ln(a*cosh(x)+b*sinh(x))/a/(a^2-b^2)
Time = 0.12 (sec) , antiderivative size = 65, normalized size of antiderivative = 1.27 \[ \int \frac {\coth (x)}{a+b \tanh (x)} \, dx=-\frac {\log (1-\tanh (x))}{2 (a+b)}+\frac {\log (\tanh (x))}{a}-\frac {\log (1+\tanh (x))}{2 (a-b)}+\frac {b^2 \log (a+b \tanh (x))}{a \left (a^2-b^2\right )} \] Input:
Integrate[Coth[x]/(a + b*Tanh[x]),x]
Output:
-1/2*Log[1 - Tanh[x]]/(a + b) + Log[Tanh[x]]/a - Log[1 + Tanh[x]]/(2*(a - b)) + (b^2*Log[a + b*Tanh[x]])/(a*(a^2 - b^2))
Result contains complex when optimal does not.
Time = 0.41 (sec) , antiderivative size = 63, normalized size of antiderivative = 1.24, number of steps used = 8, number of rules used = 8, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.727, Rules used = {3042, 26, 4054, 26, 3042, 26, 3956, 4013}
Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.
\(\displaystyle \int \frac {\coth (x)}{a+b \tanh (x)} \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {i}{\tan (i x) (a-i b \tan (i x))}dx\) |
\(\Big \downarrow \) 26 |
\(\displaystyle i \int \frac {1}{\tan (i x) (a-i b \tan (i x))}dx\) |
\(\Big \downarrow \) 4054 |
\(\displaystyle i \left (\frac {b^2 \int -\frac {i (b+a \tanh (x))}{a+b \tanh (x)}dx}{a \left (a^2-b^2\right )}+\frac {\int -i \coth (x)dx}{a}+\frac {i b x}{a^2-b^2}\right )\) |
\(\Big \downarrow \) 26 |
\(\displaystyle i \left (-\frac {i b^2 \int \frac {b+a \tanh (x)}{a+b \tanh (x)}dx}{a \left (a^2-b^2\right )}-\frac {i \int \coth (x)dx}{a}+\frac {i b x}{a^2-b^2}\right )\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle i \left (-\frac {i b^2 \int \frac {b-i a \tan (i x)}{a-i b \tan (i x)}dx}{a \left (a^2-b^2\right )}-\frac {i \int -i \tan \left (i x+\frac {\pi }{2}\right )dx}{a}+\frac {i b x}{a^2-b^2}\right )\) |
\(\Big \downarrow \) 26 |
\(\displaystyle i \left (-\frac {i b^2 \int \frac {b-i a \tan (i x)}{a-i b \tan (i x)}dx}{a \left (a^2-b^2\right )}-\frac {\int \tan \left (i x+\frac {\pi }{2}\right )dx}{a}+\frac {i b x}{a^2-b^2}\right )\) |
\(\Big \downarrow \) 3956 |
\(\displaystyle i \left (-\frac {i b^2 \int \frac {b-i a \tan (i x)}{a-i b \tan (i x)}dx}{a \left (a^2-b^2\right )}+\frac {i b x}{a^2-b^2}-\frac {i \log (\sinh (x))}{a}\right )\) |
\(\Big \downarrow \) 4013 |
\(\displaystyle i \left (\frac {i b x}{a^2-b^2}-\frac {i b^2 \log (a \cosh (x)+b \sinh (x))}{a \left (a^2-b^2\right )}-\frac {i \log (\sinh (x))}{a}\right )\) |
Input:
Int[Coth[x]/(a + b*Tanh[x]),x]
Output:
I*((I*b*x)/(a^2 - b^2) - (I*Log[Sinh[x]])/a - (I*b^2*Log[a*Cosh[x] + b*Sin h[x]])/(a*(a^2 - b^2)))
Int[(Complex[0, a_])*(Fx_), x_Symbol] :> Simp[(Complex[Identity[0], a]) I nt[Fx, x], x] /; FreeQ[a, x] && EqQ[a^2, 1]
Int[tan[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-Log[RemoveContent[Cos[c + d *x], x]]/d, x] /; FreeQ[{c, d}, x]
Int[((c_) + (d_.)*tan[(e_.) + (f_.)*(x_)])/((a_) + (b_.)*tan[(e_.) + (f_.)* (x_)]), x_Symbol] :> Simp[(c/(b*f))*Log[RemoveContent[a*Cos[e + f*x] + b*Si n[e + f*x], x]], 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]
Int[1/(((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])*((c_.) + (d_.)*tan[(e_.) + (f _.)*(x_)])), x_Symbol] :> Simp[(a*c - b*d)*(x/((a^2 + b^2)*(c^2 + d^2))), x ] + (Simp[b^2/((b*c - a*d)*(a^2 + b^2)) Int[(b - a*Tan[e + f*x])/(a + b*T an[e + f*x]), x], x] - Simp[d^2/((b*c - a*d)*(c^2 + d^2)) Int[(d - c*Tan[ e + f*x])/(c + d*Tan[e + f*x]), x], x]) /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d, 0] && NeQ[a^2 + b^2, 0] && NeQ[c^2 + d^2, 0]
Time = 0.42 (sec) , antiderivative size = 56, normalized size of antiderivative = 1.10
method | result | size |
parallelrisch | \(\frac {b^{2} \ln \left (a +b \tanh \left (x \right )\right )-a^{2} \ln \left (1-\tanh \left (x \right )\right )-\left (a +b \right ) \left (\left (-a +b \right ) \ln \left (\tanh \left (x \right )\right )+a x \right )}{a^{3}-b^{2} a}\) | \(56\) |
derivativedivides | \(-\frac {\ln \left (1+\tanh \left (x \right )\right )}{2 a -2 b}+\frac {\ln \left (\tanh \left (x \right )\right )}{a}+\frac {b^{2} \ln \left (a +b \tanh \left (x \right )\right )}{a \left (a +b \right ) \left (a -b \right )}-\frac {\ln \left (\tanh \left (x \right )-1\right )}{2 b +2 a}\) | \(67\) |
default | \(-\frac {\ln \left (1+\tanh \left (x \right )\right )}{2 a -2 b}+\frac {\ln \left (\tanh \left (x \right )\right )}{a}+\frac {b^{2} \ln \left (a +b \tanh \left (x \right )\right )}{a \left (a +b \right ) \left (a -b \right )}-\frac {\ln \left (\tanh \left (x \right )-1\right )}{2 b +2 a}\) | \(67\) |
risch | \(\frac {x}{a +b}-\frac {2 x}{a}-\frac {2 x \,b^{2}}{a \left (a^{2}-b^{2}\right )}+\frac {\ln \left ({\mathrm e}^{2 x}-1\right )}{a}+\frac {b^{2} \ln \left ({\mathrm e}^{2 x}+\frac {a -b}{a +b}\right )}{a \left (a^{2}-b^{2}\right )}\) | \(81\) |
Input:
int(coth(x)/(a+b*tanh(x)),x,method=_RETURNVERBOSE)
Output:
(b^2*ln(a+b*tanh(x))-a^2*ln(1-tanh(x))-(a+b)*((-a+b)*ln(tanh(x))+a*x))/(a^ 3-a*b^2)
Time = 0.10 (sec) , antiderivative size = 73, normalized size of antiderivative = 1.43 \[ \int \frac {\coth (x)}{a+b \tanh (x)} \, dx=\frac {b^{2} \log \left (\frac {2 \, {\left (a \cosh \left (x\right ) + b \sinh \left (x\right )\right )}}{\cosh \left (x\right ) - \sinh \left (x\right )}\right ) - {\left (a^{2} + a b\right )} x + {\left (a^{2} - b^{2}\right )} \log \left (\frac {2 \, \sinh \left (x\right )}{\cosh \left (x\right ) - \sinh \left (x\right )}\right )}{a^{3} - a b^{2}} \] Input:
integrate(coth(x)/(a+b*tanh(x)),x, algorithm="fricas")
Output:
(b^2*log(2*(a*cosh(x) + b*sinh(x))/(cosh(x) - sinh(x))) - (a^2 + a*b)*x + (a^2 - b^2)*log(2*sinh(x)/(cosh(x) - sinh(x))))/(a^3 - a*b^2)
\[ \int \frac {\coth (x)}{a+b \tanh (x)} \, dx=\int \frac {\coth {\left (x \right )}}{a + b \tanh {\left (x \right )}}\, dx \] Input:
integrate(coth(x)/(a+b*tanh(x)),x)
Output:
Integral(coth(x)/(a + b*tanh(x)), x)
Time = 0.04 (sec) , antiderivative size = 65, normalized size of antiderivative = 1.27 \[ \int \frac {\coth (x)}{a+b \tanh (x)} \, dx=\frac {b^{2} \log \left (-{\left (a - b\right )} e^{\left (-2 \, x\right )} - a - b\right )}{a^{3} - a b^{2}} + \frac {x}{a + b} + \frac {\log \left (e^{\left (-x\right )} + 1\right )}{a} + \frac {\log \left (e^{\left (-x\right )} - 1\right )}{a} \] Input:
integrate(coth(x)/(a+b*tanh(x)),x, algorithm="maxima")
Output:
b^2*log(-(a - b)*e^(-2*x) - a - b)/(a^3 - a*b^2) + x/(a + b) + log(e^(-x) + 1)/a + log(e^(-x) - 1)/a
Time = 0.12 (sec) , antiderivative size = 58, normalized size of antiderivative = 1.14 \[ \int \frac {\coth (x)}{a+b \tanh (x)} \, dx=\frac {b^{2} \log \left ({\left | a e^{\left (2 \, x\right )} + b e^{\left (2 \, x\right )} + a - b \right |}\right )}{a^{3} - a b^{2}} - \frac {x}{a - b} + \frac {\log \left ({\left | e^{\left (2 \, x\right )} - 1 \right |}\right )}{a} \] Input:
integrate(coth(x)/(a+b*tanh(x)),x, algorithm="giac")
Output:
b^2*log(abs(a*e^(2*x) + b*e^(2*x) + a - b))/(a^3 - a*b^2) - x/(a - b) + lo g(abs(e^(2*x) - 1))/a
Time = 2.40 (sec) , antiderivative size = 58, normalized size of antiderivative = 1.14 \[ \int \frac {\coth (x)}{a+b \tanh (x)} \, dx=\frac {\ln \left ({\mathrm {e}}^{2\,x}-1\right )}{a}-\frac {x}{a-b}-\frac {b^2\,\ln \left (a-b+a\,{\mathrm {e}}^{2\,x}+b\,{\mathrm {e}}^{2\,x}\right )}{a\,b^2-a^3} \] Input:
int(coth(x)/(a + b*tanh(x)),x)
Output:
log(exp(2*x) - 1)/a - x/(a - b) - (b^2*log(a - b + a*exp(2*x) + b*exp(2*x) ))/(a*b^2 - a^3)
Time = 0.28 (sec) , antiderivative size = 93, normalized size of antiderivative = 1.82 \[ \int \frac {\coth (x)}{a+b \tanh (x)} \, dx=\frac {\mathrm {log}\left (e^{x}-1\right ) a^{2}-\mathrm {log}\left (e^{x}-1\right ) b^{2}+\mathrm {log}\left (e^{x}+1\right ) a^{2}-\mathrm {log}\left (e^{x}+1\right ) b^{2}+\mathrm {log}\left (e^{2 x} a +e^{2 x} b +a -b \right ) b^{2}-a^{2} x -a b x}{a \left (a^{2}-b^{2}\right )} \] Input:
int(coth(x)/(a+b*tanh(x)),x)
Output:
(log(e**x - 1)*a**2 - log(e**x - 1)*b**2 + log(e**x + 1)*a**2 - log(e**x + 1)*b**2 + log(e**(2*x)*a + e**(2*x)*b + a - b)*b**2 - a**2*x - a*b*x)/(a* (a**2 - b**2))