\(\int \frac {a+b \log (c x^n)}{d+e x+f x^2} \, dx\) [7]

Optimal result
Mathematica [A] (verified)
Rubi [A] (verified)
Maple [C] (warning: unable to verify)
Fricas [F]
Sympy [F]
Maxima [F(-2)]
Giac [F]
Mupad [F(-1)]
Reduce [F]

Optimal result

Integrand size = 23, antiderivative size = 173 \[ \int \frac {a+b \log \left (c x^n\right )}{d+e x+f x^2} \, dx=\frac {\left (a+b \log \left (c x^n\right )\right ) \log \left (1+\frac {2 f x}{e-\sqrt {e^2-4 d f}}\right )}{\sqrt {e^2-4 d f}}-\frac {\left (a+b \log \left (c x^n\right )\right ) \log \left (1+\frac {2 f x}{e+\sqrt {e^2-4 d f}}\right )}{\sqrt {e^2-4 d f}}+\frac {b n \operatorname {PolyLog}\left (2,-\frac {2 f x}{e-\sqrt {e^2-4 d f}}\right )}{\sqrt {e^2-4 d f}}-\frac {b n \operatorname {PolyLog}\left (2,-\frac {2 f x}{e+\sqrt {e^2-4 d f}}\right )}{\sqrt {e^2-4 d f}} \] Output:

(a+b*ln(c*x^n))*ln(1+2*f*x/(e-(-4*d*f+e^2)^(1/2)))/(-4*d*f+e^2)^(1/2)-(a+b 
*ln(c*x^n))*ln(1+2*f*x/(e+(-4*d*f+e^2)^(1/2)))/(-4*d*f+e^2)^(1/2)+b*n*poly 
log(2,-2*f*x/(e-(-4*d*f+e^2)^(1/2)))/(-4*d*f+e^2)^(1/2)-b*n*polylog(2,-2*f 
*x/(e+(-4*d*f+e^2)^(1/2)))/(-4*d*f+e^2)^(1/2)
 

Mathematica [A] (verified)

Time = 0.26 (sec) , antiderivative size = 183, normalized size of antiderivative = 1.06 \[ \int \frac {a+b \log \left (c x^n\right )}{d+e x+f x^2} \, dx=\frac {-2 a \text {arctanh}\left (\frac {e+2 f x}{\sqrt {e^2-4 d f}}\right )+b \log \left (c x^n\right ) \log \left (\frac {e-\sqrt {e^2-4 d f}+2 f x}{e-\sqrt {e^2-4 d f}}\right )-b \log \left (c x^n\right ) \log \left (\frac {e+\sqrt {e^2-4 d f}+2 f x}{e+\sqrt {e^2-4 d f}}\right )+b n \operatorname {PolyLog}\left (2,\frac {2 f x}{-e+\sqrt {e^2-4 d f}}\right )-b n \operatorname {PolyLog}\left (2,-\frac {2 f x}{e+\sqrt {e^2-4 d f}}\right )}{\sqrt {e^2-4 d f}} \] Input:

Integrate[(a + b*Log[c*x^n])/(d + e*x + f*x^2),x]
 

Output:

(-2*a*ArcTanh[(e + 2*f*x)/Sqrt[e^2 - 4*d*f]] + b*Log[c*x^n]*Log[(e - Sqrt[ 
e^2 - 4*d*f] + 2*f*x)/(e - Sqrt[e^2 - 4*d*f])] - b*Log[c*x^n]*Log[(e + Sqr 
t[e^2 - 4*d*f] + 2*f*x)/(e + Sqrt[e^2 - 4*d*f])] + b*n*PolyLog[2, (2*f*x)/ 
(-e + Sqrt[e^2 - 4*d*f])] - b*n*PolyLog[2, (-2*f*x)/(e + Sqrt[e^2 - 4*d*f] 
)])/Sqrt[e^2 - 4*d*f]
 

Rubi [A] (verified)

Time = 0.43 (sec) , antiderivative size = 173, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.087, Rules used = {2804, 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 {a+b \log \left (c x^n\right )}{d+e x+f x^2} \, dx\)

\(\Big \downarrow \) 2804

\(\displaystyle \int \left (\frac {2 f \left (a+b \log \left (c x^n\right )\right )}{\sqrt {e^2-4 d f} \left (-\sqrt {e^2-4 d f}+e+2 f x\right )}-\frac {2 f \left (a+b \log \left (c x^n\right )\right )}{\sqrt {e^2-4 d f} \left (\sqrt {e^2-4 d f}+e+2 f x\right )}\right )dx\)

\(\Big \downarrow \) 2009

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

Input:

Int[(a + b*Log[c*x^n])/(d + e*x + f*x^2),x]
 

Output:

((a + b*Log[c*x^n])*Log[1 + (2*f*x)/(e - Sqrt[e^2 - 4*d*f])])/Sqrt[e^2 - 4 
*d*f] - ((a + b*Log[c*x^n])*Log[1 + (2*f*x)/(e + Sqrt[e^2 - 4*d*f])])/Sqrt 
[e^2 - 4*d*f] + (b*n*PolyLog[2, (-2*f*x)/(e - Sqrt[e^2 - 4*d*f])])/Sqrt[e^ 
2 - 4*d*f] - (b*n*PolyLog[2, (-2*f*x)/(e + Sqrt[e^2 - 4*d*f])])/Sqrt[e^2 - 
 4*d*f]
 

Defintions of rubi rules used

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

rule 2804
Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))^(p_.)*(RFx_), x_Symbol] :> With[{ 
u = ExpandIntegrand[(a + b*Log[c*x^n])^p, RFx, x]}, Int[u, x] /; SumQ[u]] / 
; FreeQ[{a, b, c, n}, x] && RationalFunctionQ[RFx, x] && IGtQ[p, 0]
 
Maple [C] (warning: unable to verify)

Result contains higher order function than in optimal. Order 9 vs. order 4.

Time = 1.27 (sec) , antiderivative size = 395, normalized size of antiderivative = 2.28

method result size
risch \(-\frac {2 b \arctan \left (\frac {2 f x +e}{\sqrt {4 d f -e^{2}}}\right ) n \ln \left (x \right )}{\sqrt {4 d f -e^{2}}}+\frac {2 b \arctan \left (\frac {2 f x +e}{\sqrt {4 d f -e^{2}}}\right ) \ln \left (x^{n}\right )}{\sqrt {4 d f -e^{2}}}+\frac {b n \ln \left (x \right ) \ln \left (\frac {-2 f x +\sqrt {-4 d f +e^{2}}-e}{-e +\sqrt {-4 d f +e^{2}}}\right )}{\sqrt {-4 d f +e^{2}}}-\frac {b n \ln \left (x \right ) \ln \left (\frac {e +\sqrt {-4 d f +e^{2}}+2 f x}{e +\sqrt {-4 d f +e^{2}}}\right )}{\sqrt {-4 d f +e^{2}}}+\frac {b n \operatorname {dilog}\left (\frac {-2 f x +\sqrt {-4 d f +e^{2}}-e}{-e +\sqrt {-4 d f +e^{2}}}\right )}{\sqrt {-4 d f +e^{2}}}-\frac {b n \operatorname {dilog}\left (\frac {e +\sqrt {-4 d f +e^{2}}+2 f x}{e +\sqrt {-4 d f +e^{2}}}\right )}{\sqrt {-4 d f +e^{2}}}+\frac {2 \left (\frac {i b \pi \,\operatorname {csgn}\left (i x^{n}\right ) \operatorname {csgn}\left (i c \,x^{n}\right )^{2}}{2}-\frac {i b \pi \,\operatorname {csgn}\left (i x^{n}\right ) \operatorname {csgn}\left (i c \,x^{n}\right ) \operatorname {csgn}\left (i c \right )}{2}-\frac {i b \pi \operatorname {csgn}\left (i c \,x^{n}\right )^{3}}{2}+\frac {i b \pi \operatorname {csgn}\left (i c \,x^{n}\right )^{2} \operatorname {csgn}\left (i c \right )}{2}+b \ln \left (c \right )+a \right ) \arctan \left (\frac {2 f x +e}{\sqrt {4 d f -e^{2}}}\right )}{\sqrt {4 d f -e^{2}}}\) \(395\)

Input:

int((a+b*ln(c*x^n))/(f*x^2+e*x+d),x,method=_RETURNVERBOSE)
 

Output:

-2*b/(4*d*f-e^2)^(1/2)*arctan((2*f*x+e)/(4*d*f-e^2)^(1/2))*n*ln(x)+2*b/(4* 
d*f-e^2)^(1/2)*arctan((2*f*x+e)/(4*d*f-e^2)^(1/2))*ln(x^n)+b*n*ln(x)/(-4*d 
*f+e^2)^(1/2)*ln((-2*f*x+(-4*d*f+e^2)^(1/2)-e)/(-e+(-4*d*f+e^2)^(1/2)))-b* 
n*ln(x)/(-4*d*f+e^2)^(1/2)*ln((e+(-4*d*f+e^2)^(1/2)+2*f*x)/(e+(-4*d*f+e^2) 
^(1/2)))+b*n/(-4*d*f+e^2)^(1/2)*dilog((-2*f*x+(-4*d*f+e^2)^(1/2)-e)/(-e+(- 
4*d*f+e^2)^(1/2)))-b*n/(-4*d*f+e^2)^(1/2)*dilog((e+(-4*d*f+e^2)^(1/2)+2*f* 
x)/(e+(-4*d*f+e^2)^(1/2)))+2*(1/2*I*Pi*b*csgn(I*x^n)*csgn(I*c*x^n)^2-1/2*I 
*Pi*b*csgn(I*x^n)*csgn(I*c*x^n)*csgn(I*c)-1/2*I*Pi*b*csgn(I*c*x^n)^3+1/2*I 
*Pi*b*csgn(I*c*x^n)^2*csgn(I*c)+b*ln(c)+a)/(4*d*f-e^2)^(1/2)*arctan((2*f*x 
+e)/(4*d*f-e^2)^(1/2))
 

Fricas [F]

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

integrate((a+b*log(c*x^n))/(f*x^2+e*x+d),x, algorithm="fricas")
 

Output:

integral((b*log(c*x^n) + a)/(f*x^2 + e*x + d), x)
 

Sympy [F]

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

integrate((a+b*ln(c*x**n))/(f*x**2+e*x+d),x)
 

Output:

Integral((a + b*log(c*x**n))/(d + e*x + f*x**2), x)
 

Maxima [F(-2)]

Exception generated. \[ \int \frac {a+b \log \left (c x^n\right )}{d+e x+f x^2} \, dx=\text {Exception raised: ValueError} \] Input:

integrate((a+b*log(c*x^n))/(f*x^2+e*x+d),x, algorithm="maxima")
 

Output:

Exception raised: ValueError >> Computation failed since Maxima requested 
additional constraints; using the 'assume' command before evaluation *may* 
 help (example of legal syntax is 'assume(4*d*f-e^2>0)', see `assume?` for 
 more deta
 

Giac [F]

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

integrate((a+b*log(c*x^n))/(f*x^2+e*x+d),x, algorithm="giac")
 

Output:

integrate((b*log(c*x^n) + a)/(f*x^2 + e*x + d), x)
                                                                                    
                                                                                    
 

Mupad [F(-1)]

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

int((a + b*log(c*x^n))/(d + e*x + f*x^2),x)
 

Output:

int((a + b*log(c*x^n))/(d + e*x + f*x^2), x)
 

Reduce [F]

\[ \int \frac {a+b \log \left (c x^n\right )}{d+e x+f x^2} \, dx=\frac {2 \sqrt {4 d f -e^{2}}\, \mathit {atan} \left (\frac {2 f x +e}{\sqrt {4 d f -e^{2}}}\right ) a +4 \left (\int \frac {\mathrm {log}\left (x^{n} c \right )}{f \,x^{2}+e x +d}d x \right ) b d f -\left (\int \frac {\mathrm {log}\left (x^{n} c \right )}{f \,x^{2}+e x +d}d x \right ) b \,e^{2}}{4 d f -e^{2}} \] Input:

int((a+b*log(c*x^n))/(f*x^2+e*x+d),x)
 

Output:

(2*sqrt(4*d*f - e**2)*atan((e + 2*f*x)/sqrt(4*d*f - e**2))*a + 4*int(log(x 
**n*c)/(d + e*x + f*x**2),x)*b*d*f - int(log(x**n*c)/(d + e*x + f*x**2),x) 
*b*e**2)/(4*d*f - e**2)