\(\int \frac {x}{a+b \sinh ^2(x)} \, dx\) [259]

Optimal result
Mathematica [A] (verified)
Rubi [A] (verified)
Maple [B] (verified)
Fricas [B] (verification not implemented)
Sympy [F]
Maxima [F]
Giac [F]
Mupad [F(-1)]
Reduce [F]

Optimal result

Integrand size = 12, antiderivative size = 215 \[ \int \frac {x}{a+b \sinh ^2(x)} \, dx=\frac {x \log \left (1+\frac {b e^{2 x}}{2 a-2 \sqrt {a} \sqrt {a-b}-b}\right )}{2 \sqrt {a} \sqrt {a-b}}-\frac {x \log \left (1+\frac {b e^{2 x}}{2 a+2 \sqrt {a} \sqrt {a-b}-b}\right )}{2 \sqrt {a} \sqrt {a-b}}+\frac {\operatorname {PolyLog}\left (2,-\frac {b e^{2 x}}{2 a-2 \sqrt {a} \sqrt {a-b}-b}\right )}{4 \sqrt {a} \sqrt {a-b}}-\frac {\operatorname {PolyLog}\left (2,-\frac {b e^{2 x}}{2 a+2 \sqrt {a} \sqrt {a-b}-b}\right )}{4 \sqrt {a} \sqrt {a-b}} \] Output:

1/2*x*ln(1+b*exp(2*x)/(2*a-2*a^(1/2)*(a-b)^(1/2)-b))/a^(1/2)/(a-b)^(1/2)-1 
/2*x*ln(1+b*exp(2*x)/(2*a+2*a^(1/2)*(a-b)^(1/2)-b))/a^(1/2)/(a-b)^(1/2)+1/ 
4*polylog(2,-b*exp(2*x)/(2*a-2*a^(1/2)*(a-b)^(1/2)-b))/a^(1/2)/(a-b)^(1/2) 
-1/4*polylog(2,-b*exp(2*x)/(2*a+2*a^(1/2)*(a-b)^(1/2)-b))/a^(1/2)/(a-b)^(1 
/2)
 

Mathematica [A] (verified)

Time = 0.23 (sec) , antiderivative size = 294, normalized size of antiderivative = 1.37 \[ \int \frac {x}{a+b \sinh ^2(x)} \, dx=\frac {-x \log \left (1-\frac {e^x}{\sqrt {\frac {-2 a-2 \sqrt {a (a-b)}+b}{b}}}\right )-x \log \left (1+\frac {e^x}{\sqrt {\frac {-2 a-2 \sqrt {a (a-b)}+b}{b}}}\right )+x \log \left (1-\frac {e^x}{\sqrt {\frac {-2 a+2 \sqrt {a (a-b)}+b}{b}}}\right )+x \log \left (1+\frac {e^x}{\sqrt {\frac {-2 a+2 \sqrt {a (a-b)}+b}{b}}}\right )-\operatorname {PolyLog}\left (2,-\frac {e^x}{\sqrt {\frac {-2 a-2 \sqrt {a (a-b)}+b}{b}}}\right )-\operatorname {PolyLog}\left (2,\frac {e^x}{\sqrt {\frac {-2 a-2 \sqrt {a (a-b)}+b}{b}}}\right )+\operatorname {PolyLog}\left (2,-\frac {e^x}{\sqrt {\frac {-2 a+2 \sqrt {a (a-b)}+b}{b}}}\right )+\operatorname {PolyLog}\left (2,\frac {e^x}{\sqrt {\frac {-2 a+2 \sqrt {a (a-b)}+b}{b}}}\right )}{2 \sqrt {a (a-b)}} \] Input:

Integrate[x/(a + b*Sinh[x]^2),x]
 

Output:

(-(x*Log[1 - E^x/Sqrt[(-2*a - 2*Sqrt[a*(a - b)] + b)/b]]) - x*Log[1 + E^x/ 
Sqrt[(-2*a - 2*Sqrt[a*(a - b)] + b)/b]] + x*Log[1 - E^x/Sqrt[(-2*a + 2*Sqr 
t[a*(a - b)] + b)/b]] + x*Log[1 + E^x/Sqrt[(-2*a + 2*Sqrt[a*(a - b)] + b)/ 
b]] - PolyLog[2, -(E^x/Sqrt[(-2*a - 2*Sqrt[a*(a - b)] + b)/b])] - PolyLog[ 
2, E^x/Sqrt[(-2*a - 2*Sqrt[a*(a - b)] + b)/b]] + PolyLog[2, -(E^x/Sqrt[(-2 
*a + 2*Sqrt[a*(a - b)] + b)/b])] + PolyLog[2, E^x/Sqrt[(-2*a + 2*Sqrt[a*(a 
 - b)] + b)/b]])/(2*Sqrt[a*(a - b)])
 

Rubi [A] (verified)

Time = 0.79 (sec) , antiderivative size = 213, normalized size of antiderivative = 0.99, number of steps used = 9, number of rules used = 8, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.667, Rules used = {6163, 3042, 3801, 2694, 27, 2620, 2715, 2838}

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 {x}{a+b \sinh ^2(x)} \, dx\)

\(\Big \downarrow \) 6163

\(\displaystyle 2 \int \frac {x}{2 a-b+b \cosh (2 x)}dx\)

\(\Big \downarrow \) 3042

\(\displaystyle 2 \int \frac {x}{2 a-b+b \sin \left (2 i x+\frac {\pi }{2}\right )}dx\)

\(\Big \downarrow \) 3801

\(\displaystyle 4 \int \frac {e^{2 x} x}{2 e^{2 x} (2 a-b)+b e^{4 x}+b}dx\)

\(\Big \downarrow \) 2694

\(\displaystyle 4 \left (\frac {b \int \frac {e^{2 x} x}{2 \left (2 a-2 \sqrt {a-b} \sqrt {a}+b e^{2 x}-b\right )}dx}{2 \sqrt {a} \sqrt {a-b}}-\frac {b \int \frac {e^{2 x} x}{2 \left (2 a+2 \sqrt {a-b} \sqrt {a}+b e^{2 x}-b\right )}dx}{2 \sqrt {a} \sqrt {a-b}}\right )\)

\(\Big \downarrow \) 27

\(\displaystyle 4 \left (\frac {b \int \frac {e^{2 x} x}{2 a-2 \sqrt {a-b} \sqrt {a}+b e^{2 x}-b}dx}{4 \sqrt {a} \sqrt {a-b}}-\frac {b \int \frac {e^{2 x} x}{2 a+2 \sqrt {a-b} \sqrt {a}+b e^{2 x}-b}dx}{4 \sqrt {a} \sqrt {a-b}}\right )\)

\(\Big \downarrow \) 2620

\(\displaystyle 4 \left (\frac {b \left (\frac {x \log \left (\frac {b e^{2 x}}{-2 \sqrt {a} \sqrt {a-b}+2 a-b}+1\right )}{2 b}-\frac {\int \log \left (\frac {e^{2 x} b}{2 a-2 \sqrt {a-b} \sqrt {a}-b}+1\right )dx}{2 b}\right )}{4 \sqrt {a} \sqrt {a-b}}-\frac {b \left (\frac {x \log \left (\frac {b e^{2 x}}{2 \sqrt {a} \sqrt {a-b}+2 a-b}+1\right )}{2 b}-\frac {\int \log \left (\frac {e^{2 x} b}{2 a+2 \sqrt {a-b} \sqrt {a}-b}+1\right )dx}{2 b}\right )}{4 \sqrt {a} \sqrt {a-b}}\right )\)

\(\Big \downarrow \) 2715

\(\displaystyle 4 \left (\frac {b \left (\frac {x \log \left (\frac {b e^{2 x}}{-2 \sqrt {a} \sqrt {a-b}+2 a-b}+1\right )}{2 b}-\frac {\int e^{-2 x} \log \left (\frac {e^{2 x} b}{2 a-2 \sqrt {a-b} \sqrt {a}-b}+1\right )de^{2 x}}{4 b}\right )}{4 \sqrt {a} \sqrt {a-b}}-\frac {b \left (\frac {x \log \left (\frac {b e^{2 x}}{2 \sqrt {a} \sqrt {a-b}+2 a-b}+1\right )}{2 b}-\frac {\int e^{-2 x} \log \left (\frac {e^{2 x} b}{2 a+2 \sqrt {a-b} \sqrt {a}-b}+1\right )de^{2 x}}{4 b}\right )}{4 \sqrt {a} \sqrt {a-b}}\right )\)

\(\Big \downarrow \) 2838

\(\displaystyle 4 \left (\frac {b \left (\frac {\operatorname {PolyLog}\left (2,-\frac {b e^{2 x}}{2 a-2 \sqrt {a-b} \sqrt {a}-b}\right )}{4 b}+\frac {x \log \left (\frac {b e^{2 x}}{-2 \sqrt {a} \sqrt {a-b}+2 a-b}+1\right )}{2 b}\right )}{4 \sqrt {a} \sqrt {a-b}}-\frac {b \left (\frac {\operatorname {PolyLog}\left (2,-\frac {b e^{2 x}}{2 a+2 \sqrt {a-b} \sqrt {a}-b}\right )}{4 b}+\frac {x \log \left (\frac {b e^{2 x}}{2 \sqrt {a} \sqrt {a-b}+2 a-b}+1\right )}{2 b}\right )}{4 \sqrt {a} \sqrt {a-b}}\right )\)

Input:

Int[x/(a + b*Sinh[x]^2),x]
 

Output:

4*((b*((x*Log[1 + (b*E^(2*x))/(2*a - 2*Sqrt[a]*Sqrt[a - b] - b)])/(2*b) + 
PolyLog[2, -((b*E^(2*x))/(2*a - 2*Sqrt[a]*Sqrt[a - b] - b))]/(4*b)))/(4*Sq 
rt[a]*Sqrt[a - b]) - (b*((x*Log[1 + (b*E^(2*x))/(2*a + 2*Sqrt[a]*Sqrt[a - 
b] - b)])/(2*b) + PolyLog[2, -((b*E^(2*x))/(2*a + 2*Sqrt[a]*Sqrt[a - b] - 
b))]/(4*b)))/(4*Sqrt[a]*Sqrt[a - b]))
 

Defintions of rubi rules used

rule 27
Int[(a_)*(Fx_), x_Symbol] :> Simp[a   Int[Fx, x], x] /; FreeQ[a, x] &&  !Ma 
tchQ[Fx, (b_)*(Gx_) /; FreeQ[b, x]]
 

rule 2620
Int[(((F_)^((g_.)*((e_.) + (f_.)*(x_))))^(n_.)*((c_.) + (d_.)*(x_))^(m_.))/ 
((a_) + (b_.)*((F_)^((g_.)*((e_.) + (f_.)*(x_))))^(n_.)), x_Symbol] :> Simp 
[((c + d*x)^m/(b*f*g*n*Log[F]))*Log[1 + b*((F^(g*(e + f*x)))^n/a)], x] - Si 
mp[d*(m/(b*f*g*n*Log[F]))   Int[(c + d*x)^(m - 1)*Log[1 + b*((F^(g*(e + f*x 
)))^n/a)], x], x] /; FreeQ[{F, a, b, c, d, e, f, g, n}, x] && IGtQ[m, 0]
 

rule 2694
Int[((F_)^(u_)*((f_.) + (g_.)*(x_))^(m_.))/((a_.) + (b_.)*(F_)^(u_) + (c_.) 
*(F_)^(v_)), x_Symbol] :> With[{q = Rt[b^2 - 4*a*c, 2]}, Simp[2*(c/q)   Int 
[(f + g*x)^m*(F^u/(b - q + 2*c*F^u)), x], x] - Simp[2*(c/q)   Int[(f + g*x) 
^m*(F^u/(b + q + 2*c*F^u)), x], x]] /; FreeQ[{F, a, b, c, f, g}, x] && EqQ[ 
v, 2*u] && LinearQ[u, x] && NeQ[b^2 - 4*a*c, 0] && IGtQ[m, 0]
 

rule 2715
Int[Log[(a_) + (b_.)*((F_)^((e_.)*((c_.) + (d_.)*(x_))))^(n_.)], x_Symbol] 
:> Simp[1/(d*e*n*Log[F])   Subst[Int[Log[a + b*x]/x, x], x, (F^(e*(c + d*x) 
))^n], x] /; FreeQ[{F, a, b, c, d, e, n}, x] && GtQ[a, 0]
 

rule 2838
Int[Log[(c_.)*((d_) + (e_.)*(x_)^(n_.))]/(x_), x_Symbol] :> Simp[-PolyLog[2 
, (-c)*e*x^n]/n, x] /; FreeQ[{c, d, e, n}, x] && EqQ[c*d, 1]
 

rule 3042
Int[u_, x_Symbol] :> Int[DeactivateTrig[u, x], x] /; FunctionOfTrigOfLinear 
Q[u, x]
 

rule 3801
Int[((c_.) + (d_.)*(x_))^(m_.)/((a_) + (b_.)*sin[(e_.) + Pi*(k_.) + (Comple 
x[0, fz_])*(f_.)*(x_)]), x_Symbol] :> Simp[2   Int[((c + d*x)^m*(E^((-I)*e 
+ f*fz*x)/(b + (2*a*E^((-I)*e + f*fz*x))/E^(I*Pi*(k - 1/2)) - (b*E^(2*((-I) 
*e + f*fz*x)))/E^(2*I*k*Pi))))/E^(I*Pi*(k - 1/2)), x], x] /; FreeQ[{a, b, c 
, d, e, f, fz}, x] && IntegerQ[2*k] && NeQ[a^2 - b^2, 0] && IGtQ[m, 0]
 

rule 6163
Int[(x_)^(m_.)*((a_) + (b_.)*Sinh[(c_.) + (d_.)*(x_)]^2)^(n_), x_Symbol] :> 
 Simp[1/2^n   Int[x^m*(2*a - b + b*Cosh[2*c + 2*d*x])^n, x], x] /; FreeQ[{a 
, b, c, d}, x] && NeQ[a - b, 0] && IGtQ[m, 0] && ILtQ[n, 0] && (EqQ[n, -1] 
|| (EqQ[m, 1] && EqQ[n, -2]))
 
Maple [B] (verified)

Leaf count of result is larger than twice the leaf count of optimal. \(504\) vs. \(2(171)=342\).

Time = 0.21 (sec) , antiderivative size = 505, normalized size of antiderivative = 2.35

method result size
risch \(\frac {x \ln \left (1-\frac {b \,{\mathrm e}^{2 x}}{2 \sqrt {\left (a -b \right ) a}-2 a +b}\right )}{2 \sqrt {\left (a -b \right ) a}}-\frac {x^{2}}{2 \sqrt {\left (a -b \right ) a}}+\frac {\operatorname {polylog}\left (2, \frac {b \,{\mathrm e}^{2 x}}{2 \sqrt {\left (a -b \right ) a}-2 a +b}\right )}{4 \sqrt {\left (a -b \right ) a}}+\frac {\ln \left (1-\frac {b \,{\mathrm e}^{2 x}}{-2 \sqrt {\left (a -b \right ) a}-2 a +b}\right ) x}{-2 \sqrt {\left (a -b \right ) a}-2 a +b}+\frac {\ln \left (1-\frac {b \,{\mathrm e}^{2 x}}{-2 \sqrt {\left (a -b \right ) a}-2 a +b}\right ) a x}{\sqrt {\left (a -b \right ) a}\, \left (-2 \sqrt {\left (a -b \right ) a}-2 a +b \right )}-\frac {\ln \left (1-\frac {b \,{\mathrm e}^{2 x}}{-2 \sqrt {\left (a -b \right ) a}-2 a +b}\right ) b x}{2 \sqrt {\left (a -b \right ) a}\, \left (-2 \sqrt {\left (a -b \right ) a}-2 a +b \right )}-\frac {x^{2}}{-2 \sqrt {\left (a -b \right ) a}-2 a +b}-\frac {a \,x^{2}}{\sqrt {\left (a -b \right ) a}\, \left (-2 \sqrt {\left (a -b \right ) a}-2 a +b \right )}+\frac {b \,x^{2}}{2 \sqrt {\left (a -b \right ) a}\, \left (-2 \sqrt {\left (a -b \right ) a}-2 a +b \right )}+\frac {\operatorname {polylog}\left (2, \frac {b \,{\mathrm e}^{2 x}}{-2 \sqrt {\left (a -b \right ) a}-2 a +b}\right )}{-4 \sqrt {\left (a -b \right ) a}-4 a +2 b}+\frac {\operatorname {polylog}\left (2, \frac {b \,{\mathrm e}^{2 x}}{-2 \sqrt {\left (a -b \right ) a}-2 a +b}\right ) a}{2 \sqrt {\left (a -b \right ) a}\, \left (-2 \sqrt {\left (a -b \right ) a}-2 a +b \right )}-\frac {\operatorname {polylog}\left (2, \frac {b \,{\mathrm e}^{2 x}}{-2 \sqrt {\left (a -b \right ) a}-2 a +b}\right ) b}{4 \sqrt {\left (a -b \right ) a}\, \left (-2 \sqrt {\left (a -b \right ) a}-2 a +b \right )}\) \(505\)

Input:

int(x/(a+b*sinh(x)^2),x,method=_RETURNVERBOSE)
 

Output:

1/2/((a-b)*a)^(1/2)*x*ln(1-b*exp(2*x)/(2*((a-b)*a)^(1/2)-2*a+b))-1/2/((a-b 
)*a)^(1/2)*x^2+1/4/((a-b)*a)^(1/2)*polylog(2,b*exp(2*x)/(2*((a-b)*a)^(1/2) 
-2*a+b))+1/(-2*((a-b)*a)^(1/2)-2*a+b)*ln(1-b*exp(2*x)/(-2*((a-b)*a)^(1/2)- 
2*a+b))*x+1/((a-b)*a)^(1/2)/(-2*((a-b)*a)^(1/2)-2*a+b)*ln(1-b*exp(2*x)/(-2 
*((a-b)*a)^(1/2)-2*a+b))*a*x-1/2/((a-b)*a)^(1/2)/(-2*((a-b)*a)^(1/2)-2*a+b 
)*ln(1-b*exp(2*x)/(-2*((a-b)*a)^(1/2)-2*a+b))*b*x-1/(-2*((a-b)*a)^(1/2)-2* 
a+b)*x^2-1/((a-b)*a)^(1/2)/(-2*((a-b)*a)^(1/2)-2*a+b)*a*x^2+1/2/((a-b)*a)^ 
(1/2)/(-2*((a-b)*a)^(1/2)-2*a+b)*b*x^2+1/2/(-2*((a-b)*a)^(1/2)-2*a+b)*poly 
log(2,b*exp(2*x)/(-2*((a-b)*a)^(1/2)-2*a+b))+1/2/((a-b)*a)^(1/2)/(-2*((a-b 
)*a)^(1/2)-2*a+b)*polylog(2,b*exp(2*x)/(-2*((a-b)*a)^(1/2)-2*a+b))*a-1/4/( 
(a-b)*a)^(1/2)/(-2*((a-b)*a)^(1/2)-2*a+b)*polylog(2,b*exp(2*x)/(-2*((a-b)* 
a)^(1/2)-2*a+b))*b
 

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 837 vs. \(2 (165) = 330\).

Time = 0.17 (sec) , antiderivative size = 837, normalized size of antiderivative = 3.89 \[ \int \frac {x}{a+b \sinh ^2(x)} \, dx =\text {Too large to display} \] Input:

integrate(x/(a+b*sinh(x)^2),x, algorithm="fricas")
 

Output:

-1/2*(b*x*sqrt((a^2 - a*b)/b^2)*log((((2*a - b)*cosh(x) + (2*a - b)*sinh(x 
) - 2*(b*cosh(x) + b*sinh(x))*sqrt((a^2 - a*b)/b^2))*sqrt(-(2*b*sqrt((a^2 
- a*b)/b^2) + 2*a - b)/b) + b)/b) + b*x*sqrt((a^2 - a*b)/b^2)*log(-(((2*a 
- b)*cosh(x) + (2*a - b)*sinh(x) - 2*(b*cosh(x) + b*sinh(x))*sqrt((a^2 - a 
*b)/b^2))*sqrt(-(2*b*sqrt((a^2 - a*b)/b^2) + 2*a - b)/b) - b)/b) - b*x*sqr 
t((a^2 - a*b)/b^2)*log((((2*a - b)*cosh(x) + (2*a - b)*sinh(x) + 2*(b*cosh 
(x) + b*sinh(x))*sqrt((a^2 - a*b)/b^2))*sqrt((2*b*sqrt((a^2 - a*b)/b^2) - 
2*a + b)/b) + b)/b) - b*x*sqrt((a^2 - a*b)/b^2)*log(-(((2*a - b)*cosh(x) + 
 (2*a - b)*sinh(x) + 2*(b*cosh(x) + b*sinh(x))*sqrt((a^2 - a*b)/b^2))*sqrt 
((2*b*sqrt((a^2 - a*b)/b^2) - 2*a + b)/b) - b)/b) + b*sqrt((a^2 - a*b)/b^2 
)*dilog(-(((2*a - b)*cosh(x) + (2*a - b)*sinh(x) - 2*(b*cosh(x) + b*sinh(x 
))*sqrt((a^2 - a*b)/b^2))*sqrt(-(2*b*sqrt((a^2 - a*b)/b^2) + 2*a - b)/b) + 
 b)/b + 1) + b*sqrt((a^2 - a*b)/b^2)*dilog((((2*a - b)*cosh(x) + (2*a - b) 
*sinh(x) - 2*(b*cosh(x) + b*sinh(x))*sqrt((a^2 - a*b)/b^2))*sqrt(-(2*b*sqr 
t((a^2 - a*b)/b^2) + 2*a - b)/b) - b)/b + 1) - b*sqrt((a^2 - a*b)/b^2)*dil 
og(-(((2*a - b)*cosh(x) + (2*a - b)*sinh(x) + 2*(b*cosh(x) + b*sinh(x))*sq 
rt((a^2 - a*b)/b^2))*sqrt((2*b*sqrt((a^2 - a*b)/b^2) - 2*a + b)/b) + b)/b 
+ 1) - b*sqrt((a^2 - a*b)/b^2)*dilog((((2*a - b)*cosh(x) + (2*a - b)*sinh( 
x) + 2*(b*cosh(x) + b*sinh(x))*sqrt((a^2 - a*b)/b^2))*sqrt((2*b*sqrt((a^2 
- a*b)/b^2) - 2*a + b)/b) - b)/b + 1))/(a^2 - a*b)
 

Sympy [F]

\[ \int \frac {x}{a+b \sinh ^2(x)} \, dx=\int \frac {x}{a + b \sinh ^{2}{\left (x \right )}}\, dx \] Input:

integrate(x/(a+b*sinh(x)**2),x)
 

Output:

Integral(x/(a + b*sinh(x)**2), x)
 

Maxima [F]

\[ \int \frac {x}{a+b \sinh ^2(x)} \, dx=\int { \frac {x}{b \sinh \left (x\right )^{2} + a} \,d x } \] Input:

integrate(x/(a+b*sinh(x)^2),x, algorithm="maxima")
 

Output:

integrate(x/(b*sinh(x)^2 + a), x)
 

Giac [F]

\[ \int \frac {x}{a+b \sinh ^2(x)} \, dx=\int { \frac {x}{b \sinh \left (x\right )^{2} + a} \,d x } \] Input:

integrate(x/(a+b*sinh(x)^2),x, algorithm="giac")
 

Output:

integrate(x/(b*sinh(x)^2 + a), x)
 

Mupad [F(-1)]

Timed out. \[ \int \frac {x}{a+b \sinh ^2(x)} \, dx=\int \frac {x}{b\,{\mathrm {sinh}\left (x\right )}^2+a} \,d x \] Input:

int(x/(a + b*sinh(x)^2),x)
 

Output:

int(x/(a + b*sinh(x)^2), x)
 

Reduce [F]

\[ \int \frac {x}{a+b \sinh ^2(x)} \, dx=\int \frac {x}{\sinh \left (x \right )^{2} b +a}d x \] Input:

int(x/(a+b*sinh(x)^2),x)
 

Output:

int(x/(sinh(x)**2*b + a),x)