Integrand size = 15, antiderivative size = 58 \[ \int \frac {a+b \text {csch}(x)}{c+d \sinh (x)} \, dx=-\frac {b \text {arctanh}(\cosh (x))}{c}-\frac {2 (a c-b d) \text {arctanh}\left (\frac {d-c \tanh \left (\frac {x}{2}\right )}{\sqrt {c^2+d^2}}\right )}{c \sqrt {c^2+d^2}} \]
-b*arctanh(cosh(x))/c-2*(a*c-b*d)*arctanh((d-c*tanh(1/2*x))/(c^2+d^2)^(1/2 ))/c/(c^2+d^2)^(1/2)
Time = 1.20 (sec) , antiderivative size = 77, normalized size of antiderivative = 1.33 \[ \int \frac {a+b \text {csch}(x)}{c+d \sinh (x)} \, dx=\frac {\frac {2 (a c-b d) \arctan \left (\frac {d-c \tanh \left (\frac {x}{2}\right )}{\sqrt {-c^2-d^2}}\right )}{\sqrt {-c^2-d^2}}+b \left (-\log \left (\cosh \left (\frac {x}{2}\right )\right )+\log \left (\sinh \left (\frac {x}{2}\right )\right )\right )}{c} \]
((2*(a*c - b*d)*ArcTan[(d - c*Tanh[x/2])/Sqrt[-c^2 - d^2]])/Sqrt[-c^2 - d^ 2] + b*(-Log[Cosh[x/2]] + Log[Sinh[x/2]]))/c
Result contains complex when optimal does not.
Time = 0.47 (sec) , antiderivative size = 71, normalized size of antiderivative = 1.22, number of steps used = 15, number of rules used = 14, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.933, Rules used = {3042, 3307, 26, 26, 3042, 26, 3480, 26, 3042, 26, 3139, 1083, 219, 4257}
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 \text {csch}(x)}{c+d \sinh (x)} \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {a+i b \csc (i x)}{c-i d \sin (i x)}dx\) |
\(\Big \downarrow \) 3307 |
\(\displaystyle \int -\frac {i \text {csch}(x) (i a \sinh (x)+i b)}{c+d \sinh (x)}dx\) |
\(\Big \downarrow \) 26 |
\(\displaystyle -i \int \frac {i \text {csch}(x) (b+a \sinh (x))}{c+d \sinh (x)}dx\) |
\(\Big \downarrow \) 26 |
\(\displaystyle \int \frac {\text {csch}(x) (a \sinh (x)+b)}{c+d \sinh (x)}dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {i (b-i a \sin (i x))}{\sin (i x) (c-i d \sin (i x))}dx\) |
\(\Big \downarrow \) 26 |
\(\displaystyle i \int \frac {b-i a \sin (i x)}{\sin (i x) (c-i d \sin (i x))}dx\) |
\(\Big \downarrow \) 3480 |
\(\displaystyle i \left (\frac {b \int -i \text {csch}(x)dx}{c}-\frac {i (a c-b d) \int \frac {1}{c+d \sinh (x)}dx}{c}\right )\) |
\(\Big \downarrow \) 26 |
\(\displaystyle i \left (-\frac {i (a c-b d) \int \frac {1}{c+d \sinh (x)}dx}{c}-\frac {i b \int \text {csch}(x)dx}{c}\right )\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle i \left (-\frac {i (a c-b d) \int \frac {1}{c-i d \sin (i x)}dx}{c}-\frac {i b \int i \csc (i x)dx}{c}\right )\) |
\(\Big \downarrow \) 26 |
\(\displaystyle i \left (\frac {b \int \csc (i x)dx}{c}-\frac {i (a c-b d) \int \frac {1}{c-i d \sin (i x)}dx}{c}\right )\) |
\(\Big \downarrow \) 3139 |
\(\displaystyle i \left (\frac {b \int \csc (i x)dx}{c}-\frac {2 i (a c-b d) \int \frac {1}{-c \tanh ^2\left (\frac {x}{2}\right )+2 d \tanh \left (\frac {x}{2}\right )+c}d\tanh \left (\frac {x}{2}\right )}{c}\right )\) |
\(\Big \downarrow \) 1083 |
\(\displaystyle i \left (\frac {4 i (a c-b d) \int \frac {1}{4 \left (c^2+d^2\right )-\left (2 d-2 c \tanh \left (\frac {x}{2}\right )\right )^2}d\left (2 d-2 c \tanh \left (\frac {x}{2}\right )\right )}{c}+\frac {b \int \csc (i x)dx}{c}\right )\) |
\(\Big \downarrow \) 219 |
\(\displaystyle i \left (\frac {b \int \csc (i x)dx}{c}+\frac {2 i (a c-b d) \text {arctanh}\left (\frac {2 d-2 c \tanh \left (\frac {x}{2}\right )}{2 \sqrt {c^2+d^2}}\right )}{c \sqrt {c^2+d^2}}\right )\) |
\(\Big \downarrow \) 4257 |
\(\displaystyle i \left (\frac {2 i (a c-b d) \text {arctanh}\left (\frac {2 d-2 c \tanh \left (\frac {x}{2}\right )}{2 \sqrt {c^2+d^2}}\right )}{c \sqrt {c^2+d^2}}+\frac {i b \text {arctanh}(\cosh (x))}{c}\right )\) |
I*((I*b*ArcTanh[Cosh[x]])/c + ((2*I)*(a*c - b*d)*ArcTanh[(2*d - 2*c*Tanh[x /2])/(2*Sqrt[c^2 + d^2])])/(c*Sqrt[c^2 + d^2]))
3.6.73.3.1 Defintions of rubi rules used
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[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[-b, 2]))* ArcTanh[Rt[-b, 2]*(x/Rt[a, 2])], x] /; FreeQ[{a, b}, x] && NegQ[a/b] && (Gt Q[a, 0] || LtQ[b, 0])
Int[((a_) + (b_.)*(x_) + (c_.)*(x_)^2)^(-1), x_Symbol] :> Simp[-2 Subst[I nt[1/Simp[b^2 - 4*a*c - x^2, x], x], x, b + 2*c*x], x] /; FreeQ[{a, b, c}, x]
Int[((a_) + (b_.)*sin[(c_.) + (d_.)*(x_)])^(-1), x_Symbol] :> With[{e = Fre eFactors[Tan[(c + d*x)/2], x]}, Simp[2*(e/d) Subst[Int[1/(a + 2*b*e*x + a *e^2*x^2), x], x, Tan[(c + d*x)/2]/e], x]] /; FreeQ[{a, b, c, d}, x] && NeQ [a^2 - b^2, 0]
Int[(csc[(e_.) + (f_.)*(x_)]*(d_.) + (c_))^(n_.)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.), x_Symbol] :> Int[(a + b*Sin[e + f*x])^m*((d + c*Sin[e + f*x])^n/Sin[e + f*x]^n), x] /; FreeQ[{a, b, c, d, e, f, m}, x] && IntegerQ [n]
Int[((A_.) + (B_.)*sin[(e_.) + (f_.)*(x_)])/(((a_.) + (b_.)*sin[(e_.) + (f_ .)*(x_)])*((c_.) + (d_.)*sin[(e_.) + (f_.)*(x_)])), x_Symbol] :> Simp[(A*b - a*B)/(b*c - a*d) Int[1/(a + b*Sin[e + f*x]), x], x] + Simp[(B*c - A*d)/ (b*c - a*d) Int[1/(c + d*Sin[e + f*x]), x], x] /; FreeQ[{a, b, c, d, e, f , A, B}, x] && NeQ[b*c - a*d, 0] && NeQ[a^2 - b^2, 0] && NeQ[c^2 - d^2, 0]
Int[csc[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-ArcTanh[Cos[c + d*x]]/d, x] /; FreeQ[{c, d}, x]
Time = 0.68 (sec) , antiderivative size = 58, normalized size of antiderivative = 1.00
method | result | size |
default | \(\frac {b \ln \left (\tanh \left (\frac {x}{2}\right )\right )}{c}-\frac {\left (-2 a c +2 b d \right ) \operatorname {arctanh}\left (\frac {2 c \tanh \left (\frac {x}{2}\right )-2 d}{2 \sqrt {c^{2}+d^{2}}}\right )}{c \sqrt {c^{2}+d^{2}}}\) | \(58\) |
parts | \(\frac {2 a \,\operatorname {arctanh}\left (\frac {2 c \tanh \left (\frac {x}{2}\right )-2 d}{2 \sqrt {c^{2}+d^{2}}}\right )}{\sqrt {c^{2}+d^{2}}}+\frac {b \ln \left (\tanh \left (\frac {x}{2}\right )\right )}{c}-\frac {2 b d \,\operatorname {arctanh}\left (\frac {2 c \tanh \left (\frac {x}{2}\right )-2 d}{2 \sqrt {c^{2}+d^{2}}}\right )}{c \sqrt {c^{2}+d^{2}}}\) | \(86\) |
risch | \(\frac {b \ln \left ({\mathrm e}^{x}-1\right )}{c}-\frac {b \ln \left ({\mathrm e}^{x}+1\right )}{c}+\frac {\ln \left ({\mathrm e}^{x}+\frac {\sqrt {c^{2}+d^{2}}\, c -c^{2}-d^{2}}{\sqrt {c^{2}+d^{2}}\, d}\right ) a}{\sqrt {c^{2}+d^{2}}}-\frac {\ln \left ({\mathrm e}^{x}+\frac {\sqrt {c^{2}+d^{2}}\, c -c^{2}-d^{2}}{\sqrt {c^{2}+d^{2}}\, d}\right ) b d}{\sqrt {c^{2}+d^{2}}\, c}-\frac {\ln \left ({\mathrm e}^{x}+\frac {\sqrt {c^{2}+d^{2}}\, c +c^{2}+d^{2}}{\sqrt {c^{2}+d^{2}}\, d}\right ) a}{\sqrt {c^{2}+d^{2}}}+\frac {\ln \left ({\mathrm e}^{x}+\frac {\sqrt {c^{2}+d^{2}}\, c +c^{2}+d^{2}}{\sqrt {c^{2}+d^{2}}\, d}\right ) b d}{\sqrt {c^{2}+d^{2}}\, c}\) | \(225\) |
b/c*ln(tanh(1/2*x))-(-2*a*c+2*b*d)/c/(c^2+d^2)^(1/2)*arctanh(1/2*(2*c*tanh (1/2*x)-2*d)/(c^2+d^2)^(1/2))
Leaf count of result is larger than twice the leaf count of optimal. 172 vs. \(2 (54) = 108\).
Time = 0.47 (sec) , antiderivative size = 172, normalized size of antiderivative = 2.97 \[ \int \frac {a+b \text {csch}(x)}{c+d \sinh (x)} \, dx=-\frac {{\left (a c - b d\right )} \sqrt {c^{2} + d^{2}} \log \left (\frac {d^{2} \cosh \left (x\right )^{2} + d^{2} \sinh \left (x\right )^{2} + 2 \, c d \cosh \left (x\right ) + 2 \, c^{2} + d^{2} + 2 \, {\left (d^{2} \cosh \left (x\right ) + c d\right )} \sinh \left (x\right ) + 2 \, \sqrt {c^{2} + d^{2}} {\left (d \cosh \left (x\right ) + d \sinh \left (x\right ) + c\right )}}{d \cosh \left (x\right )^{2} + d \sinh \left (x\right )^{2} + 2 \, c \cosh \left (x\right ) + 2 \, {\left (d \cosh \left (x\right ) + c\right )} \sinh \left (x\right ) - d}\right ) + {\left (b c^{2} + b d^{2}\right )} \log \left (\cosh \left (x\right ) + \sinh \left (x\right ) + 1\right ) - {\left (b c^{2} + b d^{2}\right )} \log \left (\cosh \left (x\right ) + \sinh \left (x\right ) - 1\right )}{c^{3} + c d^{2}} \]
-((a*c - b*d)*sqrt(c^2 + d^2)*log((d^2*cosh(x)^2 + d^2*sinh(x)^2 + 2*c*d*c osh(x) + 2*c^2 + d^2 + 2*(d^2*cosh(x) + c*d)*sinh(x) + 2*sqrt(c^2 + d^2)*( d*cosh(x) + d*sinh(x) + c))/(d*cosh(x)^2 + d*sinh(x)^2 + 2*c*cosh(x) + 2*( d*cosh(x) + c)*sinh(x) - d)) + (b*c^2 + b*d^2)*log(cosh(x) + sinh(x) + 1) - (b*c^2 + b*d^2)*log(cosh(x) + sinh(x) - 1))/(c^3 + c*d^2)
\[ \int \frac {a+b \text {csch}(x)}{c+d \sinh (x)} \, dx=\int \frac {a + b \operatorname {csch}{\left (x \right )}}{c + d \sinh {\left (x \right )}}\, dx \]
Leaf count of result is larger than twice the leaf count of optimal. 141 vs. \(2 (54) = 108\).
Time = 0.28 (sec) , antiderivative size = 141, normalized size of antiderivative = 2.43 \[ \int \frac {a+b \text {csch}(x)}{c+d \sinh (x)} \, dx=-b {\left (\frac {d \log \left (\frac {d e^{\left (-x\right )} - c - \sqrt {c^{2} + d^{2}}}{d e^{\left (-x\right )} - c + \sqrt {c^{2} + d^{2}}}\right )}{\sqrt {c^{2} + d^{2}} c} + \frac {\log \left (e^{\left (-x\right )} + 1\right )}{c} - \frac {\log \left (e^{\left (-x\right )} - 1\right )}{c}\right )} + \frac {a \log \left (\frac {d e^{\left (-x\right )} - c - \sqrt {c^{2} + d^{2}}}{d e^{\left (-x\right )} - c + \sqrt {c^{2} + d^{2}}}\right )}{\sqrt {c^{2} + d^{2}}} \]
-b*(d*log((d*e^(-x) - c - sqrt(c^2 + d^2))/(d*e^(-x) - c + sqrt(c^2 + d^2) ))/(sqrt(c^2 + d^2)*c) + log(e^(-x) + 1)/c - log(e^(-x) - 1)/c) + a*log((d *e^(-x) - c - sqrt(c^2 + d^2))/(d*e^(-x) - c + sqrt(c^2 + d^2)))/sqrt(c^2 + d^2)
Time = 0.29 (sec) , antiderivative size = 90, normalized size of antiderivative = 1.55 \[ \int \frac {a+b \text {csch}(x)}{c+d \sinh (x)} \, dx=-\frac {b \log \left (e^{x} + 1\right )}{c} + \frac {b \log \left ({\left | e^{x} - 1 \right |}\right )}{c} + \frac {{\left (a c - b d\right )} \log \left (\frac {{\left | 2 \, d e^{x} + 2 \, c - 2 \, \sqrt {c^{2} + d^{2}} \right |}}{{\left | 2 \, d e^{x} + 2 \, c + 2 \, \sqrt {c^{2} + d^{2}} \right |}}\right )}{\sqrt {c^{2} + d^{2}} c} \]
-b*log(e^x + 1)/c + b*log(abs(e^x - 1))/c + (a*c - b*d)*log(abs(2*d*e^x + 2*c - 2*sqrt(c^2 + d^2))/abs(2*d*e^x + 2*c + 2*sqrt(c^2 + d^2)))/(sqrt(c^2 + d^2)*c)
Time = 4.29 (sec) , antiderivative size = 539, normalized size of antiderivative = 9.29 \[ \int \frac {a+b \text {csch}(x)}{c+d \sinh (x)} \, dx=\frac {b\,\ln \left ({\mathrm {e}}^x-1\right )}{c}-\frac {b\,\ln \left ({\mathrm {e}}^x+1\right )}{c}-\frac {\ln \left (\frac {\left (\frac {32\,\left (a^2\,c^2\,d-2\,a\,b\,c\,d^2-4\,{\mathrm {e}}^x\,b^2\,c^3+2\,b^2\,c^2\,d-3\,{\mathrm {e}}^x\,b^2\,c\,d^2+2\,b^2\,d^3\right )}{d^5}-\frac {\left (a\,c-b\,d\right )\,\left (\frac {32\,c^2\,\left (2\,b\,d^2+4\,a\,c^2\,{\mathrm {e}}^x+a\,d^2\,{\mathrm {e}}^x-2\,a\,c\,d-3\,b\,c\,d\,{\mathrm {e}}^x\right )}{d^5}+\frac {32\,c\,\left (a\,c-b\,d\right )\,\left (-4\,{\mathrm {e}}^x\,c^3+3\,c^2\,d-3\,{\mathrm {e}}^x\,c\,d^2+2\,d^3\right )}{d^5\,\sqrt {c^2+d^2}}\right )}{c\,\sqrt {c^2+d^2}}\right )\,\left (a\,c-b\,d\right )}{c\,\sqrt {c^2+d^2}}+\frac {32\,b\,\left (a\,c-b\,d\right )\,\left (a\,d\,{\mathrm {e}}^x-2\,b\,d+4\,b\,c\,{\mathrm {e}}^x\right )}{d^5}\right )\,\left (a\,c-b\,d\right )\,\sqrt {c^2+d^2}}{c^3+c\,d^2}+\frac {\ln \left (\frac {32\,b\,\left (a\,c-b\,d\right )\,\left (a\,d\,{\mathrm {e}}^x-2\,b\,d+4\,b\,c\,{\mathrm {e}}^x\right )}{d^5}-\frac {\left (\frac {32\,\left (a^2\,c^2\,d-2\,a\,b\,c\,d^2-4\,{\mathrm {e}}^x\,b^2\,c^3+2\,b^2\,c^2\,d-3\,{\mathrm {e}}^x\,b^2\,c\,d^2+2\,b^2\,d^3\right )}{d^5}+\frac {\left (a\,c-b\,d\right )\,\left (\frac {32\,c^2\,\left (2\,b\,d^2+4\,a\,c^2\,{\mathrm {e}}^x+a\,d^2\,{\mathrm {e}}^x-2\,a\,c\,d-3\,b\,c\,d\,{\mathrm {e}}^x\right )}{d^5}-\frac {32\,c\,\left (a\,c-b\,d\right )\,\left (-4\,{\mathrm {e}}^x\,c^3+3\,c^2\,d-3\,{\mathrm {e}}^x\,c\,d^2+2\,d^3\right )}{d^5\,\sqrt {c^2+d^2}}\right )}{c\,\sqrt {c^2+d^2}}\right )\,\left (a\,c-b\,d\right )}{c\,\sqrt {c^2+d^2}}\right )\,\left (a\,c-b\,d\right )\,\sqrt {c^2+d^2}}{c^3+c\,d^2} \]
(b*log(exp(x) - 1))/c - (b*log(exp(x) + 1))/c - (log((((32*(2*b^2*d^3 + a^ 2*c^2*d + 2*b^2*c^2*d - 4*b^2*c^3*exp(x) - 3*b^2*c*d^2*exp(x) - 2*a*b*c*d^ 2))/d^5 - ((a*c - b*d)*((32*c^2*(2*b*d^2 + 4*a*c^2*exp(x) + a*d^2*exp(x) - 2*a*c*d - 3*b*c*d*exp(x)))/d^5 + (32*c*(a*c - b*d)*(3*c^2*d + 2*d^3 - 4*c ^3*exp(x) - 3*c*d^2*exp(x)))/(d^5*(c^2 + d^2)^(1/2))))/(c*(c^2 + d^2)^(1/2 )))*(a*c - b*d))/(c*(c^2 + d^2)^(1/2)) + (32*b*(a*c - b*d)*(a*d*exp(x) - 2 *b*d + 4*b*c*exp(x)))/d^5)*(a*c - b*d)*(c^2 + d^2)^(1/2))/(c*d^2 + c^3) + (log((32*b*(a*c - b*d)*(a*d*exp(x) - 2*b*d + 4*b*c*exp(x)))/d^5 - (((32*(2 *b^2*d^3 + a^2*c^2*d + 2*b^2*c^2*d - 4*b^2*c^3*exp(x) - 3*b^2*c*d^2*exp(x) - 2*a*b*c*d^2))/d^5 + ((a*c - b*d)*((32*c^2*(2*b*d^2 + 4*a*c^2*exp(x) + a *d^2*exp(x) - 2*a*c*d - 3*b*c*d*exp(x)))/d^5 - (32*c*(a*c - b*d)*(3*c^2*d + 2*d^3 - 4*c^3*exp(x) - 3*c*d^2*exp(x)))/(d^5*(c^2 + d^2)^(1/2))))/(c*(c^ 2 + d^2)^(1/2)))*(a*c - b*d))/(c*(c^2 + d^2)^(1/2)))*(a*c - b*d)*(c^2 + d^ 2)^(1/2))/(c*d^2 + c^3)