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

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

Optimal result

Integrand size = 19, antiderivative size = 128 \[ \int \frac {x^3}{\left (b f^{-x}+a f^x\right )^2} \, dx=\frac {x^3}{2 a b \log (f)}-\frac {x^3}{2 a \left (b+a f^{2 x}\right ) \log (f)}-\frac {3 x^2 \log \left (1+\frac {a f^{2 x}}{b}\right )}{4 a b \log ^2(f)}-\frac {3 x \operatorname {PolyLog}\left (2,-\frac {a f^{2 x}}{b}\right )}{4 a b \log ^3(f)}+\frac {3 \operatorname {PolyLog}\left (3,-\frac {a f^{2 x}}{b}\right )}{8 a b \log ^4(f)} \] Output:

1/2*x^3/a/b/ln(f)-1/2*x^3/a/(b+a*f^(2*x))/ln(f)-3/4*x^2*ln(1+a*f^(2*x)/b)/ 
a/b/ln(f)^2-3/4*x*polylog(2,-a*f^(2*x)/b)/a/b/ln(f)^3+3/8*polylog(3,-a*f^( 
2*x)/b)/a/b/ln(f)^4
 

Mathematica [A] (verified)

Time = 0.14 (sec) , antiderivative size = 124, normalized size of antiderivative = 0.97 \[ \int \frac {x^3}{\left (b f^{-x}+a f^x\right )^2} \, dx=-\frac {x^3}{2 a \left (b+a f^{2 x}\right ) \log (f)}+\frac {3 \left (\frac {x^3}{3 b}-\frac {x^2 \log \left (1+\frac {a f^{2 x}}{b}\right )}{2 b \log (f)}-\frac {x \operatorname {PolyLog}\left (2,-\frac {a f^{2 x}}{b}\right )}{2 b \log ^2(f)}+\frac {\operatorname {PolyLog}\left (3,-\frac {a f^{2 x}}{b}\right )}{4 b \log ^3(f)}\right )}{2 a \log (f)} \] Input:

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

Output:

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

Rubi [A] (verified)

Time = 1.07 (sec) , antiderivative size = 135, normalized size of antiderivative = 1.05, number of steps used = 8, number of rules used = 7, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.368, Rules used = {2721, 2621, 2615, 2620, 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^3}{\left (a f^x+b f^{-x}\right )^2} \, dx\)

\(\Big \downarrow \) 2721

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

\(\Big \downarrow \) 2621

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

\(\Big \downarrow \) 2615

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

\(\Big \downarrow \) 2620

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

\(\Big \downarrow \) 3011

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

\(\Big \downarrow \) 2720

\(\displaystyle \frac {3 \left (\frac {x^3}{3 b}-\frac {a \left (\frac {x^2 \log \left (\frac {a f^{2 x}}{b}+1\right )}{2 a \log (f)}-\frac {\frac {\int f^{-2 x} \operatorname {PolyLog}\left (2,-\frac {a f^{2 x}}{b}\right )df^{2 x}}{4 \log ^2(f)}-\frac {x \operatorname {PolyLog}\left (2,-\frac {a f^{2 x}}{b}\right )}{2 \log (f)}}{a \log (f)}\right )}{b}\right )}{2 a \log (f)}-\frac {x^3}{2 a \log (f) \left (a f^{2 x}+b\right )}\)

\(\Big \downarrow \) 7143

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

Input:

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

Output:

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

Defintions of rubi rules used

rule 2615
Int[((c_.) + (d_.)*(x_))^(m_.)/((a_) + (b_.)*((F_)^((g_.)*((e_.) + (f_.)*(x 
_))))^(n_.)), x_Symbol] :> Simp[(c + d*x)^(m + 1)/(a*d*(m + 1)), x] - Simp[ 
b/a   Int[(c + d*x)^m*((F^(g*(e + f*x)))^n/(a + b*(F^(g*(e + f*x)))^n)), x] 
, x] /; FreeQ[{F, a, b, c, d, e, f, g, n}, x] && IGtQ[m, 0]
 

rule 2620
Int[(((F_)^((g_.)*((e_.) + (f_.)*(x_))))^(n_.)*((c_.) + (d_.)*(x_))^(m_.))/ 
((a_) + (b_.)*((F_)^((g_.)*((e_.) + (f_.)*(x_))))^(n_.)), x_Symbol] :> Simp 
[((c + d*x)^m/(b*f*g*n*Log[F]))*Log[1 + b*((F^(g*(e + f*x)))^n/a)], x] - Si 
mp[d*(m/(b*f*g*n*Log[F]))   Int[(c + d*x)^(m - 1)*Log[1 + b*((F^(g*(e + f*x 
)))^n/a)], x], x] /; FreeQ[{F, a, b, c, d, e, f, g, n}, x] && IGtQ[m, 0]
 

rule 2621
Int[((F_)^((g_.)*((e_.) + (f_.)*(x_))))^(n_.)*((a_.) + (b_.)*((F_)^((g_.)*( 
(e_.) + (f_.)*(x_))))^(n_.))^(p_.)*((c_.) + (d_.)*(x_))^(m_.), x_Symbol] :> 
 Simp[(c + d*x)^m*((a + b*(F^(g*(e + f*x)))^n)^(p + 1)/(b*f*g*n*(p + 1)*Log 
[F])), x] - Simp[d*(m/(b*f*g*n*(p + 1)*Log[F]))   Int[(c + d*x)^(m - 1)*(a 
+ b*(F^(g*(e + f*x)))^n)^(p + 1), x], x] /; FreeQ[{F, a, b, c, d, e, f, g, 
m, n, p}, x] && NeQ[p, -1]
 

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

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 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]
 
Maple [A] (verified)

Time = 0.08 (sec) , antiderivative size = 119, normalized size of antiderivative = 0.93

method result size
risch \(\frac {x^{3}}{2 a b \ln \left (f \right )}-\frac {x^{3}}{2 a \left (b +a \,f^{2 x}\right ) \ln \left (f \right )}-\frac {3 x^{2} \ln \left (1+\frac {a \,f^{2 x}}{b}\right )}{4 a b \ln \left (f \right )^{2}}-\frac {3 x \operatorname {polylog}\left (2, -\frac {a \,f^{2 x}}{b}\right )}{4 a b \ln \left (f \right )^{3}}+\frac {3 \operatorname {polylog}\left (3, -\frac {a \,f^{2 x}}{b}\right )}{8 a b \ln \left (f \right )^{4}}\) \(119\)

Input:

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

Output:

-1/2/ln(f)*x^3/a/((f^x)^2*a+b)+1/2*x^3/a/b/ln(f)-3/4*x^2*ln(1+a*f^(2*x)/b) 
/a/b/ln(f)^2-3/4*x*polylog(2,-a*f^(2*x)/b)/a/b/ln(f)^3+3/8*polylog(3,-a*f^ 
(2*x)/b)/a/b/ln(f)^4
 

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 241 vs. \(2 (117) = 234\).

Time = 0.08 (sec) , antiderivative size = 241, normalized size of antiderivative = 1.88 \[ \int \frac {x^3}{\left (b f^{-x}+a f^x\right )^2} \, dx=\frac {2 \, a f^{2 \, x} x^{3} \log \left (f\right )^{3} - 6 \, {\left (a f^{2 \, x} x \log \left (f\right ) + b x \log \left (f\right )\right )} {\rm Li}_2\left (f^{x} \sqrt {-\frac {a}{b}}\right ) - 6 \, {\left (a f^{2 \, x} x \log \left (f\right ) + b x \log \left (f\right )\right )} {\rm Li}_2\left (-f^{x} \sqrt {-\frac {a}{b}}\right ) - 3 \, {\left (a f^{2 \, x} x^{2} \log \left (f\right )^{2} + b x^{2} \log \left (f\right )^{2}\right )} \log \left (f^{x} \sqrt {-\frac {a}{b}} + 1\right ) - 3 \, {\left (a f^{2 \, x} x^{2} \log \left (f\right )^{2} + b x^{2} \log \left (f\right )^{2}\right )} \log \left (-f^{x} \sqrt {-\frac {a}{b}} + 1\right ) + 6 \, {\left (a f^{2 \, x} + b\right )} {\rm polylog}\left (3, f^{x} \sqrt {-\frac {a}{b}}\right ) + 6 \, {\left (a f^{2 \, x} + b\right )} {\rm polylog}\left (3, -f^{x} \sqrt {-\frac {a}{b}}\right )}{4 \, {\left (a^{2} b f^{2 \, x} \log \left (f\right )^{4} + a b^{2} \log \left (f\right )^{4}\right )}} \] Input:

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

Output:

1/4*(2*a*f^(2*x)*x^3*log(f)^3 - 6*(a*f^(2*x)*x*log(f) + b*x*log(f))*dilog( 
f^x*sqrt(-a/b)) - 6*(a*f^(2*x)*x*log(f) + b*x*log(f))*dilog(-f^x*sqrt(-a/b 
)) - 3*(a*f^(2*x)*x^2*log(f)^2 + b*x^2*log(f)^2)*log(f^x*sqrt(-a/b) + 1) - 
 3*(a*f^(2*x)*x^2*log(f)^2 + b*x^2*log(f)^2)*log(-f^x*sqrt(-a/b) + 1) + 6* 
(a*f^(2*x) + b)*polylog(3, f^x*sqrt(-a/b)) + 6*(a*f^(2*x) + b)*polylog(3, 
-f^x*sqrt(-a/b)))/(a^2*b*f^(2*x)*log(f)^4 + a*b^2*log(f)^4)
 

Sympy [F]

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

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

Output:

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

Maxima [A] (verification not implemented)

Time = 0.04 (sec) , antiderivative size = 107, normalized size of antiderivative = 0.84 \[ \int \frac {x^3}{\left (b f^{-x}+a f^x\right )^2} \, dx=-\frac {x^{3}}{2 \, {\left (a^{2} f^{2 \, x} \log \left (f\right ) + a b \log \left (f\right )\right )}} + \frac {x^{3}}{2 \, a b \log \left (f\right )} - \frac {3 \, {\left (2 \, x^{2} \log \left (\frac {a f^{2 \, x}}{b} + 1\right ) \log \left (f\right )^{2} + 2 \, x {\rm Li}_2\left (-\frac {a f^{2 \, x}}{b}\right ) \log \left (f\right ) - {\rm Li}_{3}(-\frac {a f^{2 \, x}}{b})\right )}}{8 \, a b \log \left (f\right )^{4}} \] Input:

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

Output:

-1/2*x^3/(a^2*f^(2*x)*log(f) + a*b*log(f)) + 1/2*x^3/(a*b*log(f)) - 3/8*(2 
*x^2*log(a*f^(2*x)/b + 1)*log(f)^2 + 2*x*dilog(-a*f^(2*x)/b)*log(f) - poly 
log(3, -a*f^(2*x)/b))/(a*b*log(f)^4)
 

Giac [F]

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

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

Output:

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

Mupad [F(-1)]

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

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

Output:

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

Reduce [F]

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

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

Output:

(12*f**(2*x)*int(x**2/(f**(4*x)*a**2 + 2*f**(2*x)*a*b + b**2),x)*log(f)**3 
*a*b**2 + 12*f**(2*x)*int(x/(f**(4*x)*a**2 + 2*f**(2*x)*a*b + b**2),x)*log 
(f)**2*a*b**2 - 3*f**(2*x)*log(f**(2*x)*a + b)*a + 6*f**(2*x)*log(f)*a*x + 
 12*int(x**2/(f**(4*x)*a**2 + 2*f**(2*x)*a*b + b**2),x)*log(f)**3*b**3 + 1 
2*int(x/(f**(4*x)*a**2 + 2*f**(2*x)*a*b + b**2),x)*log(f)**2*b**3 - 3*log( 
f**(2*x)*a + b)*b - 4*log(f)**3*b*x**3 - 6*log(f)**2*b*x**2)/(8*log(f)**4* 
a*b*(f**(2*x)*a + b))