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

3.1.56.1 Optimal result
3.1.56.2 Mathematica [A] (verified)
3.1.56.3 Rubi [A] (verified)
3.1.56.4 Maple [F]
3.1.56.5 Fricas [A] (verification not implemented)
3.1.56.6 Sympy [F]
3.1.56.7 Maxima [F]
3.1.56.8 Giac [F]
3.1.56.9 Mupad [F(-1)]

3.1.56.1 Optimal result

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

output
x^2*arctan(f^x*a^(1/2)/b^(1/2))/ln(f)/a^(1/2)/b^(1/2)-I*x*polylog(2,-I*f^x 
*a^(1/2)/b^(1/2))/ln(f)^2/a^(1/2)/b^(1/2)+I*x*polylog(2,I*f^x*a^(1/2)/b^(1 
/2))/ln(f)^2/a^(1/2)/b^(1/2)+I*polylog(3,-I*f^x*a^(1/2)/b^(1/2))/ln(f)^3/a 
^(1/2)/b^(1/2)-I*polylog(3,I*f^x*a^(1/2)/b^(1/2))/ln(f)^3/a^(1/2)/b^(1/2)
 
3.1.56.2 Mathematica [A] (verified)

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

input
Integrate[x^2/(b/f^x + a*f^x),x]
 
output
((I/2)*(x^2*Log[f]^2*Log[1 - (I*Sqrt[a]*f^x)/Sqrt[b]] - x^2*Log[f]^2*Log[1 
 + (I*Sqrt[a]*f^x)/Sqrt[b]] - 2*x*Log[f]*PolyLog[2, ((-I)*Sqrt[a]*f^x)/Sqr 
t[b]] + 2*x*Log[f]*PolyLog[2, (I*Sqrt[a]*f^x)/Sqrt[b]] + 2*PolyLog[3, ((-I 
)*Sqrt[a]*f^x)/Sqrt[b]] - 2*PolyLog[3, (I*Sqrt[a]*f^x)/Sqrt[b]]))/(Sqrt[a] 
*Sqrt[b]*Log[f]^3)
 
3.1.56.3 Rubi [A] (verified)

Time = 0.57 (sec) , antiderivative size = 165, normalized size of antiderivative = 0.90, number of steps used = 7, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.316, Rules used = {2696, 27, 5666, 3011, 2720, 7143}

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

\(\Big \downarrow \) 2696

\(\displaystyle \frac {x^2 \arctan \left (\frac {\sqrt {a} f^x}{\sqrt {b}}\right )}{\sqrt {a} \sqrt {b} \log (f)}-2 \int \frac {x \arctan \left (\frac {\sqrt {a} f^x}{\sqrt {b}}\right )}{\sqrt {a} \sqrt {b} \log (f)}dx\)

\(\Big \downarrow \) 27

\(\displaystyle \frac {x^2 \arctan \left (\frac {\sqrt {a} f^x}{\sqrt {b}}\right )}{\sqrt {a} \sqrt {b} \log (f)}-\frac {2 \int x \arctan \left (\frac {\sqrt {a} f^x}{\sqrt {b}}\right )dx}{\sqrt {a} \sqrt {b} \log (f)}\)

\(\Big \downarrow \) 5666

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

\(\Big \downarrow \) 3011

\(\displaystyle \frac {x^2 \arctan \left (\frac {\sqrt {a} f^x}{\sqrt {b}}\right )}{\sqrt {a} \sqrt {b} \log (f)}-\frac {2 \left (\frac {1}{2} i \left (\frac {\int \operatorname {PolyLog}\left (2,\frac {i \sqrt {a} f^x}{\sqrt {b}}\right )dx}{\log (f)}-\frac {x \operatorname {PolyLog}\left (2,\frac {i \sqrt {a} f^x}{\sqrt {b}}\right )}{\log (f)}\right )-\frac {1}{2} i \left (\frac {\int \operatorname {PolyLog}\left (2,-\frac {i \sqrt {a} f^x}{\sqrt {b}}\right )dx}{\log (f)}-\frac {x \operatorname {PolyLog}\left (2,-\frac {i \sqrt {a} f^x}{\sqrt {b}}\right )}{\log (f)}\right )\right )}{\sqrt {a} \sqrt {b} \log (f)}\)

\(\Big \downarrow \) 2720

\(\displaystyle \frac {x^2 \arctan \left (\frac {\sqrt {a} f^x}{\sqrt {b}}\right )}{\sqrt {a} \sqrt {b} \log (f)}-\frac {2 \left (\frac {1}{2} i \left (\frac {\int f^{-x} \operatorname {PolyLog}\left (2,\frac {i \sqrt {a} f^x}{\sqrt {b}}\right )df^x}{\log ^2(f)}-\frac {x \operatorname {PolyLog}\left (2,\frac {i \sqrt {a} f^x}{\sqrt {b}}\right )}{\log (f)}\right )-\frac {1}{2} i \left (\frac {\int f^{-x} \operatorname {PolyLog}\left (2,-\frac {i \sqrt {a} f^x}{\sqrt {b}}\right )df^x}{\log ^2(f)}-\frac {x \operatorname {PolyLog}\left (2,-\frac {i \sqrt {a} f^x}{\sqrt {b}}\right )}{\log (f)}\right )\right )}{\sqrt {a} \sqrt {b} \log (f)}\)

\(\Big \downarrow \) 7143

\(\displaystyle \frac {x^2 \arctan \left (\frac {\sqrt {a} f^x}{\sqrt {b}}\right )}{\sqrt {a} \sqrt {b} \log (f)}-\frac {2 \left (\frac {1}{2} i \left (\frac {\operatorname {PolyLog}\left (3,\frac {i \sqrt {a} f^x}{\sqrt {b}}\right )}{\log ^2(f)}-\frac {x \operatorname {PolyLog}\left (2,\frac {i \sqrt {a} f^x}{\sqrt {b}}\right )}{\log (f)}\right )-\frac {1}{2} i \left (\frac {\operatorname {PolyLog}\left (3,-\frac {i \sqrt {a} f^x}{\sqrt {b}}\right )}{\log ^2(f)}-\frac {x \operatorname {PolyLog}\left (2,-\frac {i \sqrt {a} f^x}{\sqrt {b}}\right )}{\log (f)}\right )\right )}{\sqrt {a} \sqrt {b} \log (f)}\)

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

3.1.56.3.1 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 2696
Int[(x_)^(m_.)/((b_.)*(F_)^(v_) + (a_.)*(F_)^((c_.) + (d_.)*(x_))), x_Symbo 
l] :> With[{u = IntHide[1/(a*F^(c + d*x) + b*F^v), x]}, Simp[x^m*u, x] - Si 
mp[m   Int[x^(m - 1)*u, x], x]] /; FreeQ[{F, a, b, c, d}, x] && EqQ[v, -(c 
+ d*x)] && GtQ[m, 0]
 

rule 2720
Int[u_, x_Symbol] :> With[{v = FunctionOfExponential[u, x]}, Simp[v/D[v, x] 
   Subst[Int[FunctionOfExponentialFunction[u, x]/x, x], x, v], x]] /; Funct 
ionOfExponentialQ[u, x] &&  !MatchQ[u, (w_)*((a_.)*(v_)^(n_))^(m_) /; FreeQ 
[{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 3011
Int[Log[1 + (e_.)*((F_)^((c_.)*((a_.) + (b_.)*(x_))))^(n_.)]*((f_.) + (g_.) 
*(x_))^(m_.), x_Symbol] :> Simp[(-(f + g*x)^m)*(PolyLog[2, (-e)*(F^(c*(a + 
b*x)))^n]/(b*c*n*Log[F])), x] + Simp[g*(m/(b*c*n*Log[F]))   Int[(f + g*x)^( 
m - 1)*PolyLog[2, (-e)*(F^(c*(a + b*x)))^n], x], x] /; FreeQ[{F, a, b, c, e 
, f, g, n}, x] && GtQ[m, 0]
 

rule 5666
Int[ArcTan[(a_.) + (b_.)*(f_)^((c_.) + (d_.)*(x_))]*(x_)^(m_.), x_Symbol] : 
> Simp[I/2   Int[x^m*Log[1 - I*a - I*b*f^(c + d*x)], x], x] - Simp[I/2   In 
t[x^m*Log[1 + I*a + I*b*f^(c + d*x)], x], x] /; FreeQ[{a, b, c, d, f}, x] & 
& IntegerQ[m] && m > 0
 

rule 7143
Int[PolyLog[n_, (c_.)*((a_.) + (b_.)*(x_))^(p_.)]/((d_.) + (e_.)*(x_)), x_S 
ymbol] :> Simp[PolyLog[n + 1, c*(a + b*x)^p]/(e*p), x] /; FreeQ[{a, b, c, d 
, e, n, p}, x] && EqQ[b*d, a*e]
 
3.1.56.4 Maple [F]

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

input
int(x^2/(b/(f^x)+a*f^x),x)
 
output
int(x^2/(b/(f^x)+a*f^x),x)
 
3.1.56.5 Fricas [A] (verification not implemented)

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

input
integrate(x^2/(b/(f^x)+a*f^x),x, algorithm="fricas")
 
output
-1/2*(x^2*sqrt(-a/b)*log(f^x*sqrt(-a/b) + 1)*log(f)^2 - x^2*sqrt(-a/b)*log 
(-f^x*sqrt(-a/b) + 1)*log(f)^2 - 2*x*sqrt(-a/b)*dilog(f^x*sqrt(-a/b))*log( 
f) + 2*x*sqrt(-a/b)*dilog(-f^x*sqrt(-a/b))*log(f) + 2*sqrt(-a/b)*polylog(3 
, f^x*sqrt(-a/b)) - 2*sqrt(-a/b)*polylog(3, -f^x*sqrt(-a/b)))/(a*log(f)^3)
 
3.1.56.6 Sympy [F]

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

input
integrate(x**2/(b/(f**x)+a*f**x),x)
 
output
Integral(f**x*x**2/(a*f**(2*x) + b), x)
 
3.1.56.7 Maxima [F]

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

input
integrate(x^2/(b/(f^x)+a*f^x),x, algorithm="maxima")
 
output
integrate(x^2/(a*f^x + b/f^x), x)
 
3.1.56.8 Giac [F]

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

input
integrate(x^2/(b/(f^x)+a*f^x),x, algorithm="giac")
 
output
integrate(x^2/(a*f^x + b/f^x), x)
 
3.1.56.9 Mupad [F(-1)]

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

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