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

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

Optimal result

Integrand size = 29, antiderivative size = 241 \[ \int \frac {(h+i x)^2 \left (a+b \log \left (c (d+e x)^n\right )\right )}{f+g x} \, dx=\frac {a i (g h-f i) x}{g^2}-\frac {b i (e h-d i) n x}{2 e g}-\frac {b i (g h-f i) n x}{g^2}-\frac {b n (h+i x)^2}{4 g}-\frac {b (e h-d i)^2 n \log (d+e x)}{2 e^2 g}+\frac {b i (g h-f i) (d+e x) \log \left (c (d+e x)^n\right )}{e g^2}+\frac {(h+i x)^2 \left (a+b \log \left (c (d+e x)^n\right )\right )}{2 g}+\frac {(g h-f i)^2 \left (a+b \log \left (c (d+e x)^n\right )\right ) \log \left (\frac {e (f+g x)}{e f-d g}\right )}{g^3}+\frac {b (g h-f i)^2 n \operatorname {PolyLog}\left (2,-\frac {g (d+e x)}{e f-d g}\right )}{g^3} \] Output:

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

Mathematica [A] (verified)

Time = 0.28 (sec) , antiderivative size = 224, normalized size of antiderivative = 0.93 \[ \int \frac {(h+i x)^2 \left (a+b \log \left (c (d+e x)^n\right )\right )}{f+g x} \, dx=\frac {-2 b d^2 g^2 i^2 n \log (d+e x)+e \left (g i x (2 a e (4 g h-2 f i+g i x)+b n (2 d g i-e (8 g h-4 f i+g i x)))+4 a e (g h-f i)^2 \log \left (\frac {e (f+g x)}{e f-d g}\right )+2 b \log \left (c (d+e x)^n\right ) \left (g i (d (4 g h-2 f i)+e x (4 g h-2 f i+g i x))+2 e (g h-f i)^2 \log \left (\frac {e (f+g x)}{e f-d g}\right )\right )\right )+4 b e^2 (g h-f i)^2 n \operatorname {PolyLog}\left (2,\frac {g (d+e x)}{-e f+d g}\right )}{4 e^2 g^3} \] Input:

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

Output:

(-2*b*d^2*g^2*i^2*n*Log[d + e*x] + e*(g*i*x*(2*a*e*(4*g*h - 2*f*i + g*i*x) 
 + b*n*(2*d*g*i - e*(8*g*h - 4*f*i + g*i*x))) + 4*a*e*(g*h - f*i)^2*Log[(e 
*(f + g*x))/(e*f - d*g)] + 2*b*Log[c*(d + e*x)^n]*(g*i*(d*(4*g*h - 2*f*i) 
+ e*x*(4*g*h - 2*f*i + g*i*x)) + 2*e*(g*h - f*i)^2*Log[(e*(f + g*x))/(e*f 
- d*g)])) + 4*b*e^2*(g*h - f*i)^2*n*PolyLog[2, (g*(d + e*x))/(-(e*f) + d*g 
)])/(4*e^2*g^3)
 

Rubi [A] (verified)

Time = 0.82 (sec) , antiderivative size = 241, 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.069, Rules used = {2865, 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 {(h+i x)^2 \left (a+b \log \left (c (d+e x)^n\right )\right )}{f+g x} \, dx\)

\(\Big \downarrow \) 2865

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

\(\Big \downarrow \) 2009

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

Input:

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

Output:

(a*i*(g*h - f*i)*x)/g^2 - (b*i*(e*h - d*i)*n*x)/(2*e*g) - (b*i*(g*h - f*i) 
*n*x)/g^2 - (b*n*(h + i*x)^2)/(4*g) - (b*(e*h - d*i)^2*n*Log[d + e*x])/(2* 
e^2*g) + (b*i*(g*h - f*i)*(d + e*x)*Log[c*(d + e*x)^n])/(e*g^2) + ((h + i* 
x)^2*(a + b*Log[c*(d + e*x)^n]))/(2*g) + ((g*h - f*i)^2*(a + b*Log[c*(d + 
e*x)^n])*Log[(e*(f + g*x))/(e*f - d*g)])/g^3 + (b*(g*h - f*i)^2*n*PolyLog[ 
2, -((g*(d + e*x))/(e*f - d*g))])/g^3
 

Defintions of rubi rules used

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

rule 2865
Int[((a_.) + Log[(c_.)*((d_) + (e_.)*(x_))^(n_.)]*(b_.))^(p_.)*(RFx_), x_Sy 
mbol] :> With[{u = ExpandIntegrand[(a + b*Log[c*(d + e*x)^n])^p, RFx, x]}, 
Int[u, x] /; SumQ[u]] /; FreeQ[{a, b, c, d, e, n}, x] && RationalFunctionQ[ 
RFx, x] && IntegerQ[p]
 
Maple [C] (warning: unable to verify)

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

Time = 2.43 (sec) , antiderivative size = 721, normalized size of antiderivative = 2.99

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

Input:

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

Output:

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

Fricas [F]

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

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

Output:

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

Sympy [F]

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

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

Output:

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

Maxima [F]

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

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

Output:

2*a*h*i*(x/g - f*log(g*x + f)/g^2) + 1/2*a*i^2*(2*f^2*log(g*x + f)/g^3 + ( 
g*x^2 - 2*f*x)/g^2) + a*h^2*log(g*x + f)/g + integrate((b*i^2*x^2*log(c) + 
 2*b*h*i*x*log(c) + b*h^2*log(c) + (b*i^2*x^2 + 2*b*h*i*x + b*h^2)*log((e* 
x + d)^n))/(g*x + f), x)
 

Giac [F]

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

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

Output:

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

Mupad [F(-1)]

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

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

Output:

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

Reduce [F]

\[ \int \frac {(h+i x)^2 \left (a+b \log \left (c (d+e x)^n\right )\right )}{f+g x} \, dx=\frac {8 \left (\int \frac {\mathrm {log}\left (\left (e x +d \right )^{n} c \right )}{e g \,x^{2}+d g x +e f x +d f}d x \right ) b \,e^{3} f^{2} g h i n -2 \mathrm {log}\left (\left (e x +d \right )^{n} c \right )^{2} b \,e^{2} f^{2}-8 \,\mathrm {log}\left (g x +f \right ) a \,e^{2} f g h i n +8 \,\mathrm {log}\left (\left (e x +d \right )^{n} c \right ) b d e \,g^{2} h i n +8 \,\mathrm {log}\left (\left (e x +d \right )^{n} c \right ) b \,e^{2} g^{2} h i n x +4 \left (\int \frac {\mathrm {log}\left (\left (e x +d \right )^{n} c \right )}{e g \,x^{2}+d g x +e f x +d f}d x \right ) b \,e^{3} f^{3} n -4 \,\mathrm {log}\left (g x +f \right ) a \,e^{2} f^{2} n +2 \mathrm {log}\left (\left (e x +d \right )^{n} c \right )^{2} b \,e^{2} g^{2} h^{2}+2 \,\mathrm {log}\left (\left (e x +d \right )^{n} c \right ) b \,d^{2} g^{2} n -2 a \,e^{2} g^{2} n \,x^{2}-4 \left (\int \frac {\mathrm {log}\left (\left (e x +d \right )^{n} c \right )}{e g \,x^{2}+d g x +e f x +d f}d x \right ) b d \,e^{2} f^{2} g n +4 \left (\int \frac {\mathrm {log}\left (\left (e x +d \right )^{n} c \right )}{e g \,x^{2}+d g x +e f x +d f}d x \right ) b d \,e^{2} g^{3} h^{2} n -4 \left (\int \frac {\mathrm {log}\left (\left (e x +d \right )^{n} c \right )}{e g \,x^{2}+d g x +e f x +d f}d x \right ) b \,e^{3} f \,g^{2} h^{2} n +b \,e^{2} g^{2} n^{2} x^{2}+4 \,\mathrm {log}\left (g x +f \right ) a \,e^{2} g^{2} h^{2} n -2 \,\mathrm {log}\left (\left (e x +d \right )^{n} c \right ) b \,e^{2} g^{2} n \,x^{2}+4 a \,e^{2} f g n x -2 b d e \,g^{2} n^{2} x -4 b \,e^{2} f g \,n^{2} x -4 \mathrm {log}\left (\left (e x +d \right )^{n} c \right )^{2} b \,e^{2} f g h i +4 \,\mathrm {log}\left (\left (e x +d \right )^{n} c \right ) b d e f g n +4 \,\mathrm {log}\left (\left (e x +d \right )^{n} c \right ) b \,e^{2} f g n x -8 \left (\int \frac {\mathrm {log}\left (\left (e x +d \right )^{n} c \right )}{e g \,x^{2}+d g x +e f x +d f}d x \right ) b d \,e^{2} f \,g^{2} h i n +8 a \,e^{2} g^{2} h i n x -8 b \,e^{2} g^{2} h i \,n^{2} x}{4 e^{2} g^{3} n} \] Input:

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

Output:

( - 4*int(log((d + e*x)**n*c)/(d*f + d*g*x + e*f*x + e*g*x**2),x)*b*d*e**2 
*f**2*g*n - 8*int(log((d + e*x)**n*c)/(d*f + d*g*x + e*f*x + e*g*x**2),x)* 
b*d*e**2*f*g**2*h*i*n + 4*int(log((d + e*x)**n*c)/(d*f + d*g*x + e*f*x + e 
*g*x**2),x)*b*d*e**2*g**3*h**2*n + 4*int(log((d + e*x)**n*c)/(d*f + d*g*x 
+ e*f*x + e*g*x**2),x)*b*e**3*f**3*n + 8*int(log((d + e*x)**n*c)/(d*f + d* 
g*x + e*f*x + e*g*x**2),x)*b*e**3*f**2*g*h*i*n - 4*int(log((d + e*x)**n*c) 
/(d*f + d*g*x + e*f*x + e*g*x**2),x)*b*e**3*f*g**2*h**2*n - 4*log(f + g*x) 
*a*e**2*f**2*n - 8*log(f + g*x)*a*e**2*f*g*h*i*n + 4*log(f + g*x)*a*e**2*g 
**2*h**2*n - 2*log((d + e*x)**n*c)**2*b*e**2*f**2 - 4*log((d + e*x)**n*c)* 
*2*b*e**2*f*g*h*i + 2*log((d + e*x)**n*c)**2*b*e**2*g**2*h**2 + 2*log((d + 
 e*x)**n*c)*b*d**2*g**2*n + 4*log((d + e*x)**n*c)*b*d*e*f*g*n + 8*log((d + 
 e*x)**n*c)*b*d*e*g**2*h*i*n + 4*log((d + e*x)**n*c)*b*e**2*f*g*n*x + 8*lo 
g((d + e*x)**n*c)*b*e**2*g**2*h*i*n*x - 2*log((d + e*x)**n*c)*b*e**2*g**2* 
n*x**2 + 4*a*e**2*f*g*n*x + 8*a*e**2*g**2*h*i*n*x - 2*a*e**2*g**2*n*x**2 - 
 2*b*d*e*g**2*n**2*x - 4*b*e**2*f*g*n**2*x - 8*b*e**2*g**2*h*i*n**2*x + b* 
e**2*g**2*n**2*x**2)/(4*e**2*g**3*n)