Integrand size = 13, antiderivative size = 59 \[ \int \frac {\sinh ^2(x)}{a+b \cosh (x)} \, dx=-\frac {a x}{b^2}+\frac {2 \sqrt {a-b} \sqrt {a+b} \text {arctanh}\left (\frac {\sqrt {a-b} \tanh \left (\frac {x}{2}\right )}{\sqrt {a+b}}\right )}{b^2}+\frac {\sinh (x)}{b} \] Output:
-a*x/b^2+2*(a-b)^(1/2)*(a+b)^(1/2)*arctanh((a-b)^(1/2)*tanh(1/2*x)/(a+b)^( 1/2))/b^2+sinh(x)/b
Time = 0.09 (sec) , antiderivative size = 54, normalized size of antiderivative = 0.92 \[ \int \frac {\sinh ^2(x)}{a+b \cosh (x)} \, dx=\frac {-a x+2 \sqrt {-a^2+b^2} \arctan \left (\frac {(a-b) \tanh \left (\frac {x}{2}\right )}{\sqrt {-a^2+b^2}}\right )+b \sinh (x)}{b^2} \] Input:
Integrate[Sinh[x]^2/(a + b*Cosh[x]),x]
Output:
(-(a*x) + 2*Sqrt[-a^2 + b^2]*ArcTan[((a - b)*Tanh[x/2])/Sqrt[-a^2 + b^2]] + b*Sinh[x])/b^2
Time = 0.41 (sec) , antiderivative size = 73, normalized size of antiderivative = 1.24, number of steps used = 10, number of rules used = 9, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.692, Rules used = {3042, 25, 3174, 25, 3042, 3214, 3042, 3138, 221}
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 {\sinh ^2(x)}{a+b \cosh (x)} \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int -\frac {\cos \left (-\frac {\pi }{2}+i x\right )^2}{a-b \sin \left (-\frac {\pi }{2}+i x\right )}dx\) |
\(\Big \downarrow \) 25 |
\(\displaystyle -\int \frac {\cos \left (i x-\frac {\pi }{2}\right )^2}{a-b \sin \left (i x-\frac {\pi }{2}\right )}dx\) |
\(\Big \downarrow \) 3174 |
\(\displaystyle \frac {\int -\frac {b+a \cosh (x)}{a+b \cosh (x)}dx}{b}+\frac {\sinh (x)}{b}\) |
\(\Big \downarrow \) 25 |
\(\displaystyle \frac {\sinh (x)}{b}-\frac {\int \frac {b+a \cosh (x)}{a+b \cosh (x)}dx}{b}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {\sinh (x)}{b}-\frac {\int \frac {b+a \sin \left (i x+\frac {\pi }{2}\right )}{a+b \sin \left (i x+\frac {\pi }{2}\right )}dx}{b}\) |
\(\Big \downarrow \) 3214 |
\(\displaystyle \frac {\sinh (x)}{b}-\frac {\frac {a x}{b}-\frac {\left (a^2-b^2\right ) \int \frac {1}{a+b \cosh (x)}dx}{b}}{b}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {\sinh (x)}{b}-\frac {\frac {a x}{b}-\frac {\left (a^2-b^2\right ) \int \frac {1}{a+b \sin \left (i x+\frac {\pi }{2}\right )}dx}{b}}{b}\) |
\(\Big \downarrow \) 3138 |
\(\displaystyle \frac {\sinh (x)}{b}-\frac {\frac {a x}{b}-\frac {2 \left (a^2-b^2\right ) \int \frac {1}{-\left ((a-b) \tanh ^2\left (\frac {x}{2}\right )\right )+a+b}d\tanh \left (\frac {x}{2}\right )}{b}}{b}\) |
\(\Big \downarrow \) 221 |
\(\displaystyle \frac {\sinh (x)}{b}-\frac {\frac {a x}{b}-\frac {2 \left (a^2-b^2\right ) \text {arctanh}\left (\frac {\sqrt {a-b} \tanh \left (\frac {x}{2}\right )}{\sqrt {a+b}}\right )}{b \sqrt {a-b} \sqrt {a+b}}}{b}\) |
Input:
Int[Sinh[x]^2/(a + b*Cosh[x]),x]
Output:
-(((a*x)/b - (2*(a^2 - b^2)*ArcTanh[(Sqrt[a - b]*Tanh[x/2])/Sqrt[a + b]])/ (Sqrt[a - b]*b*Sqrt[a + b]))/b) + Sinh[x]/b
Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[-a/b, 2]/a)*ArcTanh[x /Rt[-a/b, 2]], x] /; FreeQ[{a, b}, x] && NegQ[a/b]
Int[((a_) + (b_.)*sin[Pi/2 + (c_.) + (d_.)*(x_)])^(-1), x_Symbol] :> With[{ e = FreeFactors[Tan[(c + d*x)/2], x]}, Simp[2*(e/d) Subst[Int[1/(a + b + (a - b)*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[(cos[(e_.) + (f_.)*(x_)]*(g_.))^(p_)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x _)])^(m_), x_Symbol] :> Simp[g*(g*Cos[e + f*x])^(p - 1)*((a + b*Sin[e + f*x ])^(m + 1)/(b*f*(m + p))), x] + Simp[g^2*((p - 1)/(b*(m + p))) Int[(g*Cos [e + f*x])^(p - 2)*(a + b*Sin[e + f*x])^m*(b + a*Sin[e + f*x]), x], x] /; F reeQ[{a, b, e, f, g, m}, x] && NeQ[a^2 - b^2, 0] && GtQ[p, 1] && NeQ[m + p, 0] && IntegersQ[2*m, 2*p]
Int[((a_.) + (b_.)*sin[(e_.) + (f_.)*(x_)])/((c_.) + (d_.)*sin[(e_.) + (f_. )*(x_)]), x_Symbol] :> Simp[b*(x/d), x] - Simp[(b*c - a*d)/d Int[1/(c + d *Sin[e + f*x]), x], x] /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d, 0]
Leaf count of result is larger than twice the leaf count of optimal. \(99\) vs. \(2(49)=98\).
Time = 1.33 (sec) , antiderivative size = 100, normalized size of antiderivative = 1.69
method | result | size |
default | \(-\frac {1}{b \left (1+\tanh \left (\frac {x}{2}\right )\right )}-\frac {a \ln \left (1+\tanh \left (\frac {x}{2}\right )\right )}{b^{2}}-\frac {2 \left (-a^{2}+b^{2}\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 )}{b^{2} \sqrt {\left (a +b \right ) \left (a -b \right )}}-\frac {1}{b \left (\tanh \left (\frac {x}{2}\right )-1\right )}+\frac {a \ln \left (\tanh \left (\frac {x}{2}\right )-1\right )}{b^{2}}\) | \(100\) |
risch | \(-\frac {a x}{b^{2}}+\frac {{\mathrm e}^{x}}{2 b}-\frac {{\mathrm e}^{-x}}{2 b}+\frac {\sqrt {a^{2}-b^{2}}\, \ln \left ({\mathrm e}^{x}-\frac {-a +\sqrt {a^{2}-b^{2}}}{b}\right )}{b^{2}}-\frac {\sqrt {a^{2}-b^{2}}\, \ln \left ({\mathrm e}^{x}+\frac {a +\sqrt {a^{2}-b^{2}}}{b}\right )}{b^{2}}\) | \(101\) |
Input:
int(sinh(x)^2/(a+b*cosh(x)),x,method=_RETURNVERBOSE)
Output:
-1/b/(1+tanh(1/2*x))-a/b^2*ln(1+tanh(1/2*x))-2/b^2*(-a^2+b^2)/((a+b)*(a-b) )^(1/2)*arctanh((a-b)*tanh(1/2*x)/((a+b)*(a-b))^(1/2))-1/b/(tanh(1/2*x)-1) +a/b^2*ln(tanh(1/2*x)-1)
Leaf count of result is larger than twice the leaf count of optimal. 105 vs. \(2 (49) = 98\).
Time = 0.11 (sec) , antiderivative size = 279, normalized size of antiderivative = 4.73 \[ \int \frac {\sinh ^2(x)}{a+b \cosh (x)} \, dx=\left [-\frac {2 \, a x \cosh \left (x\right ) - b \cosh \left (x\right )^{2} - b \sinh \left (x\right )^{2} - 2 \, \sqrt {a^{2} - b^{2}} {\left (\cosh \left (x\right ) + \sinh \left (x\right )\right )} \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 ) + 2 \, {\left (a x - b \cosh \left (x\right )\right )} \sinh \left (x\right ) + b}{2 \, {\left (b^{2} \cosh \left (x\right ) + b^{2} \sinh \left (x\right )\right )}}, -\frac {2 \, a x \cosh \left (x\right ) - b \cosh \left (x\right )^{2} - b \sinh \left (x\right )^{2} + 4 \, \sqrt {-a^{2} + b^{2}} {\left (\cosh \left (x\right ) + \sinh \left (x\right )\right )} \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 ) + 2 \, {\left (a x - b \cosh \left (x\right )\right )} \sinh \left (x\right ) + b}{2 \, {\left (b^{2} \cosh \left (x\right ) + b^{2} \sinh \left (x\right )\right )}}\right ] \] Input:
integrate(sinh(x)^2/(a+b*cosh(x)),x, algorithm="fricas")
Output:
[-1/2*(2*a*x*cosh(x) - b*cosh(x)^2 - b*sinh(x)^2 - 2*sqrt(a^2 - b^2)*(cosh (x) + sinh(x))*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*s inh(x) + a))/(b*cosh(x)^2 + b*sinh(x)^2 + 2*a*cosh(x) + 2*(b*cosh(x) + a)* sinh(x) + b)) + 2*(a*x - b*cosh(x))*sinh(x) + b)/(b^2*cosh(x) + b^2*sinh(x )), -1/2*(2*a*x*cosh(x) - b*cosh(x)^2 - b*sinh(x)^2 + 4*sqrt(-a^2 + b^2)*( cosh(x) + sinh(x))*arctan(-sqrt(-a^2 + b^2)*(b*cosh(x) + b*sinh(x) + a)/(a ^2 - b^2)) + 2*(a*x - b*cosh(x))*sinh(x) + b)/(b^2*cosh(x) + b^2*sinh(x))]
Leaf count of result is larger than twice the leaf count of optimal. 892 vs. \(2 (49) = 98\).
Time = 52.90 (sec) , antiderivative size = 892, normalized size of antiderivative = 15.12 \[ \int \frac {\sinh ^2(x)}{a+b \cosh (x)} \, dx=\text {Too large to display} \] Input:
integrate(sinh(x)**2/(a+b*cosh(x)),x)
Output:
Piecewise((zoo*(-2*tanh(x/2)**2*atan(tanh(x/2))/(tanh(x/2)**2 - 1) - 2*tan h(x/2)/(tanh(x/2)**2 - 1) + 2*atan(tanh(x/2))/(tanh(x/2)**2 - 1)), Eq(a, 0 ) & Eq(b, 0)), (-x*tanh(x/2)**2/(b*tanh(x/2)**2 - b) + x/(b*tanh(x/2)**2 - b) - 2*tanh(x/2)/(b*tanh(x/2)**2 - b), Eq(a, b)), (x*tanh(x/2)**2/(b*tanh (x/2)**2 - b) - x/(b*tanh(x/2)**2 - b) - 2*tanh(x/2)/(b*tanh(x/2)**2 - b), Eq(a, -b)), ((x*sinh(x)**2/2 - x*cosh(x)**2/2 + sinh(x)*cosh(x)/2)/a, Eq( b, 0)), (-a*x*sqrt(a/(a - b) + b/(a - b))*tanh(x/2)**2/(b**2*sqrt(a/(a - b ) + b/(a - b))*tanh(x/2)**2 - b**2*sqrt(a/(a - b) + b/(a - b))) + a*x*sqrt (a/(a - b) + b/(a - b))/(b**2*sqrt(a/(a - b) + b/(a - b))*tanh(x/2)**2 - b **2*sqrt(a/(a - b) + b/(a - b))) - a*log(-sqrt(a/(a - b) + b/(a - b)) + ta nh(x/2))*tanh(x/2)**2/(b**2*sqrt(a/(a - b) + b/(a - b))*tanh(x/2)**2 - b** 2*sqrt(a/(a - b) + b/(a - b))) + a*log(-sqrt(a/(a - b) + b/(a - b)) + tanh (x/2))/(b**2*sqrt(a/(a - b) + b/(a - b))*tanh(x/2)**2 - b**2*sqrt(a/(a - b ) + b/(a - b))) + a*log(sqrt(a/(a - b) + b/(a - b)) + tanh(x/2))*tanh(x/2) **2/(b**2*sqrt(a/(a - b) + b/(a - b))*tanh(x/2)**2 - b**2*sqrt(a/(a - b) + b/(a - b))) - a*log(sqrt(a/(a - b) + b/(a - b)) + tanh(x/2))/(b**2*sqrt(a /(a - b) + b/(a - b))*tanh(x/2)**2 - b**2*sqrt(a/(a - b) + b/(a - b))) - 2 *b*sqrt(a/(a - b) + b/(a - b))*tanh(x/2)/(b**2*sqrt(a/(a - b) + b/(a - b)) *tanh(x/2)**2 - b**2*sqrt(a/(a - b) + b/(a - b))) - b*log(-sqrt(a/(a - b) + b/(a - b)) + tanh(x/2))*tanh(x/2)**2/(b**2*sqrt(a/(a - b) + b/(a - b)...
Exception generated. \[ \int \frac {\sinh ^2(x)}{a+b \cosh (x)} \, dx=\text {Exception raised: ValueError} \] Input:
integrate(sinh(x)^2/(a+b*cosh(x)),x, algorithm="maxima")
Output:
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.12 (sec) , antiderivative size = 68, normalized size of antiderivative = 1.15 \[ \int \frac {\sinh ^2(x)}{a+b \cosh (x)} \, dx=-\frac {a x}{b^{2}} - \frac {e^{\left (-x\right )}}{2 \, b} + \frac {e^{x}}{2 \, b} + \frac {2 \, {\left (a^{2} - b^{2}\right )} \arctan \left (\frac {b e^{x} + a}{\sqrt {-a^{2} + b^{2}}}\right )}{\sqrt {-a^{2} + b^{2}} b^{2}} \] Input:
integrate(sinh(x)^2/(a+b*cosh(x)),x, algorithm="giac")
Output:
-a*x/b^2 - 1/2*e^(-x)/b + 1/2*e^x/b + 2*(a^2 - b^2)*arctan((b*e^x + a)/sqr t(-a^2 + b^2))/(sqrt(-a^2 + b^2)*b^2)
Time = 2.07 (sec) , antiderivative size = 139, normalized size of antiderivative = 2.36 \[ \int \frac {\sinh ^2(x)}{a+b \cosh (x)} \, dx=\frac {{\mathrm {e}}^x}{2\,b}-\frac {{\mathrm {e}}^{-x}}{2\,b}-\frac {a\,x}{b^2}+\frac {\ln \left (-\frac {2\,{\mathrm {e}}^x\,\left (a^2-b^2\right )}{b^3}-\frac {2\,\sqrt {a+b}\,\left (b+a\,{\mathrm {e}}^x\right )\,\sqrt {a-b}}{b^3}\right )\,\sqrt {a+b}\,\sqrt {a-b}}{b^2}-\frac {\ln \left (\frac {2\,\sqrt {a+b}\,\left (b+a\,{\mathrm {e}}^x\right )\,\sqrt {a-b}}{b^3}-\frac {2\,{\mathrm {e}}^x\,\left (a^2-b^2\right )}{b^3}\right )\,\sqrt {a+b}\,\sqrt {a-b}}{b^2} \] Input:
int(sinh(x)^2/(a + b*cosh(x)),x)
Output:
exp(x)/(2*b) - exp(-x)/(2*b) - (a*x)/b^2 + (log(- (2*exp(x)*(a^2 - b^2))/b ^3 - (2*(a + b)^(1/2)*(b + a*exp(x))*(a - b)^(1/2))/b^3)*(a + b)^(1/2)*(a - b)^(1/2))/b^2 - (log((2*(a + b)^(1/2)*(b + a*exp(x))*(a - b)^(1/2))/b^3 - (2*exp(x)*(a^2 - b^2))/b^3)*(a + b)^(1/2)*(a - b)^(1/2))/b^2
Time = 0.26 (sec) , antiderivative size = 64, normalized size of antiderivative = 1.08 \[ \int \frac {\sinh ^2(x)}{a+b \cosh (x)} \, dx=\frac {-4 e^{x} \sqrt {-a^{2}+b^{2}}\, \mathit {atan} \left (\frac {e^{x} b +a}{\sqrt {-a^{2}+b^{2}}}\right )+e^{2 x} b -2 e^{x} a x -b}{2 e^{x} b^{2}} \] Input:
int(sinh(x)^2/(a+b*cosh(x)),x)
Output:
( - 4*e**x*sqrt( - a**2 + b**2)*atan((e**x*b + a)/sqrt( - a**2 + b**2)) + e**(2*x)*b - 2*e**x*a*x - b)/(2*e**x*b**2)