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

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

Optimal result

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

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

Mathematica [B] (verified)

Leaf count is larger than twice the leaf count of optimal. \(460\) vs. \(2(215)=430\).

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

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

Output:

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

Rubi [A] (verified)

Time = 0.89 (sec) , antiderivative size = 215, 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) \left (a+b \log \left (c (d+e x)^n\right )\right )^2}{f+g x} \, dx\)

\(\Big \downarrow \) 2865

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

\(\Big \downarrow \) 2009

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

Input:

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

Output:

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

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

\[\int \frac {\left (i x +h \right ) {\left (a +b \ln \left (c \left (e x +d \right )^{n}\right )\right )}^{2}}{g x +f}d x\]

Input:

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

Output:

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

Fricas [F]

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

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

Output:

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

Sympy [F]

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

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

Output:

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

Maxima [F]

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

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

Output:

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

Giac [F]

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

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

Output:

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

Mupad [F(-1)]

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

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

Output:

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

Reduce [F]

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

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

Output:

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