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

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

Optimal result

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

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

Mathematica [A] (verified)

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

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

Output:

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

Rubi [A] (verified)

Time = 0.79 (sec) , antiderivative size = 101, normalized size of antiderivative = 1.03, number of steps used = 7, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.316, Rules used = {2721, 2621, 2615, 2620, 2715, 2838}

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 )^2} \, dx\)

\(\Big \downarrow \) 2721

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

\(\Big \downarrow \) 2621

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

\(\Big \downarrow \) 2615

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

\(\Big \downarrow \) 2620

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

\(\Big \downarrow \) 2715

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

\(\Big \downarrow \) 2838

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

Input:

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

Output:

-1/2*x^2/(a*(b + a*f^(2*x))*Log[f]) + (x^2/(2*b) - (a*((x*Log[1 + (a*f^(2* 
x))/b])/(2*a*Log[f]) + PolyLog[2, -((a*f^(2*x))/b)]/(4*a*Log[f]^2)))/b)/(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 2715
Int[Log[(a_) + (b_.)*((F_)^((e_.)*((c_.) + (d_.)*(x_))))^(n_.)], x_Symbol] 
:> Simp[1/(d*e*n*Log[F])   Subst[Int[Log[a + b*x]/x, x], x, (F^(e*(c + d*x) 
))^n], x] /; FreeQ[{F, a, b, c, d, e, n}, x] && GtQ[a, 0]
 

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 2838
Int[Log[(c_.)*((d_) + (e_.)*(x_)^(n_.))]/(x_), x_Symbol] :> Simp[-PolyLog[2 
, (-c)*e*x^n]/n, x] /; FreeQ[{c, d, e, n}, x] && EqQ[c*d, 1]
 
Maple [A] (verified)

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

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

Input:

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

Output:

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

Fricas [A] (verification not implemented)

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

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

Output:

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

Sympy [F]

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

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

Output:

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

Maxima [A] (verification not implemented)

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

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

Output:

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

Giac [F]

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

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

Output:

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

Mupad [F(-1)]

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

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

Output:

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

Reduce [F]

\[ \int \frac {x^2}{\left (b f^{-x}+a f^x\right )^2} \, dx=\frac {4 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}-f^{2 x} \mathrm {log}\left (f^{2 x} a +b \right ) a +2 f^{2 x} \mathrm {log}\left (f \right ) a x +4 \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}-\mathrm {log}\left (f^{2 x} a +b \right ) b -2 \mathrm {log}\left (f \right )^{2} b \,x^{2}}{4 \mathrm {log}\left (f \right )^{3} a b \left (f^{2 x} a +b \right )} \] Input:

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

Output:

(4*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 - f**(2*x)*log(f**(2*x)*a + b)*a + 2*f**(2*x)*log(f)*a*x + 4*int(x/(f* 
*(4*x)*a**2 + 2*f**(2*x)*a*b + b**2),x)*log(f)**2*b**3 - log(f**(2*x)*a + 
b)*b - 2*log(f)**2*b*x**2)/(4*log(f)**3*a*b*(f**(2*x)*a + b))