Optimal. Leaf size=146 \[ -\frac {2 a c \tan ^{-1}\left (\frac {(a-c) \tanh \left (\frac {x}{2}\right )+b}{\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 ((a-c) \tanh ^2\left (\frac {x}{2}\right )+a+2 b \tanh \left (\frac {x}{2}\right )+c\right )}{b^2+c^2}-\frac {b \log \left (\tanh ^2\left (\frac {x}{2}\right )+1\right )}{b^2+c^2}+\frac {2 c \tan ^{-1}\left (\tanh \left (\frac {x}{2}\right )\right )}{b^2+c^2} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.48, antiderivative size = 146, normalized size of antiderivative = 1.00, number of steps used = 10, number of rules used = 9, integrand size = 17, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.529, Rules used = {4397, 1075, 634, 618, 204, 628, 635, 203, 260} \[ -\frac {2 a c \tan ^{-1}\left (\frac {(a-c) \tanh \left (\frac {x}{2}\right )+b}{\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 ((a-c) \tanh ^2\left (\frac {x}{2}\right )+a+2 b \tanh \left (\frac {x}{2}\right )+c\right )}{b^2+c^2}-\frac {b \log \left (\tanh ^2\left (\frac {x}{2}\right )+1\right )}{b^2+c^2}+\frac {2 c \tan ^{-1}\left (\tanh \left (\frac {x}{2}\right )\right )}{b^2+c^2} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 203
Rule 204
Rule 260
Rule 618
Rule 628
Rule 634
Rule 635
Rule 1075
Rule 4397
Rubi steps
\begin {align*} \int \frac {\text {sech}^2(x)}{a+c \text {sech}(x)+b \tanh (x)} \, dx &=\int \frac {\text {sech}(x)}{c+a \cosh (x)+b \sinh (x)} \, dx\\ &=2 \operatorname {Subst}\left (\int \frac {1-x^2}{\left (1+x^2\right ) \left (a+c+2 b x+(a-c) x^2\right )} \, dx,x,\tanh \left (\frac {x}{2}\right )\right )\\ &=\frac {\operatorname {Subst}\left (\int \frac {4 c-4 b x}{1+x^2} \, dx,x,\tanh \left (\frac {x}{2}\right )\right )}{2 \left (b^2+c^2\right )}+\frac {\operatorname {Subst}\left (\int \frac {4 b^2+(a-c)^2-(a+c)^2+4 b (a-c) x}{a+c+2 b x+(a-c) x^2} \, dx,x,\tanh \left (\frac {x}{2}\right )\right )}{2 \left (b^2+c^2\right )}\\ &=\frac {b \operatorname {Subst}\left (\int \frac {2 b+2 (a-c) x}{a+c+2 b x+(a-c) x^2} \, dx,x,\tanh \left (\frac {x}{2}\right )\right )}{b^2+c^2}-\frac {(2 b) \operatorname {Subst}\left (\int \frac {x}{1+x^2} \, dx,x,\tanh \left (\frac {x}{2}\right )\right )}{b^2+c^2}+\frac {(2 c) \operatorname {Subst}\left (\int \frac {1}{1+x^2} \, dx,x,\tanh \left (\frac {x}{2}\right )\right )}{b^2+c^2}-\frac {(2 a c) \operatorname {Subst}\left (\int \frac {1}{a+c+2 b x+(a-c) x^2} \, dx,x,\tanh \left (\frac {x}{2}\right )\right )}{b^2+c^2}\\ &=\frac {2 c \tan ^{-1}\left (\tanh \left (\frac {x}{2}\right )\right )}{b^2+c^2}-\frac {b \log \left (1+\tanh ^2\left (\frac {x}{2}\right )\right )}{b^2+c^2}+\frac {b \log \left (a+c+2 b \tanh \left (\frac {x}{2}\right )+(a-c) \tanh ^2\left (\frac {x}{2}\right )\right )}{b^2+c^2}+\frac {(4 a c) \operatorname {Subst}\left (\int \frac {1}{-4 \left (a^2-b^2-c^2\right )-x^2} \, dx,x,2 b+2 (a-c) \tanh \left (\frac {x}{2}\right )\right )}{b^2+c^2}\\ &=\frac {2 c \tan ^{-1}\left (\tanh \left (\frac {x}{2}\right )\right )}{b^2+c^2}-\frac {2 a c \tan ^{-1}\left (\frac {b+(a-c) \tanh \left (\frac {x}{2}\right )}{\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 (1+\tanh ^2\left (\frac {x}{2}\right )\right )}{b^2+c^2}+\frac {b \log \left (a+c+2 b \tanh \left (\frac {x}{2}\right )+(a-c) \tanh ^2\left (\frac {x}{2}\right )\right )}{b^2+c^2}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.27, size = 96, normalized size = 0.66 \[ \frac {-\frac {2 a c \tan ^{-1}\left (\frac {(a-c) \tanh \left (\frac {x}{2}\right )+b}{\sqrt {a^2-b^2-c^2}}\right )}{\sqrt {a^2-b^2-c^2}}+b (\log (a \cosh (x)+b \sinh (x)+c)-\log (\cosh (x)))+2 c \tan ^{-1}\left (\tanh \left (\frac {x}{2}\right )\right )}{b^2+c^2} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 1.54, size = 486, normalized size = 3.33 \[ \left [-\frac {\sqrt {-a^{2} + b^{2} + c^{2}} a c \log \left (\frac {2 \, {\left (a + b\right )} c \cosh \relax (x) + {\left (a^{2} + 2 \, a b + b^{2}\right )} \cosh \relax (x)^{2} + {\left (a^{2} + 2 \, a b + b^{2}\right )} \sinh \relax (x)^{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 \relax (x)\right )} \sinh \relax (x) + 2 \, \sqrt {-a^{2} + b^{2} + c^{2}} {\left ({\left (a + b\right )} \cosh \relax (x) + {\left (a + b\right )} \sinh \relax (x) + c\right )}}{{\left (a + b\right )} \cosh \relax (x)^{2} + {\left (a + b\right )} \sinh \relax (x)^{2} + 2 \, c \cosh \relax (x) + 2 \, {\left ({\left (a + b\right )} \cosh \relax (x) + c\right )} \sinh \relax (x) + a - b}\right ) + 2 \, {\left (c^{3} - {\left (a^{2} - b^{2}\right )} c\right )} \arctan \left (\cosh \relax (x) + \sinh \relax (x)\right ) - {\left (a^{2} b - b^{3} - b c^{2}\right )} \log \left (\frac {2 \, {\left (a \cosh \relax (x) + b \sinh \relax (x) + c\right )}}{\cosh \relax (x) - \sinh \relax (x)}\right ) + {\left (a^{2} b - b^{3} - b c^{2}\right )} \log \left (\frac {2 \, \cosh \relax (x)}{\cosh \relax (x) - \sinh \relax (x)}\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 {{\left (a + b\right )} \cosh \relax (x) + {\left (a + b\right )} \sinh \relax (x) + c}{\sqrt {a^{2} - b^{2} - c^{2}}}\right ) - 2 \, {\left (c^{3} - {\left (a^{2} - b^{2}\right )} c\right )} \arctan \left (\cosh \relax (x) + \sinh \relax (x)\right ) + {\left (a^{2} b - b^{3} - b c^{2}\right )} \log \left (\frac {2 \, {\left (a \cosh \relax (x) + b \sinh \relax (x) + c\right )}}{\cosh \relax (x) - \sinh \relax (x)}\right ) - {\left (a^{2} b - b^{3} - b c^{2}\right )} \log \left (\frac {2 \, \cosh \relax (x)}{\cosh \relax (x) - \sinh \relax (x)}\right )}{a^{2} b^{2} - b^{4} - c^{4} + {\left (a^{2} - 2 \, b^{2}\right )} c^{2}}\right ] \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 0.14, size = 126, normalized size = 0.86 \[ -\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 {2 \, c \arctan \left (e^{x}\right )}{b^{2} + c^{2}} + \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 {b \log \left (e^{\left (2 \, x\right )} + 1\right )}{b^{2} + c^{2}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [B] time = 0.22, size = 406, normalized size = 2.78 \[ \frac {\ln \left (a \left (\tanh ^{2}\left (\frac {x}{2}\right )\right )-\left (\tanh ^{2}\left (\frac {x}{2}\right )\right ) c +2 \tanh \left (\frac {x}{2}\right ) b +a +c \right ) a b}{\left (b^{2}+c^{2}\right ) \left (a -c \right )}-\frac {\ln \left (a \left (\tanh ^{2}\left (\frac {x}{2}\right )\right )-\left (\tanh ^{2}\left (\frac {x}{2}\right )\right ) c +2 \tanh \left (\frac {x}{2}\right ) b +a +c \right ) c b}{\left (b^{2}+c^{2}\right ) \left (a -c \right )}-\frac {2 \arctan \left (\frac {2 \left (a -c \right ) \tanh \left (\frac {x}{2}\right )+2 b}{2 \sqrt {a^{2}-b^{2}-c^{2}}}\right ) a c}{\left (b^{2}+c^{2}\right ) \sqrt {a^{2}-b^{2}-c^{2}}}+\frac {2 \arctan \left (\frac {2 \left (a -c \right ) \tanh \left (\frac {x}{2}\right )+2 b}{2 \sqrt {a^{2}-b^{2}-c^{2}}}\right ) b^{2}}{\left (b^{2}+c^{2}\right ) \sqrt {a^{2}-b^{2}-c^{2}}}-\frac {2 \arctan \left (\frac {2 \left (a -c \right ) \tanh \left (\frac {x}{2}\right )+2 b}{2 \sqrt {a^{2}-b^{2}-c^{2}}}\right ) b^{2} a}{\left (b^{2}+c^{2}\right ) \sqrt {a^{2}-b^{2}-c^{2}}\, \left (a -c \right )}+\frac {2 \arctan \left (\frac {2 \left (a -c \right ) \tanh \left (\frac {x}{2}\right )+2 b}{2 \sqrt {a^{2}-b^{2}-c^{2}}}\right ) b^{2} c}{\left (b^{2}+c^{2}\right ) \sqrt {a^{2}-b^{2}-c^{2}}\, \left (a -c \right )}-\frac {b \ln \left (\tanh ^{2}\left (\frac {x}{2}\right )+1\right )}{b^{2}+c^{2}}+\frac {2 c \arctan \left (\tanh \left (\frac {x}{2}\right )\right )}{b^{2}+c^{2}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [F(-2)] time = 0.00, size = 0, normalized size = 0.00 \[ \text {Exception raised: ValueError} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 28.99, size = 1069, normalized size = 7.32 \[ \frac {\ln \left (\frac {64\,\left (a-b+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 (b\,c^2-a^2\,b+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 (b\,c^2-a^2\,b+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 (b\,c^2-a^2\,b+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 (b\,c^2-a^2\,b+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 (a-b+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 (1+{\mathrm {e}}^x\,1{}\mathrm {i}\right )}{b-c\,1{}\mathrm {i}}-\frac {\ln \left ({\mathrm {e}}^x+1{}\mathrm {i}\right )\,1{}\mathrm {i}}{-c+b\,1{}\mathrm {i}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int \frac {\operatorname {sech}^{2}{\relax (x )}}{a + b \tanh {\relax (x )} + c \operatorname {sech}{\relax (x )}}\, dx \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________