Optimal. Leaf size=118 \[ -\frac {2 a c \tanh ^{-1}\left (\frac {a+(b-c) \tanh \left (\frac {x}{2}\right )}{\sqrt {a^2-b^2+c^2}}\right )}{\left (b^2-c^2\right ) \sqrt {a^2-b^2+c^2}}+\frac {\log \left (\tanh \left (\frac {x}{2}\right )\right )}{b+c}-\frac {b \log \left (b+c+2 a \tanh \left (\frac {x}{2}\right )+(b-c) \tanh ^2\left (\frac {x}{2}\right )\right )}{b^2-c^2} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.40, antiderivative size = 118, normalized size of antiderivative = 1.00, number of steps
used = 9, number of rules used = 7, integrand size = 17, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.412, Rules used = {4482, 12, 1642,
648, 632, 212, 642} \begin {gather*} -\frac {2 a c \tanh ^{-1}\left (\frac {a+(b-c) \tanh \left (\frac {x}{2}\right )}{\sqrt {a^2-b^2+c^2}}\right )}{\left (b^2-c^2\right ) \sqrt {a^2-b^2+c^2}}-\frac {b \log \left (2 a \tanh \left (\frac {x}{2}\right )+(b-c) \tanh ^2\left (\frac {x}{2}\right )+b+c\right )}{b^2-c^2}+\frac {\log \left (\tanh \left (\frac {x}{2}\right )\right )}{b+c} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 12
Rule 212
Rule 632
Rule 642
Rule 648
Rule 1642
Rule 4482
Rubi steps
\begin {align*} \int \frac {\text {csch}^2(x)}{a+b \coth (x)+c \text {csch}(x)} \, dx &=i \int \frac {\text {csch}(x)}{i c+i b \cosh (x)+i a \sinh (x)} \, dx\\ &=-\left (2 \text {Subst}\left (\int \frac {-1+x^2}{2 x \left (b+c+2 a x+(b-c) x^2\right )} \, dx,x,\tanh \left (\frac {x}{2}\right )\right )\right )\\ &=-\text {Subst}\left (\int \frac {-1+x^2}{x \left (b+c+2 a x+(b-c) x^2\right )} \, dx,x,\tanh \left (\frac {x}{2}\right )\right )\\ &=-\text {Subst}\left (\int \left (-\frac {1}{(b+c) x}+\frac {2 (a+b x)}{(b+c) \left (b+c+2 a x+(b-c) x^2\right )}\right ) \, dx,x,\tanh \left (\frac {x}{2}\right )\right )\\ &=\frac {\log \left (\tanh \left (\frac {x}{2}\right )\right )}{b+c}-\frac {2 \text {Subst}\left (\int \frac {a+b x}{b+c+2 a x+(b-c) x^2} \, dx,x,\tanh \left (\frac {x}{2}\right )\right )}{b+c}\\ &=\frac {\log \left (\tanh \left (\frac {x}{2}\right )\right )}{b+c}-\frac {b \text {Subst}\left (\int \frac {2 a+2 (b-c) x}{b+c+2 a x+(b-c) x^2} \, dx,x,\tanh \left (\frac {x}{2}\right )\right )}{b^2-c^2}+\frac {(2 a c) \text {Subst}\left (\int \frac {1}{b+c+2 a x+(b-c) x^2} \, dx,x,\tanh \left (\frac {x}{2}\right )\right )}{b^2-c^2}\\ &=\frac {\log \left (\tanh \left (\frac {x}{2}\right )\right )}{b+c}-\frac {b \log \left (b+c+2 a \tanh \left (\frac {x}{2}\right )+(b-c) \tanh ^2\left (\frac {x}{2}\right )\right )}{b^2-c^2}-\frac {(4 a c) \text {Subst}\left (\int \frac {1}{4 \left (a^2-b^2+c^2\right )-x^2} \, dx,x,2 a+2 (b-c) \tanh \left (\frac {x}{2}\right )\right )}{b^2-c^2}\\ &=-\frac {2 a c \tanh ^{-1}\left (\frac {a+(b-c) \tanh \left (\frac {x}{2}\right )}{\sqrt {a^2-b^2+c^2}}\right )}{\left (b^2-c^2\right ) \sqrt {a^2-b^2+c^2}}+\frac {\log \left (\tanh \left (\frac {x}{2}\right )\right )}{b+c}-\frac {b \log \left (b+c+2 a \tanh \left (\frac {x}{2}\right )+(b-c) \tanh ^2\left (\frac {x}{2}\right )\right )}{b^2-c^2}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.16, size = 97, normalized size = 0.82 \begin {gather*} \frac {-\frac {2 a c \text {ArcTan}\left (\frac {a+(b-c) \tanh \left (\frac {x}{2}\right )}{\sqrt {-a^2+b^2-c^2}}\right )}{\sqrt {-a^2+b^2-c^2}}-b \log (\sinh (x))+b \log (c+b \cosh (x)+a \sinh (x))+c \log \left (\tanh \left (\frac {x}{2}\right )\right )}{-b^2+c^2} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 1.36, size = 124, normalized size = 1.05
method | result | size |
default | \(\frac {\ln \left (\tanh \left (\frac {x}{2}\right )\right )}{b +c}+\frac {-\frac {b \ln \left (b \left (\tanh ^{2}\left (\frac {x}{2}\right )\right )-c \left (\tanh ^{2}\left (\frac {x}{2}\right )\right )+2 a \tanh \left (\frac {x}{2}\right )+b +c \right )}{b -c}+\frac {\left (-2 a +\frac {2 b a}{b -c}\right ) \arctan \left (\frac {2 \left (b -c \right ) \tanh \left (\frac {x}{2}\right )+2 a}{2 \sqrt {-a^{2}+b^{2}-c^{2}}}\right )}{\sqrt {-a^{2}+b^{2}-c^{2}}}}{b +c}\) | \(124\) |
risch | \(-\frac {x}{b -c}+\frac {2 x \,a^{2} b}{a^{2} b^{2}-a^{2} c^{2}-b^{4}+2 b^{2} c^{2}-c^{4}}-\frac {2 x \,b^{3}}{a^{2} b^{2}-a^{2} c^{2}-b^{4}+2 b^{2} c^{2}-c^{4}}+\frac {2 x b \,c^{2}}{a^{2} b^{2}-a^{2} c^{2}-b^{4}+2 b^{2} c^{2}-c^{4}}-\frac {x}{b +c}+\frac {\ln \left ({\mathrm e}^{x}+1\right )}{b -c}-\frac {\ln \left ({\mathrm e}^{x}-\frac {-a \,c^{2}+\sqrt {a^{4} c^{2}-a^{2} b^{2} c^{2}+a^{2} c^{4}}}{\left (a +b \right ) a c}\right ) a^{2} b}{a^{2} b^{2}-a^{2} c^{2}-b^{4}+2 b^{2} c^{2}-c^{4}}+\frac {\ln \left ({\mathrm e}^{x}-\frac {-a \,c^{2}+\sqrt {a^{4} c^{2}-a^{2} b^{2} c^{2}+a^{2} c^{4}}}{\left (a +b \right ) a c}\right ) b^{3}}{a^{2} b^{2}-a^{2} c^{2}-b^{4}+2 b^{2} c^{2}-c^{4}}-\frac {\ln \left ({\mathrm e}^{x}-\frac {-a \,c^{2}+\sqrt {a^{4} c^{2}-a^{2} b^{2} c^{2}+a^{2} c^{4}}}{\left (a +b \right ) a c}\right ) b \,c^{2}}{a^{2} b^{2}-a^{2} c^{2}-b^{4}+2 b^{2} c^{2}-c^{4}}+\frac {\ln \left ({\mathrm e}^{x}-\frac {-a \,c^{2}+\sqrt {a^{4} c^{2}-a^{2} b^{2} c^{2}+a^{2} c^{4}}}{\left (a +b \right ) a c}\right ) \sqrt {a^{4} c^{2}-a^{2} b^{2} c^{2}+a^{2} c^{4}}}{a^{2} b^{2}-a^{2} c^{2}-b^{4}+2 b^{2} c^{2}-c^{4}}-\frac {\ln \left ({\mathrm e}^{x}+\frac {a \,c^{2}+\sqrt {a^{4} c^{2}-a^{2} b^{2} c^{2}+a^{2} c^{4}}}{\left (a +b \right ) a c}\right ) a^{2} b}{a^{2} b^{2}-a^{2} c^{2}-b^{4}+2 b^{2} c^{2}-c^{4}}+\frac {\ln \left ({\mathrm e}^{x}+\frac {a \,c^{2}+\sqrt {a^{4} c^{2}-a^{2} b^{2} c^{2}+a^{2} c^{4}}}{\left (a +b \right ) a c}\right ) b^{3}}{a^{2} b^{2}-a^{2} c^{2}-b^{4}+2 b^{2} c^{2}-c^{4}}-\frac {\ln \left ({\mathrm e}^{x}+\frac {a \,c^{2}+\sqrt {a^{4} c^{2}-a^{2} b^{2} c^{2}+a^{2} c^{4}}}{\left (a +b \right ) a c}\right ) b \,c^{2}}{a^{2} b^{2}-a^{2} c^{2}-b^{4}+2 b^{2} c^{2}-c^{4}}-\frac {\ln \left ({\mathrm e}^{x}+\frac {a \,c^{2}+\sqrt {a^{4} c^{2}-a^{2} b^{2} c^{2}+a^{2} c^{4}}}{\left (a +b \right ) a c}\right ) \sqrt {a^{4} c^{2}-a^{2} b^{2} c^{2}+a^{2} c^{4}}}{a^{2} b^{2}-a^{2} c^{2}-b^{4}+2 b^{2} c^{2}-c^{4}}+\frac {\ln \left ({\mathrm e}^{x}-1\right )}{b +c}\) | \(959\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: ValueError} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 221 vs.
\(2 (106) = 212\).
time = 1.08, size = 546, normalized size = 4.63 \begin {gather*} \left [-\frac {\sqrt {a^{2} - b^{2} + c^{2}} a c \log \left (\frac {2 \, {\left (a + b\right )} c \cosh \left (x\right ) + {\left (a^{2} + 2 \, a b + b^{2}\right )} \cosh \left (x\right )^{2} + {\left (a^{2} + 2 \, a b + b^{2}\right )} \sinh \left (x\right )^{2} + a^{2} - b^{2} + 2 \, c^{2} + 2 \, {\left ({\left (a + b\right )} c + {\left (a^{2} + 2 \, a b + b^{2}\right )} \cosh \left (x\right )\right )} \sinh \left (x\right ) + 2 \, \sqrt {a^{2} - b^{2} + c^{2}} {\left ({\left (a + b\right )} \cosh \left (x\right ) + {\left (a + b\right )} \sinh \left (x\right ) + c\right )}}{{\left (a + b\right )} \cosh \left (x\right )^{2} + {\left (a + b\right )} \sinh \left (x\right )^{2} + 2 \, c \cosh \left (x\right ) + 2 \, {\left ({\left (a + b\right )} \cosh \left (x\right ) + c\right )} \sinh \left (x\right ) - a + b}\right ) + {\left (a^{2} b - b^{3} + b c^{2}\right )} \log \left (\frac {2 \, {\left (b \cosh \left (x\right ) + a \sinh \left (x\right ) + c\right )}}{\cosh \left (x\right ) - \sinh \left (x\right )}\right ) - {\left (a^{2} b - b^{3} + b c^{2} + c^{3} + {\left (a^{2} - b^{2}\right )} c\right )} \log \left (\cosh \left (x\right ) + \sinh \left (x\right ) + 1\right ) - {\left (a^{2} b - b^{3} + b c^{2} - c^{3} - {\left (a^{2} - b^{2}\right )} c\right )} \log \left (\cosh \left (x\right ) + \sinh \left (x\right ) - 1\right )}{a^{2} b^{2} - b^{4} - c^{4} - {\left (a^{2} - 2 \, b^{2}\right )} c^{2}}, \frac {2 \, \sqrt {-a^{2} + b^{2} - c^{2}} a c \arctan \left (\frac {\sqrt {-a^{2} + b^{2} - c^{2}} {\left ({\left (a + b\right )} \cosh \left (x\right ) + {\left (a + b\right )} \sinh \left (x\right ) + c\right )}}{a^{2} - b^{2} + c^{2}}\right ) - {\left (a^{2} b - b^{3} + b c^{2}\right )} \log \left (\frac {2 \, {\left (b \cosh \left (x\right ) + a \sinh \left (x\right ) + c\right )}}{\cosh \left (x\right ) - \sinh \left (x\right )}\right ) + {\left (a^{2} b - b^{3} + b c^{2} + c^{3} + {\left (a^{2} - b^{2}\right )} c\right )} \log \left (\cosh \left (x\right ) + \sinh \left (x\right ) + 1\right ) + {\left (a^{2} b - b^{3} + b c^{2} - c^{3} - {\left (a^{2} - b^{2}\right )} c\right )} \log \left (\cosh \left (x\right ) + \sinh \left (x\right ) - 1\right )}{a^{2} b^{2} - b^{4} - c^{4} - {\left (a^{2} - 2 \, b^{2}\right )} c^{2}}\right ] \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {\operatorname {csch}^{2}{\left (x \right )}}{a + b \coth {\left (x \right )} + c \operatorname {csch}{\left (x \right )}}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.40, size = 122, normalized size = 1.03 \begin {gather*} \frac {2 \, a c \arctan \left (\frac {a e^{x} + b e^{x} + c}{\sqrt {-a^{2} + b^{2} - c^{2}}}\right )}{\sqrt {-a^{2} + b^{2} - c^{2}} {\left (b^{2} - c^{2}\right )}} - \frac {b \log \left (a e^{\left (2 \, x\right )} + b e^{\left (2 \, x\right )} + 2 \, c e^{x} - a + b\right )}{b^{2} - c^{2}} + \frac {\log \left (e^{x} + 1\right )}{b - c} + \frac {\log \left ({\left | e^{x} - 1 \right |}\right )}{b + c} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 7.18, size = 1069, normalized size = 9.06 \begin {gather*} \frac {\ln \left ({\mathrm {e}}^x-1\right )}{b+c}+\frac {\ln \left ({\mathrm {e}}^x+1\right )}{b-c}+\frac {\ln \left (-\frac {64\,\left (b-a+2\,c\,{\mathrm {e}}^x\right )}{{\left (a+b\right )}^4}-\frac {\left (\frac {32\,\left (-2\,a^3+3\,{\mathrm {e}}^x\,a^2\,c+2\,a\,b^2+6\,{\mathrm {e}}^x\,a\,b\,c-2\,a\,c^2+3\,{\mathrm {e}}^x\,b^2\,c+2\,b\,c^2+4\,{\mathrm {e}}^x\,c^3\right )}{{\left (a+b\right )}^5}+\frac {\left (\frac {32\,\left (a-b\right )\,\left (2\,b^3+6\,{\mathrm {e}}^x\,b^2\,c+2\,a\,b^2+b\,c^2+6\,a\,{\mathrm {e}}^x\,b\,c-3\,{\mathrm {e}}^x\,c^3+2\,a\,c^2\right )}{{\left (a+b\right )}^5}-\frac {32\,\left (a^2\,b+b\,c^2-b^3+a\,c\,\sqrt {a^2-b^2+c^2}\right )\,\left (-2\,a^3\,b^2-4\,{\mathrm {e}}^x\,a^3\,b\,c-2\,a^3\,c^2+{\mathrm {e}}^x\,a^2\,b^2\,c+4\,a^2\,b\,c^2+3\,{\mathrm {e}}^x\,a^2\,c^3+2\,a\,b^4+6\,{\mathrm {e}}^x\,a\,b^3\,c+a\,b^2\,c^2-6\,{\mathrm {e}}^x\,a\,b\,c^3-3\,a\,c^4+{\mathrm {e}}^x\,b^4\,c-3\,b^3\,c^2-5\,{\mathrm {e}}^x\,b^2\,c^3+3\,b\,c^4+4\,{\mathrm {e}}^x\,c^5\right )}{{\left (a+b\right )}^5\,\left (b^2-c^2\right )\,\left (a^2-b^2+c^2\right )}\right )\,\left (a^2\,b+b\,c^2-b^3+a\,c\,\sqrt {a^2-b^2+c^2}\right )}{\left (b^2-c^2\right )\,\left (a^2-b^2+c^2\right )}\right )\,\left (a^2\,b+b\,c^2-b^3+a\,c\,\sqrt {a^2-b^2+c^2}\right )}{\left (b^2-c^2\right )\,\left (a^2-b^2+c^2\right )}\right )\,\left (a^2\,b+b\,c^2-b^3+a\,c\,\sqrt {a^2-b^2+c^2}\right )}{-a^2\,b^2+a^2\,c^2+b^4-2\,b^2\,c^2+c^4}+\frac {\ln \left (-\frac {64\,\left (b-a+2\,c\,{\mathrm {e}}^x\right )}{{\left (a+b\right )}^4}-\frac {\left (\frac {32\,\left (-2\,a^3+3\,{\mathrm {e}}^x\,a^2\,c+2\,a\,b^2+6\,{\mathrm {e}}^x\,a\,b\,c-2\,a\,c^2+3\,{\mathrm {e}}^x\,b^2\,c+2\,b\,c^2+4\,{\mathrm {e}}^x\,c^3\right )}{{\left (a+b\right )}^5}+\frac {\left (\frac {32\,\left (a-b\right )\,\left (2\,b^3+6\,{\mathrm {e}}^x\,b^2\,c+2\,a\,b^2+b\,c^2+6\,a\,{\mathrm {e}}^x\,b\,c-3\,{\mathrm {e}}^x\,c^3+2\,a\,c^2\right )}{{\left (a+b\right )}^5}-\frac {32\,\left (a^2\,b+b\,c^2-b^3-a\,c\,\sqrt {a^2-b^2+c^2}\right )\,\left (-2\,a^3\,b^2-4\,{\mathrm {e}}^x\,a^3\,b\,c-2\,a^3\,c^2+{\mathrm {e}}^x\,a^2\,b^2\,c+4\,a^2\,b\,c^2+3\,{\mathrm {e}}^x\,a^2\,c^3+2\,a\,b^4+6\,{\mathrm {e}}^x\,a\,b^3\,c+a\,b^2\,c^2-6\,{\mathrm {e}}^x\,a\,b\,c^3-3\,a\,c^4+{\mathrm {e}}^x\,b^4\,c-3\,b^3\,c^2-5\,{\mathrm {e}}^x\,b^2\,c^3+3\,b\,c^4+4\,{\mathrm {e}}^x\,c^5\right )}{{\left (a+b\right )}^5\,\left (b^2-c^2\right )\,\left (a^2-b^2+c^2\right )}\right )\,\left (a^2\,b+b\,c^2-b^3-a\,c\,\sqrt {a^2-b^2+c^2}\right )}{\left (b^2-c^2\right )\,\left (a^2-b^2+c^2\right )}\right )\,\left (a^2\,b+b\,c^2-b^3-a\,c\,\sqrt {a^2-b^2+c^2}\right )}{\left (b^2-c^2\right )\,\left (a^2-b^2+c^2\right )}\right )\,\left (a^2\,b+b\,c^2-b^3-a\,c\,\sqrt {a^2-b^2+c^2}\right )}{-a^2\,b^2+a^2\,c^2+b^4-2\,b^2\,c^2+c^4} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________