3.56 \(\int \frac {x^2}{b f^{-x}+a f^x} \, dx\)

Optimal. Leaf size=184 \[ \frac {i \text {Li}_3\left (-\frac {i \sqrt {a} f^x}{\sqrt {b}}\right )}{\sqrt {a} \sqrt {b} \log ^3(f)}-\frac {i \text {Li}_3\left (\frac {i \sqrt {a} f^x}{\sqrt {b}}\right )}{\sqrt {a} \sqrt {b} \log ^3(f)}-\frac {i x \text {Li}_2\left (-\frac {i \sqrt {a} f^x}{\sqrt {b}}\right )}{\sqrt {a} \sqrt {b} \log ^2(f)}+\frac {i x \text {Li}_2\left (\frac {i \sqrt {a} f^x}{\sqrt {b}}\right )}{\sqrt {a} \sqrt {b} \log ^2(f)}+\frac {x^2 \tan ^{-1}\left (\frac {\sqrt {a} f^x}{\sqrt {b}}\right )}{\sqrt {a} \sqrt {b} \log (f)} \]

[Out]

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)

________________________________________________________________________________________

Rubi [A]  time = 0.17, antiderivative size = 184, normalized size of antiderivative = 1.00, number of steps used = 9, number of rules used = 7, integrand size = 19, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.368, Rules used = {2282, 205, 2266, 12, 5143, 2531, 6589} \[ -\frac {i x \text {PolyLog}\left (2,-\frac {i \sqrt {a} f^x}{\sqrt {b}}\right )}{\sqrt {a} \sqrt {b} \log ^2(f)}+\frac {i x \text {PolyLog}\left (2,\frac {i \sqrt {a} f^x}{\sqrt {b}}\right )}{\sqrt {a} \sqrt {b} \log ^2(f)}+\frac {i \text {PolyLog}\left (3,-\frac {i \sqrt {a} f^x}{\sqrt {b}}\right )}{\sqrt {a} \sqrt {b} \log ^3(f)}-\frac {i \text {PolyLog}\left (3,\frac {i \sqrt {a} f^x}{\sqrt {b}}\right )}{\sqrt {a} \sqrt {b} \log ^3(f)}+\frac {x^2 \tan ^{-1}\left (\frac {\sqrt {a} f^x}{\sqrt {b}}\right )}{\sqrt {a} \sqrt {b} \log (f)} \]

Antiderivative was successfully verified.

[In]

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

[Out]

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

Rule 12

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

Rule 205

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

Rule 2266

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 2282

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 2531

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] + Dist[(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 5143

Int[ArcTan[(a_.) + (b_.)*(f_)^((c_.) + (d_.)*(x_))]*(x_)^(m_.), x_Symbol] :> Dist[I/2, Int[x^m*Log[1 - I*a - I
*b*f^(c + d*x)], x], x] - Dist[I/2, Int[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 6589

Int[PolyLog[n_, (c_.)*((a_.) + (b_.)*(x_))^(p_.)]/((d_.) + (e_.)*(x_)), x_Symbol] :> 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]

Rubi steps

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

________________________________________________________________________________________

Mathematica [A]  time = 0.05, size = 168, normalized size = 0.91 \[ \frac {i \left (2 \text {Li}_3\left (-\frac {i \sqrt {a} f^x}{\sqrt {b}}\right )-2 \text {Li}_3\left (\frac {i \sqrt {a} f^x}{\sqrt {b}}\right )-2 x \log (f) \text {Li}_2\left (-\frac {i \sqrt {a} f^x}{\sqrt {b}}\right )+2 x \log (f) \text {Li}_2\left (\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 )-x^2 \log ^2(f) \log \left (1+\frac {i \sqrt {a} f^x}{\sqrt {b}}\right )\right )}{2 \sqrt {a} \sqrt {b} \log ^3(f)} \]

Antiderivative was successfully verified.

[In]

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

[Out]

((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*Lo
g[f]*PolyLog[2, ((-I)*Sqrt[a]*f^x)/Sqrt[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)

________________________________________________________________________________________

fricas [C]  time = 0.42, size = 176, normalized size = 0.96 \[ -\frac {x^{2} \sqrt {-\frac {a}{b}} \log \left (f^{x} \sqrt {-\frac {a}{b}} + 1\right ) \log \relax (f)^{2} - x^{2} \sqrt {-\frac {a}{b}} \log \left (-f^{x} \sqrt {-\frac {a}{b}} + 1\right ) \log \relax (f)^{2} - 2 \, x \sqrt {-\frac {a}{b}} {\rm Li}_2\left (f^{x} \sqrt {-\frac {a}{b}}\right ) \log \relax (f) + 2 \, x \sqrt {-\frac {a}{b}} {\rm Li}_2\left (-f^{x} \sqrt {-\frac {a}{b}}\right ) \log \relax (f) + 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 \relax (f)^{3}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-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)

________________________________________________________________________________________

giac [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \int \frac {x^{2}}{a f^{x} + \frac {b}{f^{x}}}\,{d x} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

maple [F]  time = 0.05, size = 0, normalized size = 0.00 \[ \int \frac {x^{2}}{a \,f^{x}+b \,f^{-x}}\, dx \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

maxima [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \int \frac {x^{2}}{a f^{x} + \frac {b}{f^{x}}}\,{d x} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

mupad [F]  time = 0.00, size = -1, normalized size = -0.01 \[ \int \frac {x^2}{\frac {b}{f^x}+a\,f^x} \,d x \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

sympy [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \int \frac {f^{x} x^{2}}{a f^{2 x} + b}\, dx \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________