Optimal. Leaf size=309 \[ \frac {x}{c}-\frac {\sqrt {2} \left (i b+\frac {b^2-2 a c}{\sqrt {-b^2+4 a c}}\right ) \text {ArcTan}\left (\frac {2 i c-\left (i b-\sqrt {-b^2+4 a c}\right ) \tanh \left (\frac {x}{2}\right )}{\sqrt {2} \sqrt {b^2-2 (a-c) c+i b \sqrt {-b^2+4 a c}}}\right )}{c \sqrt {b^2-2 (a-c) c+i b \sqrt {-b^2+4 a c}}}-\frac {\sqrt {2} \left (i b-\frac {b^2-2 a c}{\sqrt {-b^2+4 a c}}\right ) \text {ArcTan}\left (\frac {2 i c-\left (i b+\sqrt {-b^2+4 a c}\right ) \tanh \left (\frac {x}{2}\right )}{\sqrt {2} \sqrt {b^2-2 (a-c) c-i b \sqrt {-b^2+4 a c}}}\right )}{c \sqrt {b^2-2 (a-c) c-i b \sqrt {-b^2+4 a c}}} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.76, antiderivative size = 309, normalized size of antiderivative = 1.00, number of steps
used = 9, number of rules used = 5, integrand size = 19, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.263, Rules used = {3337, 3373,
2739, 632, 210} \begin {gather*} -\frac {\sqrt {2} \left (\frac {b^2-2 a c}{\sqrt {4 a c-b^2}}+i b\right ) \text {ArcTan}\left (\frac {2 i c-\tanh \left (\frac {x}{2}\right ) \left (-\sqrt {4 a c-b^2}+i b\right )}{\sqrt {2} \sqrt {i b \sqrt {4 a c-b^2}-2 c (a-c)+b^2}}\right )}{c \sqrt {i b \sqrt {4 a c-b^2}-2 c (a-c)+b^2}}-\frac {\sqrt {2} \left (-\frac {b^2-2 a c}{\sqrt {4 a c-b^2}}+i b\right ) \text {ArcTan}\left (\frac {2 i c-\tanh \left (\frac {x}{2}\right ) \left (\sqrt {4 a c-b^2}+i b\right )}{\sqrt {2} \sqrt {-i b \sqrt {4 a c-b^2}-2 c (a-c)+b^2}}\right )}{c \sqrt {-i b \sqrt {4 a c-b^2}-2 c (a-c)+b^2}}+\frac {x}{c} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 210
Rule 632
Rule 2739
Rule 3337
Rule 3373
Rubi steps
\begin {align*} \int \frac {\sinh ^2(x)}{a+b \sinh (x)+c \sinh ^2(x)} \, dx &=-\int \left (-\frac {1}{c}+\frac {-a-b \sinh (x)}{c \left (-a-b \sinh (x)-c \sinh ^2(x)\right )}\right ) \, dx\\ &=\frac {x}{c}-\frac {\int \frac {-a-b \sinh (x)}{-a-b \sinh (x)-c \sinh ^2(x)} \, dx}{c}\\ &=\frac {x}{c}-\frac {\left (i b-\frac {b^2-2 a c}{\sqrt {-b^2+4 a c}}\right ) \int \frac {1}{i b+\sqrt {-b^2+4 a c}+2 i c \sinh (x)} \, dx}{c}-\frac {\left (i b+\frac {b^2-2 a c}{\sqrt {-b^2+4 a c}}\right ) \int \frac {1}{i b-\sqrt {-b^2+4 a c}+2 i c \sinh (x)} \, dx}{c}\\ &=\frac {x}{c}-\frac {\left (2 \left (i b-\frac {b^2-2 a c}{\sqrt {-b^2+4 a c}}\right )\right ) \text {Subst}\left (\int \frac {1}{i b+\sqrt {-b^2+4 a c}+4 i c x-\left (i b+\sqrt {-b^2+4 a c}\right ) x^2} \, dx,x,\tanh \left (\frac {x}{2}\right )\right )}{c}-\frac {\left (2 \left (i b+\frac {b^2-2 a c}{\sqrt {-b^2+4 a c}}\right )\right ) \text {Subst}\left (\int \frac {1}{i b-\sqrt {-b^2+4 a c}+4 i c x-\left (i b-\sqrt {-b^2+4 a c}\right ) x^2} \, dx,x,\tanh \left (\frac {x}{2}\right )\right )}{c}\\ &=\frac {x}{c}+\frac {\left (4 \left (i b-\frac {b^2-2 a c}{\sqrt {-b^2+4 a c}}\right )\right ) \text {Subst}\left (\int \frac {1}{-8 \left (b^2-2 (a-c) c-i b \sqrt {-b^2+4 a c}\right )-x^2} \, dx,x,4 i c+2 \left (-i b-\sqrt {-b^2+4 a c}\right ) \tanh \left (\frac {x}{2}\right )\right )}{c}+\frac {\left (4 \left (i b+\frac {b^2-2 a c}{\sqrt {-b^2+4 a c}}\right )\right ) \text {Subst}\left (\int \frac {1}{-8 \left (b^2-2 (a-c) c+i b \sqrt {-b^2+4 a c}\right )-x^2} \, dx,x,4 i c+2 \left (-i b+\sqrt {-b^2+4 a c}\right ) \tanh \left (\frac {x}{2}\right )\right )}{c}\\ &=\frac {x}{c}-\frac {\sqrt {2} \left (i b+\frac {b^2-2 a c}{\sqrt {-b^2+4 a c}}\right ) \tan ^{-1}\left (\frac {2 i c-\left (i b-\sqrt {-b^2+4 a c}\right ) \tanh \left (\frac {x}{2}\right )}{\sqrt {2} \sqrt {b^2-2 (a-c) c+i b \sqrt {-b^2+4 a c}}}\right )}{c \sqrt {b^2-2 (a-c) c+i b \sqrt {-b^2+4 a c}}}-\frac {\sqrt {2} \left (i b-\frac {b^2-2 a c}{\sqrt {-b^2+4 a c}}\right ) \tan ^{-1}\left (\frac {2 i c-\left (i b+\sqrt {-b^2+4 a c}\right ) \tanh \left (\frac {x}{2}\right )}{\sqrt {2} \sqrt {b^2-2 (a-c) c-i b \sqrt {-b^2+4 a c}}}\right )}{c \sqrt {b^2-2 (a-c) c-i b \sqrt {-b^2+4 a c}}}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.38, size = 283, normalized size = 0.92 \begin {gather*} \frac {x-\frac {\sqrt {2} \left (-b^2+2 a c+b \sqrt {b^2-4 a c}\right ) \text {ArcTan}\left (\frac {2 c+\left (-b+\sqrt {b^2-4 a c}\right ) \tanh \left (\frac {x}{2}\right )}{\sqrt {-2 b^2+4 (a-c) c+2 b \sqrt {b^2-4 a c}}}\right )}{\sqrt {b^2-4 a c} \sqrt {-b^2+2 (a-c) c+b \sqrt {b^2-4 a c}}}-\frac {\sqrt {2} \left (b^2-2 a c+b \sqrt {b^2-4 a c}\right ) \text {ArcTan}\left (\frac {2 c-\left (b+\sqrt {b^2-4 a c}\right ) \tanh \left (\frac {x}{2}\right )}{\sqrt {2} \sqrt {-b^2+2 (a-c) c-b \sqrt {b^2-4 a c}}}\right )}{\sqrt {b^2-4 a c} \sqrt {-b^2+2 (a-c) c-b \sqrt {b^2-4 a c}}}}{c} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [C] Result contains higher order function than in optimal. Order 9 vs. order
3.
time = 2.51, size = 108, normalized size = 0.35
method | result | size |
default | \(\frac {\munderset {\textit {\_R} =\RootOf \left (a \,\textit {\_Z}^{4}-2 b \,\textit {\_Z}^{3}+\left (-2 a +4 c \right ) \textit {\_Z}^{2}+2 \textit {\_Z} b +a \right )}{\sum }\frac {\left (\textit {\_R}^{2} a -2 \textit {\_R} b -a \right ) \ln \left (\tanh \left (\frac {x}{2}\right )-\textit {\_R} \right )}{2 \textit {\_R}^{3} a -3 \textit {\_R}^{2} b -2 \textit {\_R} a +4 \textit {\_R} c +b}}{c}+\frac {\ln \left (\tanh \left (\frac {x}{2}\right )+1\right )}{c}-\frac {\ln \left (\tanh \left (\frac {x}{2}\right )-1\right )}{c}\) | \(108\) |
risch | \(\frac {x}{c}+\left (\munderset {\textit {\_R} =\RootOf \left (\left (16 a^{4} c^{4}-8 a^{3} b^{2} c^{3}-32 a^{3} c^{5}+a^{2} b^{4} c^{2}+32 a^{2} b^{2} c^{4}+16 a^{2} c^{6}-10 a \,b^{4} c^{3}-8 a \,b^{2} c^{5}+b^{6} c^{2}+b^{4} c^{4}\right ) \textit {\_Z}^{4}+\left (-8 a^{4} c^{2}+6 a^{3} b^{2} c +8 a^{3} c^{3}-a^{2} b^{4}-18 a^{2} b^{2} c^{2}+8 a \,b^{4} c -b^{6}\right ) \textit {\_Z}^{2}+a^{4}\right )}{\sum }\textit {\_R} \ln \left ({\mathrm e}^{x}+\left (\frac {3 c^{2} a^{2} b^{4}}{a^{4} b -2 a^{3} b c +a^{2} b^{3}}+\frac {22 c^{4} a^{2} b^{2}}{a^{4} b -2 a^{3} b c +a^{2} b^{3}}-\frac {8 c^{3} a \,b^{4}}{a^{4} b -2 a^{3} b c +a^{2} b^{3}}-\frac {6 c^{5} b^{2} a}{a^{4} b -2 a^{3} b c +a^{2} b^{3}}+\frac {2 c^{2} a^{4} b^{2}}{a^{4} b -2 a^{3} b c +a^{2} b^{3}}-\frac {18 c^{3} a^{3} b^{2}}{a^{4} b -2 a^{3} b c +a^{2} b^{3}}-\frac {8 c^{3} a^{5}}{a^{4} b -2 a^{3} b c +a^{2} b^{3}}+\frac {24 c^{4} a^{4}}{a^{4} b -2 a^{3} b c +a^{2} b^{3}}-\frac {24 c^{5} a^{3}}{a^{4} b -2 a^{3} b c +a^{2} b^{3}}+\frac {8 c^{6} a^{2}}{a^{4} b -2 a^{3} b c +a^{2} b^{3}}+\frac {c^{2} b^{6}}{a^{4} b -2 a^{3} b c +a^{2} b^{3}}+\frac {c^{4} b^{4}}{a^{4} b -2 a^{3} b c +a^{2} b^{3}}\right ) \textit {\_R}^{3}+\left (\frac {c \,a^{4} b^{2}}{a^{4} b -2 a^{3} b c +a^{2} b^{3}}-\frac {6 c^{2} a^{3} b^{2}}{a^{4} b -2 a^{3} b c +a^{2} b^{3}}+\frac {c \,a^{2} b^{4}}{a^{4} b -2 a^{3} b c +a^{2} b^{3}}+\frac {c^{3} b^{2} a^{2}}{a^{4} b -2 a^{3} b c +a^{2} b^{3}}-\frac {4 c^{2} a^{5}}{a^{4} b -2 a^{3} b c +a^{2} b^{3}}+\frac {8 c^{3} a^{4}}{a^{4} b -2 a^{3} b c +a^{2} b^{3}}-\frac {4 c^{4} a^{3}}{a^{4} b -2 a^{3} b c +a^{2} b^{3}}\right ) \textit {\_R}^{2}+\left (\frac {8 c \,a^{3} b^{2}}{a^{4} b -2 a^{3} b c +a^{2} b^{3}}-\frac {9 c^{2} b^{2} a^{2}}{a^{4} b -2 a^{3} b c +a^{2} b^{3}}+\frac {6 c \,b^{4} a}{a^{4} b -2 a^{3} b c +a^{2} b^{3}}-\frac {b^{6}}{a^{4} b -2 a^{3} b c +a^{2} b^{3}}-\frac {2 a^{2} b^{4}}{a^{4} b -2 a^{3} b c +a^{2} b^{3}}+\frac {2 c \,a^{5}}{a^{4} b -2 a^{3} b c +a^{2} b^{3}}-\frac {a^{4} b^{2}}{a^{4} b -2 a^{3} b c +a^{2} b^{3}}-\frac {4 a^{4} c^{2}}{a^{4} b -2 a^{3} b c +a^{2} b^{3}}+\frac {2 c^{3} a^{3}}{a^{4} b -2 a^{3} b c +a^{2} b^{3}}\right ) \textit {\_R} -\frac {a^{4} c}{a^{4} b -2 a^{3} b c +a^{2} b^{3}}+\frac {a^{3} b^{2}}{a^{4} b -2 a^{3} b c +a^{2} b^{3}}+\frac {a^{5}}{a^{4} b -2 a^{3} b c +a^{2} b^{3}}\right )\right )\) | \(1126\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \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. 4943 vs.
\(2 (253) = 506\).
time = 0.71, size = 4943, normalized size = 16.00 \begin {gather*} \text {Too large to display} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-1)] Timed out
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Timed out} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.80, size = 5, normalized size = 0.02 \begin {gather*} \frac {x}{c} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [F(-1)]
time = 0.00, size = -1, normalized size = -0.00 \begin {gather*} \text {Hanged} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________