\(\int \frac {x}{b f^{-x}+a f^x} \, dx\) [55]

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

Optimal result

Integrand size = 17, antiderivative size = 110 \[ \int \frac {x}{b f^{-x}+a f^x} \, dx=\frac {x \arctan \left (\frac {\sqrt {a} f^x}{\sqrt {b}}\right )}{\sqrt {a} \sqrt {b} \log (f)}-\frac {i \operatorname {PolyLog}\left (2,-\frac {i \sqrt {a} f^x}{\sqrt {b}}\right )}{2 \sqrt {a} \sqrt {b} \log ^2(f)}+\frac {i \operatorname {PolyLog}\left (2,\frac {i \sqrt {a} f^x}{\sqrt {b}}\right )}{2 \sqrt {a} \sqrt {b} \log ^2(f)} \]

[Out]

x*arctan(f^x*a^(1/2)/b^(1/2))/ln(f)/a^(1/2)/b^(1/2)-1/2*I*polylog(2,-I*f^x*a^(1/2)/b^(1/2))/ln(f)^2/a^(1/2)/b^
(1/2)+1/2*I*polylog(2,I*f^x*a^(1/2)/b^(1/2))/ln(f)^2/a^(1/2)/b^(1/2)

Rubi [A] (verified)

Time = 0.06 (sec) , antiderivative size = 110, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.353, Rules used = {2320, 211, 2298, 12, 4940, 2438} \[ \int \frac {x}{b f^{-x}+a f^x} \, dx=\frac {x \arctan \left (\frac {\sqrt {a} f^x}{\sqrt {b}}\right )}{\sqrt {a} \sqrt {b} \log (f)}-\frac {i \operatorname {PolyLog}\left (2,-\frac {i \sqrt {a} f^x}{\sqrt {b}}\right )}{2 \sqrt {a} \sqrt {b} \log ^2(f)}+\frac {i \operatorname {PolyLog}\left (2,\frac {i \sqrt {a} f^x}{\sqrt {b}}\right )}{2 \sqrt {a} \sqrt {b} \log ^2(f)} \]

[In]

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

[Out]

(x*ArcTan[(Sqrt[a]*f^x)/Sqrt[b]])/(Sqrt[a]*Sqrt[b]*Log[f]) - ((I/2)*PolyLog[2, ((-I)*Sqrt[a]*f^x)/Sqrt[b]])/(S
qrt[a]*Sqrt[b]*Log[f]^2) + ((I/2)*PolyLog[2, (I*Sqrt[a]*f^x)/Sqrt[b]])/(Sqrt[a]*Sqrt[b]*Log[f]^2)

Rule 12

Int[(a_)*(u_), x_Symbol] :> Dist[a, Int[u, x], x] /; FreeQ[a, x] &&  !MatchQ[u, (b_)*(v_) /; FreeQ[b, x]]

Rule 211

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[a/b, 2]/a)*ArcTan[x/Rt[a/b, 2]], x] /; FreeQ[{a, b}, x]
&& PosQ[a/b]

Rule 2298

Int[(x_)^(m_.)/((b_.)*(F_)^(v_) + (a_.)*(F_)^((c_.) + (d_.)*(x_))), x_Symbol] :> With[{u = IntHide[1/(a*F^(c +
 d*x) + b*F^v), x]}, Simp[x^m*u, x] - Dist[m, Int[x^(m - 1)*u, x], x]] /; FreeQ[{F, a, b, c, d}, x] && EqQ[v,
-(c + d*x)] && GtQ[m, 0]

Rule 2320

Int[u_, x_Symbol] :> With[{v = FunctionOfExponential[u, x]}, Dist[v/D[v, x], Subst[Int[FunctionOfExponentialFu
nction[u, x]/x, x], x, v], x]] /; FunctionOfExponentialQ[u, x] &&  !MatchQ[u, (w_)*((a_.)*(v_)^(n_))^(m_) /; F
reeQ[{a, m, n}, x] && IntegerQ[m*n]] &&  !MatchQ[u, E^((c_.)*((a_.) + (b_.)*x))*(F_)[v_] /; FreeQ[{a, b, c}, x
] && InverseFunctionQ[F[x]]]

Rule 2438

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 4940

Int[((a_.) + ArcTan[(c_.)*(x_)]*(b_.))/(x_), x_Symbol] :> Simp[a*Log[x], x] + (Dist[I*(b/2), Int[Log[1 - I*c*x
]/x, x], x] - Dist[I*(b/2), Int[Log[1 + I*c*x]/x, x], x]) /; FreeQ[{a, b, c}, x]

Rubi steps \begin{align*} \text {integral}& = \frac {x \tan ^{-1}\left (\frac {\sqrt {a} f^x}{\sqrt {b}}\right )}{\sqrt {a} \sqrt {b} \log (f)}-\int \frac {\tan ^{-1}\left (\frac {\sqrt {a} f^x}{\sqrt {b}}\right )}{\sqrt {a} \sqrt {b} \log (f)} \, dx \\ & = \frac {x \tan ^{-1}\left (\frac {\sqrt {a} f^x}{\sqrt {b}}\right )}{\sqrt {a} \sqrt {b} \log (f)}-\frac {\int \tan ^{-1}\left (\frac {\sqrt {a} f^x}{\sqrt {b}}\right ) \, dx}{\sqrt {a} \sqrt {b} \log (f)} \\ & = \frac {x \tan ^{-1}\left (\frac {\sqrt {a} f^x}{\sqrt {b}}\right )}{\sqrt {a} \sqrt {b} \log (f)}-\frac {\text {Subst}\left (\int \frac {\tan ^{-1}\left (\frac {\sqrt {a} x}{\sqrt {b}}\right )}{x} \, dx,x,f^x\right )}{\sqrt {a} \sqrt {b} \log ^2(f)} \\ & = \frac {x \tan ^{-1}\left (\frac {\sqrt {a} f^x}{\sqrt {b}}\right )}{\sqrt {a} \sqrt {b} \log (f)}-\frac {i \text {Subst}\left (\int \frac {\log \left (1-\frac {i \sqrt {a} x}{\sqrt {b}}\right )}{x} \, dx,x,f^x\right )}{2 \sqrt {a} \sqrt {b} \log ^2(f)}+\frac {i \text {Subst}\left (\int \frac {\log \left (1+\frac {i \sqrt {a} x}{\sqrt {b}}\right )}{x} \, dx,x,f^x\right )}{2 \sqrt {a} \sqrt {b} \log ^2(f)} \\ & = \frac {x \tan ^{-1}\left (\frac {\sqrt {a} f^x}{\sqrt {b}}\right )}{\sqrt {a} \sqrt {b} \log (f)}-\frac {i \text {Li}_2\left (-\frac {i \sqrt {a} f^x}{\sqrt {b}}\right )}{2 \sqrt {a} \sqrt {b} \log ^2(f)}+\frac {i \text {Li}_2\left (\frac {i \sqrt {a} f^x}{\sqrt {b}}\right )}{2 \sqrt {a} \sqrt {b} \log ^2(f)} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.08 (sec) , antiderivative size = 108, normalized size of antiderivative = 0.98 \[ \int \frac {x}{b f^{-x}+a f^x} \, dx=\frac {i \left (x \log (f) \left (\log \left (1-\frac {i \sqrt {a} f^x}{\sqrt {b}}\right )-\log \left (1+\frac {i \sqrt {a} f^x}{\sqrt {b}}\right )\right )-\operatorname {PolyLog}\left (2,-\frac {i \sqrt {a} f^x}{\sqrt {b}}\right )+\operatorname {PolyLog}\left (2,\frac {i \sqrt {a} f^x}{\sqrt {b}}\right )\right )}{2 \sqrt {a} \sqrt {b} \log ^2(f)} \]

[In]

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

[Out]

((I/2)*(x*Log[f]*(Log[1 - (I*Sqrt[a]*f^x)/Sqrt[b]] - Log[1 + (I*Sqrt[a]*f^x)/Sqrt[b]]) - PolyLog[2, ((-I)*Sqrt
[a]*f^x)/Sqrt[b]] + PolyLog[2, (I*Sqrt[a]*f^x)/Sqrt[b]]))/(Sqrt[a]*Sqrt[b]*Log[f]^2)

Maple [A] (verified)

Time = 0.04 (sec) , antiderivative size = 134, normalized size of antiderivative = 1.22

method result size
risch \(\frac {x \ln \left (\frac {-a \,f^{x}+\sqrt {-a b}}{\sqrt {-a b}}\right )}{2 \ln \left (f \right ) \sqrt {-a b}}-\frac {x \ln \left (\frac {a \,f^{x}+\sqrt {-a b}}{\sqrt {-a b}}\right )}{2 \ln \left (f \right ) \sqrt {-a b}}+\frac {\operatorname {dilog}\left (\frac {-a \,f^{x}+\sqrt {-a b}}{\sqrt {-a b}}\right )}{2 \ln \left (f \right )^{2} \sqrt {-a b}}-\frac {\operatorname {dilog}\left (\frac {a \,f^{x}+\sqrt {-a b}}{\sqrt {-a b}}\right )}{2 \ln \left (f \right )^{2} \sqrt {-a b}}\) \(134\)

[In]

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

[Out]

1/2/ln(f)*x/(-a*b)^(1/2)*ln((-a*f^x+(-a*b)^(1/2))/(-a*b)^(1/2))-1/2/ln(f)*x/(-a*b)^(1/2)*ln((a*f^x+(-a*b)^(1/2
))/(-a*b)^(1/2))+1/2/ln(f)^2/(-a*b)^(1/2)*dilog((-a*f^x+(-a*b)^(1/2))/(-a*b)^(1/2))-1/2/ln(f)^2/(-a*b)^(1/2)*d
ilog((a*f^x+(-a*b)^(1/2))/(-a*b)^(1/2))

Fricas [A] (verification not implemented)

none

Time = 0.26 (sec) , antiderivative size = 112, normalized size of antiderivative = 1.02 \[ \int \frac {x}{b f^{-x}+a f^x} \, dx=-\frac {x \sqrt {-\frac {a}{b}} \log \left (f^{x} \sqrt {-\frac {a}{b}} + 1\right ) \log \left (f\right ) - x \sqrt {-\frac {a}{b}} \log \left (-f^{x} \sqrt {-\frac {a}{b}} + 1\right ) \log \left (f\right ) - \sqrt {-\frac {a}{b}} {\rm Li}_2\left (f^{x} \sqrt {-\frac {a}{b}}\right ) + \sqrt {-\frac {a}{b}} {\rm Li}_2\left (-f^{x} \sqrt {-\frac {a}{b}}\right )}{2 \, a \log \left (f\right )^{2}} \]

[In]

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

[Out]

-1/2*(x*sqrt(-a/b)*log(f^x*sqrt(-a/b) + 1)*log(f) - x*sqrt(-a/b)*log(-f^x*sqrt(-a/b) + 1)*log(f) - sqrt(-a/b)*
dilog(f^x*sqrt(-a/b)) + sqrt(-a/b)*dilog(-f^x*sqrt(-a/b)))/(a*log(f)^2)

Sympy [F]

\[ \int \frac {x}{b f^{-x}+a f^x} \, dx=\int \frac {f^{x} x}{a f^{2 x} + b}\, dx \]

[In]

integrate(x/(b/(f**x)+a*f**x),x)

[Out]

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

Maxima [F]

\[ \int \frac {x}{b f^{-x}+a f^x} \, dx=\int { \frac {x}{a f^{x} + \frac {b}{f^{x}}} \,d x } \]

[In]

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

[Out]

integrate(x/(a*f^x + b/f^x), x)

Giac [F]

\[ \int \frac {x}{b f^{-x}+a f^x} \, dx=\int { \frac {x}{a f^{x} + \frac {b}{f^{x}}} \,d x } \]

[In]

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

[Out]

integrate(x/(a*f^x + b/f^x), x)

Mupad [F(-1)]

Timed out. \[ \int \frac {x}{b f^{-x}+a f^x} \, dx=\int \frac {x}{\frac {b}{f^x}+a\,f^x} \,d x \]

[In]

int(x/(b/f^x + a*f^x),x)

[Out]

int(x/(b/f^x + a*f^x), x)