Integrand size = 15, antiderivative size = 100 \[ \int \frac {A+B \coth (x)}{a+b \cosh (x)} \, dx=\frac {2 A \text {arctanh}\left (\frac {\sqrt {a-b} \tanh \left (\frac {x}{2}\right )}{\sqrt {a+b}}\right )}{\sqrt {a-b} \sqrt {a+b}}+\frac {B \log (1-\cosh (x))}{2 (a+b)}+\frac {B \log (1+\cosh (x))}{2 (a-b)}-\frac {a B \log (a+b \cosh (x))}{a^2-b^2} \]
1/2*B*ln(1-cosh(x))/(a+b)+1/2*B*ln(1+cosh(x))/(a-b)-a*B*ln(a+b*cosh(x))/(a ^2-b^2)+2*A*arctanh((a-b)^(1/2)*tanh(1/2*x)/(a+b)^(1/2))/(a-b)^(1/2)/(a+b) ^(1/2)
Time = 0.34 (sec) , antiderivative size = 134, normalized size of antiderivative = 1.34 \[ \int \frac {A+B \coth (x)}{a+b \cosh (x)} \, dx=\frac {(A+B \coth (x)) \left (-2 A \left (a^2-b^2\right ) \arctan \left (\frac {(a-b) \tanh \left (\frac {x}{2}\right )}{\sqrt {-a^2+b^2}}\right )+\sqrt {-a^2+b^2} B \left ((a+b) \log \left (\cosh \left (\frac {x}{2}\right )\right )-a \log (a+b \cosh (x))+(a-b) \log \left (\sinh \left (\frac {x}{2}\right )\right )\right )\right ) \sinh (x)}{(a-b) (a+b) \sqrt {-a^2+b^2} (B \cosh (x)+A \sinh (x))} \]
((A + B*Coth[x])*(-2*A*(a^2 - b^2)*ArcTan[((a - b)*Tanh[x/2])/Sqrt[-a^2 + b^2]] + Sqrt[-a^2 + b^2]*B*((a + b)*Log[Cosh[x/2]] - a*Log[a + b*Cosh[x]] + (a - b)*Log[Sinh[x/2]]))*Sinh[x])/((a - b)*(a + b)*Sqrt[-a^2 + b^2]*(B*C osh[x] + A*Sinh[x]))
Time = 0.38 (sec) , antiderivative size = 100, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.200, Rules used = {3042, 4901, 2009}
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 {A+B \coth (x)}{a+b \cosh (x)} \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {A+i B \cot (i x)}{a+b \cos (i x)}dx\) |
\(\Big \downarrow \) 4901 |
\(\displaystyle \int \left (\frac {A}{a+b \cosh (x)}+\frac {B \coth (x)}{a+b \cosh (x)}\right )dx\) |
\(\Big \downarrow \) 2009 |
\(\displaystyle \frac {b B \text {arctanh}(\cosh (x))}{a^2-b^2}+\frac {a B \log (\sinh (x))}{a^2-b^2}-\frac {a B \log (a+b \cosh (x))}{a^2-b^2}+\frac {2 A \text {arctanh}\left (\frac {\sqrt {a-b} \tanh \left (\frac {x}{2}\right )}{\sqrt {a+b}}\right )}{\sqrt {a-b} \sqrt {a+b}}\) |
(b*B*ArcTanh[Cosh[x]])/(a^2 - b^2) + (2*A*ArcTanh[(Sqrt[a - b]*Tanh[x/2])/ Sqrt[a + b]])/(Sqrt[a - b]*Sqrt[a + b]) - (a*B*Log[a + b*Cosh[x]])/(a^2 - b^2) + (a*B*Log[Sinh[x]])/(a^2 - b^2)
3.3.3.3.1 Defintions of rubi rules used
Int[u_, x_Symbol] :> With[{v = ExpandTrig[u, x]}, Int[v, x] /; SumQ[v]] /; !InertTrigFreeQ[u]
Time = 0.23 (sec) , antiderivative size = 101, normalized size of antiderivative = 1.01
method | result | size |
default | \(\frac {B \ln \left (\tanh \left (\frac {x}{2}\right )\right )}{a +b}+\frac {-\frac {B a \ln \left (\tanh \left (\frac {x}{2}\right )^{2} a -\tanh \left (\frac {x}{2}\right )^{2} b -a -b \right )}{a -b}-\frac {\left (-2 A a -2 b A \right ) \operatorname {arctanh}\left (\frac {\left (a -b \right ) \tanh \left (\frac {x}{2}\right )}{\sqrt {\left (a +b \right ) \left (a -b \right )}}\right )}{\sqrt {\left (a +b \right ) \left (a -b \right )}}}{a +b}\) | \(101\) |
risch | \(-\frac {x B}{a -b}-\frac {x B}{a +b}-\frac {2 x \,a^{3} B}{-a^{4}+2 a^{2} b^{2}-b^{4}}+\frac {2 x B a \,b^{2}}{-a^{4}+2 a^{2} b^{2}-b^{4}}+\frac {B \ln \left ({\mathrm e}^{x}+1\right )}{a -b}+\frac {B \ln \left ({\mathrm e}^{x}-1\right )}{a +b}-\frac {\ln \left ({\mathrm e}^{x}+\frac {A a -\sqrt {A^{2} a^{2}-A^{2} b^{2}}}{b A}\right ) B a}{\left (a +b \right ) \left (a -b \right )}+\frac {\ln \left ({\mathrm e}^{x}+\frac {A a -\sqrt {A^{2} a^{2}-A^{2} b^{2}}}{b A}\right ) \sqrt {A^{2} a^{2}-A^{2} b^{2}}}{\left (a +b \right ) \left (a -b \right )}-\frac {\ln \left ({\mathrm e}^{x}+\frac {A a +\sqrt {A^{2} a^{2}-A^{2} b^{2}}}{b A}\right ) B a}{\left (a +b \right ) \left (a -b \right )}-\frac {\ln \left ({\mathrm e}^{x}+\frac {A a +\sqrt {A^{2} a^{2}-A^{2} b^{2}}}{b A}\right ) \sqrt {A^{2} a^{2}-A^{2} b^{2}}}{\left (a +b \right ) \left (a -b \right )}\) | \(336\) |
B/(a+b)*ln(tanh(1/2*x))+1/(a+b)*(-B*a/(a-b)*ln(tanh(1/2*x)^2*a-tanh(1/2*x) ^2*b-a-b)-(-2*A*a-2*A*b)/((a+b)*(a-b))^(1/2)*arctanh((a-b)*tanh(1/2*x)/((a +b)*(a-b))^(1/2)))
Time = 1.14 (sec) , antiderivative size = 303, normalized size of antiderivative = 3.03 \[ \int \frac {A+B \coth (x)}{a+b \cosh (x)} \, dx=\left [-\frac {B a \log \left (\frac {2 \, {\left (b \cosh \left (x\right ) + a\right )}}{\cosh \left (x\right ) - \sinh \left (x\right )}\right ) - \sqrt {a^{2} - b^{2}} A \log \left (\frac {b^{2} \cosh \left (x\right )^{2} + b^{2} \sinh \left (x\right )^{2} + 2 \, a b \cosh \left (x\right ) + 2 \, a^{2} - b^{2} + 2 \, {\left (b^{2} \cosh \left (x\right ) + a b\right )} \sinh \left (x\right ) - 2 \, \sqrt {a^{2} - b^{2}} {\left (b \cosh \left (x\right ) + b \sinh \left (x\right ) + a\right )}}{b \cosh \left (x\right )^{2} + b \sinh \left (x\right )^{2} + 2 \, a \cosh \left (x\right ) + 2 \, {\left (b \cosh \left (x\right ) + a\right )} \sinh \left (x\right ) + b}\right ) - {\left (B a + B b\right )} \log \left (\cosh \left (x\right ) + \sinh \left (x\right ) + 1\right ) - {\left (B a - B b\right )} \log \left (\cosh \left (x\right ) + \sinh \left (x\right ) - 1\right )}{a^{2} - b^{2}}, -\frac {B a \log \left (\frac {2 \, {\left (b \cosh \left (x\right ) + a\right )}}{\cosh \left (x\right ) - \sinh \left (x\right )}\right ) + 2 \, \sqrt {-a^{2} + b^{2}} A \arctan \left (-\frac {\sqrt {-a^{2} + b^{2}} {\left (b \cosh \left (x\right ) + b \sinh \left (x\right ) + a\right )}}{a^{2} - b^{2}}\right ) - {\left (B a + B b\right )} \log \left (\cosh \left (x\right ) + \sinh \left (x\right ) + 1\right ) - {\left (B a - B b\right )} \log \left (\cosh \left (x\right ) + \sinh \left (x\right ) - 1\right )}{a^{2} - b^{2}}\right ] \]
[-(B*a*log(2*(b*cosh(x) + a)/(cosh(x) - sinh(x))) - sqrt(a^2 - b^2)*A*log( (b^2*cosh(x)^2 + b^2*sinh(x)^2 + 2*a*b*cosh(x) + 2*a^2 - b^2 + 2*(b^2*cosh (x) + a*b)*sinh(x) - 2*sqrt(a^2 - b^2)*(b*cosh(x) + b*sinh(x) + a))/(b*cos h(x)^2 + b*sinh(x)^2 + 2*a*cosh(x) + 2*(b*cosh(x) + a)*sinh(x) + b)) - (B* a + B*b)*log(cosh(x) + sinh(x) + 1) - (B*a - B*b)*log(cosh(x) + sinh(x) - 1))/(a^2 - b^2), -(B*a*log(2*(b*cosh(x) + a)/(cosh(x) - sinh(x))) + 2*sqrt (-a^2 + b^2)*A*arctan(-sqrt(-a^2 + b^2)*(b*cosh(x) + b*sinh(x) + a)/(a^2 - b^2)) - (B*a + B*b)*log(cosh(x) + sinh(x) + 1) - (B*a - B*b)*log(cosh(x) + sinh(x) - 1))/(a^2 - b^2)]
\[ \int \frac {A+B \coth (x)}{a+b \cosh (x)} \, dx=\int \frac {A + B \coth {\left (x \right )}}{a + b \cosh {\left (x \right )}}\, dx \]
Exception generated. \[ \int \frac {A+B \coth (x)}{a+b \cosh (x)} \, dx=\text {Exception raised: ValueError} \]
Exception raised: ValueError >> Computation failed since Maxima requested additional constraints; using the 'assume' command before evaluation *may* help (example of legal syntax is 'assume(4*a^2-4*b^2>0)', see `assume?` f or more de
Time = 0.27 (sec) , antiderivative size = 90, normalized size of antiderivative = 0.90 \[ \int \frac {A+B \coth (x)}{a+b \cosh (x)} \, dx=-\frac {B a \log \left (b e^{\left (2 \, x\right )} + 2 \, a e^{x} + b\right )}{a^{2} - b^{2}} + \frac {2 \, A \arctan \left (\frac {b e^{x} + a}{\sqrt {-a^{2} + b^{2}}}\right )}{\sqrt {-a^{2} + b^{2}}} + \frac {B \log \left (e^{x} + 1\right )}{a - b} + \frac {B \log \left ({\left | e^{x} - 1 \right |}\right )}{a + b} \]
-B*a*log(b*e^(2*x) + 2*a*e^x + b)/(a^2 - b^2) + 2*A*arctan((b*e^x + a)/sqr t(-a^2 + b^2))/sqrt(-a^2 + b^2) + B*log(e^x + 1)/(a - b) + B*log(abs(e^x - 1))/(a + b)
Time = 4.65 (sec) , antiderivative size = 974, normalized size of antiderivative = 9.74 \[ \int \frac {A+B \coth (x)}{a+b \cosh (x)} \, dx=\frac {B\,\ln \left ({\mathrm {e}}^x+1\right )}{a-b}+\frac {\ln \left (\frac {\left (\frac {32\,\left (A^2\,a^2\,b+2\,{\mathrm {e}}^x\,A^2\,a\,b^2+A^2\,b^3+8\,{\mathrm {e}}^x\,A\,B\,a^3+4\,A\,B\,a^2\,b-2\,{\mathrm {e}}^x\,A\,B\,a\,b^2+4\,{\mathrm {e}}^x\,B^2\,a^3+3\,B^2\,a^2\,b+5\,{\mathrm {e}}^x\,B^2\,a\,b^2+B^2\,b^3\right )}{b^5}+\frac {\left (A\,\sqrt {{\left (a+b\right )}^3\,{\left (a-b\right )}^3}-B\,a^3+B\,a\,b^2\right )\,\left (128\,{\mathrm {e}}^x\,{\left (a^2-b^2\right )}^3\,\left (A-2\,B\right )+a\,b^5\,\left (64\,A-128\,B\right )+a^5\,b\,\left (64\,A-128\,B\right )+96\,b^6\,{\mathrm {e}}^x\,\left (A-3\,B\right )-a^3\,b^3\,\left (128\,A-256\,B\right )-192\,a^2\,b^4\,{\mathrm {e}}^x\,\left (A-3\,B\right )+96\,a^4\,b^2\,{\mathrm {e}}^x\,\left (A-3\,B\right )+128\,A\,a^3\,{\mathrm {e}}^x\,\sqrt {{\left (a^2-b^2\right )}^3}+96\,A\,a^2\,b\,\sqrt {{\left (a^2-b^2\right )}^3}-32\,A\,a\,b^2\,{\mathrm {e}}^x\,\sqrt {{\left (a^2-b^2\right )}^3}\right )}{\left (b^7-a^2\,b^5\right )\,{\left (a^2-b^2\right )}^2}\right )\,\left (A\,\sqrt {{\left (a+b\right )}^3\,{\left (a-b\right )}^3}-B\,a^3+B\,a\,b^2\right )}{{\left (a^2-b^2\right )}^2}-\frac {32\,B\,\left (A^2\,a\,b+{\mathrm {e}}^x\,A^2\,b^2+4\,{\mathrm {e}}^x\,A\,B\,a^2+2\,A\,B\,a\,b-{\mathrm {e}}^x\,A\,B\,b^2+4\,{\mathrm {e}}^x\,B^2\,a^2+B^2\,a\,b\right )}{b^5}\right )\,\left (A\,\sqrt {{\left (a+b\right )}^3\,{\left (a-b\right )}^3}-B\,a^3+B\,a\,b^2\right )}{a^4-2\,a^2\,b^2+b^4}-\frac {\ln \left (-\frac {32\,B\,\left (A^2\,a\,b+{\mathrm {e}}^x\,A^2\,b^2+4\,{\mathrm {e}}^x\,A\,B\,a^2+2\,A\,B\,a\,b-{\mathrm {e}}^x\,A\,B\,b^2+4\,{\mathrm {e}}^x\,B^2\,a^2+B^2\,a\,b\right )}{b^5}-\frac {\left (\frac {32\,\left (A^2\,a^2\,b+2\,{\mathrm {e}}^x\,A^2\,a\,b^2+A^2\,b^3+8\,{\mathrm {e}}^x\,A\,B\,a^3+4\,A\,B\,a^2\,b-2\,{\mathrm {e}}^x\,A\,B\,a\,b^2+4\,{\mathrm {e}}^x\,B^2\,a^3+3\,B^2\,a^2\,b+5\,{\mathrm {e}}^x\,B^2\,a\,b^2+B^2\,b^3\right )}{b^5}-\frac {\left (B\,a^3+A\,\sqrt {{\left (a+b\right )}^3\,{\left (a-b\right )}^3}-B\,a\,b^2\right )\,\left (128\,{\mathrm {e}}^x\,{\left (a^2-b^2\right )}^3\,\left (A-2\,B\right )+a\,b^5\,\left (64\,A-128\,B\right )+a^5\,b\,\left (64\,A-128\,B\right )+96\,b^6\,{\mathrm {e}}^x\,\left (A-3\,B\right )-a^3\,b^3\,\left (128\,A-256\,B\right )-192\,a^2\,b^4\,{\mathrm {e}}^x\,\left (A-3\,B\right )+96\,a^4\,b^2\,{\mathrm {e}}^x\,\left (A-3\,B\right )-128\,A\,a^3\,{\mathrm {e}}^x\,\sqrt {{\left (a^2-b^2\right )}^3}-96\,A\,a^2\,b\,\sqrt {{\left (a^2-b^2\right )}^3}+32\,A\,a\,b^2\,{\mathrm {e}}^x\,\sqrt {{\left (a^2-b^2\right )}^3}\right )}{\left (b^7-a^2\,b^5\right )\,{\left (a^2-b^2\right )}^2}\right )\,\left (B\,a^3+A\,\sqrt {{\left (a+b\right )}^3\,{\left (a-b\right )}^3}-B\,a\,b^2\right )}{{\left (a^2-b^2\right )}^2}\right )\,\left (B\,a^3+A\,\sqrt {{\left (a+b\right )}^3\,{\left (a-b\right )}^3}-B\,a\,b^2\right )}{a^4-2\,a^2\,b^2+b^4}+\frac {B\,\ln \left ({\mathrm {e}}^x-1\right )}{a+b} \]
(B*log(exp(x) + 1))/(a - b) + (log((((32*(A^2*b^3 + B^2*b^3 + A^2*a^2*b + 3*B^2*a^2*b + 4*B^2*a^3*exp(x) + 5*B^2*a*b^2*exp(x) + 4*A*B*a^2*b + 8*A*B* a^3*exp(x) + 2*A^2*a*b^2*exp(x) - 2*A*B*a*b^2*exp(x)))/b^5 + ((A*((a + b)^ 3*(a - b)^3)^(1/2) - B*a^3 + B*a*b^2)*(128*exp(x)*(a^2 - b^2)^3*(A - 2*B) + a*b^5*(64*A - 128*B) + a^5*b*(64*A - 128*B) + 96*b^6*exp(x)*(A - 3*B) - a^3*b^3*(128*A - 256*B) - 192*a^2*b^4*exp(x)*(A - 3*B) + 96*a^4*b^2*exp(x) *(A - 3*B) + 128*A*a^3*exp(x)*((a^2 - b^2)^3)^(1/2) + 96*A*a^2*b*((a^2 - b ^2)^3)^(1/2) - 32*A*a*b^2*exp(x)*((a^2 - b^2)^3)^(1/2)))/((b^7 - a^2*b^5)* (a^2 - b^2)^2))*(A*((a + b)^3*(a - b)^3)^(1/2) - B*a^3 + B*a*b^2))/(a^2 - b^2)^2 - (32*B*(A^2*b^2*exp(x) + 4*B^2*a^2*exp(x) + A^2*a*b + B^2*a*b + 4* A*B*a^2*exp(x) - A*B*b^2*exp(x) + 2*A*B*a*b))/b^5)*(A*((a + b)^3*(a - b)^3 )^(1/2) - B*a^3 + B*a*b^2))/(a^4 + b^4 - 2*a^2*b^2) - (log(- (32*B*(A^2*b^ 2*exp(x) + 4*B^2*a^2*exp(x) + A^2*a*b + B^2*a*b + 4*A*B*a^2*exp(x) - A*B*b ^2*exp(x) + 2*A*B*a*b))/b^5 - (((32*(A^2*b^3 + B^2*b^3 + A^2*a^2*b + 3*B^2 *a^2*b + 4*B^2*a^3*exp(x) + 5*B^2*a*b^2*exp(x) + 4*A*B*a^2*b + 8*A*B*a^3*e xp(x) + 2*A^2*a*b^2*exp(x) - 2*A*B*a*b^2*exp(x)))/b^5 - ((B*a^3 + A*((a + b)^3*(a - b)^3)^(1/2) - B*a*b^2)*(128*exp(x)*(a^2 - b^2)^3*(A - 2*B) + a*b ^5*(64*A - 128*B) + a^5*b*(64*A - 128*B) + 96*b^6*exp(x)*(A - 3*B) - a^3*b ^3*(128*A - 256*B) - 192*a^2*b^4*exp(x)*(A - 3*B) + 96*a^4*b^2*exp(x)*(A - 3*B) - 128*A*a^3*exp(x)*((a^2 - b^2)^3)^(1/2) - 96*A*a^2*b*((a^2 - b^2...