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

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

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(a^(1/2)*f^x/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(a^(1/2)*f^x/b^(1/2))/a^(3/2)/b^(3/2)/ln(f) 
-1/8*I*x*polylog(2,-I*a^(1/2)*f^x/b^(1/2))/a^(3/2)/b^(3/2)/ln(f)^2+1/8*I*x 
*polylog(2,I*a^(1/2)*f^x/b^(1/2))/a^(3/2)/b^(3/2)/ln(f)^2+1/8*I*polylog(3, 
-I*a^(1/2)*f^x/b^(1/2))/a^(3/2)/b^(3/2)/ln(f)^3-1/8*I*polylog(3,I*a^(1/2)* 
f^x/b^(1/2))/a^(3/2)/b^(3/2)/ln(f)^3
 

Mathematica [A] (verified)

Time = 0.64 (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)
 

Rubi [A] (verified)

Time = 2.00 (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)
 

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

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.09 (sec) , antiderivative size = 674, normalized size of antiderivative = 2.13 \[ \int \frac {x^2}{\left (b f^{-x}+a f^x\right )^3} \, dx =\text {Too large to display} \] 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)
 

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)
                                                                                    
                                                                                    
 

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)
 

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)
 

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)
 

Reduce [F]

\[ \int \frac {x^2}{\left (b f^{-x}+a f^x\right )^3} \, dx=\frac {f^{4 x} \sqrt {b}\, \sqrt {a}\, \mathit {atan} \left (\frac {f^{x} a}{\sqrt {b}\, \sqrt {a}}\right ) a^{2}+2 f^{2 x} \sqrt {b}\, \sqrt {a}\, \mathit {atan} \left (\frac {f^{x} a}{\sqrt {b}\, \sqrt {a}}\right ) a b +\sqrt {b}\, \sqrt {a}\, \mathit {atan} \left (\frac {f^{x} a}{\sqrt {b}\, \sqrt {a}}\right ) b^{2}+3 f^{4 x} \left (\int \frac {f^{x} x^{2}}{f^{6 x} a^{3}+3 f^{4 x} a^{2} b +3 f^{2 x} a \,b^{2}+b^{3}}d x \right ) \mathrm {log}\left (f \right )^{3} a^{3} b^{3}+8 f^{4 x} \left (\int \frac {f^{x} x}{f^{6 x} a^{3}+3 f^{4 x} a^{2} b +3 f^{2 x} a \,b^{2}+b^{3}}d x \right ) \mathrm {log}\left (f \right )^{2} a^{3} b^{3}+f^{3 x} a^{2} b +6 f^{2 x} \left (\int \frac {f^{x} x^{2}}{f^{6 x} a^{3}+3 f^{4 x} a^{2} b +3 f^{2 x} a \,b^{2}+b^{3}}d x \right ) \mathrm {log}\left (f \right )^{3} a^{2} b^{4}+16 f^{2 x} \left (\int \frac {f^{x} x}{f^{6 x} a^{3}+3 f^{4 x} a^{2} b +3 f^{2 x} a \,b^{2}+b^{3}}d x \right ) \mathrm {log}\left (f \right )^{2} a^{2} b^{4}-3 f^{x} \mathrm {log}\left (f \right )^{2} a \,b^{2} x^{2}-2 f^{x} \mathrm {log}\left (f \right ) a \,b^{2} x +f^{x} a \,b^{2}+3 \left (\int \frac {f^{x} x^{2}}{f^{6 x} a^{3}+3 f^{4 x} a^{2} b +3 f^{2 x} a \,b^{2}+b^{3}}d x \right ) \mathrm {log}\left (f \right )^{3} a \,b^{5}+8 \left (\int \frac {f^{x} x}{f^{6 x} a^{3}+3 f^{4 x} a^{2} b +3 f^{2 x} a \,b^{2}+b^{3}}d x \right ) \mathrm {log}\left (f \right )^{2} a \,b^{5}}{9 \mathrm {log}\left (f \right )^{3} a^{2} b^{2} \left (f^{4 x} a^{2}+2 f^{2 x} a b +b^{2}\right )} \] Input:

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

Output:

(f**(4*x)*sqrt(b)*sqrt(a)*atan((f**x*a)/(sqrt(b)*sqrt(a)))*a**2 + 2*f**(2* 
x)*sqrt(b)*sqrt(a)*atan((f**x*a)/(sqrt(b)*sqrt(a)))*a*b + sqrt(b)*sqrt(a)* 
atan((f**x*a)/(sqrt(b)*sqrt(a)))*b**2 + 3*f**(4*x)*int((f**x*x**2)/(f**(6* 
x)*a**3 + 3*f**(4*x)*a**2*b + 3*f**(2*x)*a*b**2 + b**3),x)*log(f)**3*a**3* 
b**3 + 8*f**(4*x)*int((f**x*x)/(f**(6*x)*a**3 + 3*f**(4*x)*a**2*b + 3*f**( 
2*x)*a*b**2 + b**3),x)*log(f)**2*a**3*b**3 + f**(3*x)*a**2*b + 6*f**(2*x)* 
int((f**x*x**2)/(f**(6*x)*a**3 + 3*f**(4*x)*a**2*b + 3*f**(2*x)*a*b**2 + b 
**3),x)*log(f)**3*a**2*b**4 + 16*f**(2*x)*int((f**x*x)/(f**(6*x)*a**3 + 3* 
f**(4*x)*a**2*b + 3*f**(2*x)*a*b**2 + b**3),x)*log(f)**2*a**2*b**4 - 3*f** 
x*log(f)**2*a*b**2*x**2 - 2*f**x*log(f)*a*b**2*x + f**x*a*b**2 + 3*int((f* 
*x*x**2)/(f**(6*x)*a**3 + 3*f**(4*x)*a**2*b + 3*f**(2*x)*a*b**2 + b**3),x) 
*log(f)**3*a*b**5 + 8*int((f**x*x)/(f**(6*x)*a**3 + 3*f**(4*x)*a**2*b + 3* 
f**(2*x)*a*b**2 + b**3),x)*log(f)**2*a*b**5)/(9*log(f)**3*a**2*b**2*(f**(4 
*x)*a**2 + 2*f**(2*x)*a*b + b**2))