3.1.64 \(\int \frac {x^2}{(b f^{-x}+a f^x)^3} \, dx\) [64]

3.1.64.1 Optimal result
3.1.64.2 Mathematica [A] (verified)
3.1.64.3 Rubi [A] (verified)
3.1.64.4 Maple [F]
3.1.64.5 Fricas [B] (verification not implemented)
3.1.64.6 Sympy [F]
3.1.64.7 Maxima [F]
3.1.64.8 Giac [F]
3.1.64.9 Mupad [F(-1)]

3.1.64.1 Optimal result

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

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

Time = 0.37 (sec) , antiderivative size = 254, normalized size of antiderivative = 0.80 \[ \int \frac {x^2}{\left (b f^{-x}+a f^x\right )^3} \, dx=\frac {-\frac {12 \arctan \left (\frac {\sqrt {a} f^x}{\sqrt {b}}\right )}{b^{3/2}}-\frac {12 \sqrt {a} f^x x^2 \log ^2(f)}{\left (b+a f^{2 x}\right )^2}+\frac {6 \sqrt {a} f^x x \log (f) (2+x \log (f))}{b \left (b+a f^{2 x}\right )}+\frac {3 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 )}{b^{3/2}}}{48 a^{3/2} \log ^3(f)} \]

input
Integrate[x^2/(b/f^x + a*f^x)^3,x]
 
output
((-12*ArcTan[(Sqrt[a]*f^x)/Sqrt[b]])/b^(3/2) - (12*Sqrt[a]*f^x*x^2*Log[f]^ 
2)/(b + a*f^(2*x))^2 + (6*Sqrt[a]*f^x*x*Log[f]*(2 + x*Log[f]))/(b*(b + a*f 
^(2*x))) + ((3*I)*(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)/Sqrt[b]] + 2*x*Log[f]*PolyLog[2, (I*Sqrt[a]*f^x)/Sqrt[b]] + 2*Poly 
Log[3, ((-I)*Sqrt[a]*f^x)/Sqrt[b]] - 2*PolyLog[3, (I*Sqrt[a]*f^x)/Sqrt[b]] 
))/b^(3/2))/(48*a^(3/2)*Log[f]^3)
 
3.1.64.3 Rubi [A] (verified)

Time = 1.26 (sec) , antiderivative size = 316, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.158, Rules used = {2721, 2684, 2009}

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

\(\Big \downarrow \) 2721

\(\displaystyle \int \frac {x^2 f^{3 x}}{\left (a f^{2 x}+b\right )^3}dx\)

\(\Big \downarrow \) 2684

\(\displaystyle \int \left (\frac {x^2 f^x}{a \left (a f^{2 x}+b\right )^2}-\frac {b x^2 f^x}{a \left (a f^{2 x}+b\right )^3}\right )dx\)

\(\Big \downarrow \) 2009

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

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

3.1.64.3.1 Defintions of rubi rules used

rule 2009
Int[u_, x_Symbol] :> Simp[IntSum[u, x], x] /; SumQ[u]
 

rule 2684
Int[((a_.) + (b_.)*(F_)^(u_))^(p_.)*((c_.) + (d_.)*(F_)^(v_))^(q_.)*((e_.) 
+ (f_.)*(x_))^(m_.), x_Symbol] :> With[{w = ExpandIntegrand[(e + f*x)^m, (a 
 + b*F^u)^p*(c + d*F^v)^q, x]}, Int[w, x] /; SumQ[w]] /; FreeQ[{F, a, b, c, 
 d, e, f, m}, x] && IntegersQ[p, q] && LinearQ[{u, v}, x] && RationalQ[Simp 
lify[u/v]]
 

rule 2721
Int[(u_.)*((a_.)*(F_)^(v_) + (b_.)*(F_)^(w_))^(n_), x_Symbol] :> Int[u*F^(n 
*v)*(a + b*F^ExpandToSum[w - v, x])^n, x] /; FreeQ[{F, a, b, n}, x] && ILtQ 
[n, 0] && LinearQ[{v, w}, x]
 
3.1.64.4 Maple [F]

\[\int \frac {x^{2}}{\left (b \,f^{-x}+a \,f^{x}\right )^{3}}d x\]

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

Leaf count of result is larger than twice the leaf count of optimal. 674 vs. \(2 (232) = 464\).

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

input
integrate(x^2/(b/(f^x)+a*f^x)^3,x, algorithm="fricas")
 
output
1/16*(2*(a^2*x^2*log(f)^2 + 2*a^2*x*log(f))*f^(3*x) - 2*(a*b*x^2*log(f)^2 
- 2*a*b*x*log(f))*f^x + 2*(a^2*f^(4*x)*x*sqrt(-a/b)*log(f) + 2*a*b*f^(2*x) 
*x*sqrt(-a/b)*log(f) + b^2*x*sqrt(-a/b)*log(f))*dilog(f^x*sqrt(-a/b)) - 2* 
(a^2*f^(4*x)*x*sqrt(-a/b)*log(f) + 2*a*b*f^(2*x)*x*sqrt(-a/b)*log(f) + b^2 
*x*sqrt(-a/b)*log(f))*dilog(-f^x*sqrt(-a/b)) - 2*(a^2*f^(4*x)*sqrt(-a/b) + 
 2*a*b*f^(2*x)*sqrt(-a/b) + b^2*sqrt(-a/b))*log(2*a*f^x + 2*b*sqrt(-a/b)) 
+ 2*(a^2*f^(4*x)*sqrt(-a/b) + 2*a*b*f^(2*x)*sqrt(-a/b) + b^2*sqrt(-a/b))*l 
og(2*a*f^x - 2*b*sqrt(-a/b)) - (a^2*f^(4*x)*x^2*sqrt(-a/b)*log(f)^2 + 2*a* 
b*f^(2*x)*x^2*sqrt(-a/b)*log(f)^2 + b^2*x^2*sqrt(-a/b)*log(f)^2)*log(f^x*s 
qrt(-a/b) + 1) + (a^2*f^(4*x)*x^2*sqrt(-a/b)*log(f)^2 + 2*a*b*f^(2*x)*x^2* 
sqrt(-a/b)*log(f)^2 + b^2*x^2*sqrt(-a/b)*log(f)^2)*log(-f^x*sqrt(-a/b) + 1 
) - 2*(a^2*f^(4*x)*sqrt(-a/b) + 2*a*b*f^(2*x)*sqrt(-a/b) + b^2*sqrt(-a/b)) 
*polylog(3, f^x*sqrt(-a/b)) + 2*(a^2*f^(4*x)*sqrt(-a/b) + 2*a*b*f^(2*x)*sq 
rt(-a/b) + b^2*sqrt(-a/b))*polylog(3, -f^x*sqrt(-a/b)))/(a^4*b*f^(4*x)*log 
(f)^3 + 2*a^3*b^2*f^(2*x)*log(f)^3 + a^2*b^3*log(f)^3)
 
3.1.64.6 Sympy [F]

\[ \int \frac {x^2}{\left (b f^{-x}+a f^x\right )^3} \, dx=\frac {f^{- x} \left (a x^{2} \log {\left (f \right )} + 2 a x\right ) + f^{- 3 x} \left (- b x^{2} \log {\left (f \right )} + 2 b x\right )}{8 a^{3} b \log {\left (f \right )}^{2} + 16 a^{2} b^{2} f^{- 2 x} \log {\left (f \right )}^{2} + 8 a b^{3} f^{- 4 x} \log {\left (f \right )}^{2}} + \frac {\int \left (- \frac {2 f^{x}}{a f^{2 x} + b}\right )\, dx + \int \frac {f^{x} x^{2} \log {\left (f \right )}^{2}}{a f^{2 x} + b}\, dx}{8 a b \log {\left (f \right )}^{2}} \]

input
integrate(x**2/(b/(f**x)+a*f**x)**3,x)
 
output
((a*x**2*log(f) + 2*a*x)/f**x + (-b*x**2*log(f) + 2*b*x)/f**(3*x))/(8*a**3 
*b*log(f)**2 + 16*a**2*b**2*log(f)**2/f**(2*x) + 8*a*b**3*log(f)**2/f**(4* 
x)) + (Integral(-2*f**x/(a*f**(2*x) + b), x) + Integral(f**x*x**2*log(f)** 
2/(a*f**(2*x) + b), x))/(8*a*b*log(f)**2)
 
3.1.64.7 Maxima [F]

\[ \int \frac {x^2}{\left (b f^{-x}+a f^x\right )^3} \, dx=\int { \frac {x^{2}}{{\left (a f^{x} + \frac {b}{f^{x}}\right )}^{3}} \,d x } \]

input
integrate(x^2/(b/(f^x)+a*f^x)^3,x, algorithm="maxima")
 
output
1/8*((a*x^2*log(f) + 2*a*x)*f^(3*x) - (b*x^2*log(f) - 2*b*x)*f^x)/(a^3*b*f 
^(4*x)*log(f)^2 + 2*a^2*b^2*f^(2*x)*log(f)^2 + a*b^3*log(f)^2) + integrate 
(1/8*(x^2*log(f)^2 - 2)*f^x/(a^2*b*f^(2*x)*log(f)^2 + a*b^2*log(f)^2), x)
 
3.1.64.8 Giac [F]

\[ \int \frac {x^2}{\left (b f^{-x}+a f^x\right )^3} \, dx=\int { \frac {x^{2}}{{\left (a f^{x} + \frac {b}{f^{x}}\right )}^{3}} \,d x } \]

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

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

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