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

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

Optimal result

Integrand size = 31, antiderivative size = 427 \[ \int \frac {\left (a+b \log \left (c (d+e x)^n\right )\right )^2}{(f+g x) (h+i x)^2} \, dx=-\frac {i (d+e x) \left (a+b \log \left (c (d+e x)^n\right )\right )^2}{(e h-d i) (g h-f i) (h+i x)}+\frac {g \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 h-f i)^2}+\frac {2 b e n \left (a+b \log \left (c (d+e x)^n\right )\right ) \log \left (\frac {e (h+i x)}{e h-d i}\right )}{(e h-d i) (g h-f i)}-\frac {g \left (a+b \log \left (c (d+e x)^n\right )\right )^2 \log \left (\frac {e (h+i x)}{e h-d i}\right )}{(g h-f i)^2}+\frac {2 b g 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 h-f i)^2}+\frac {2 b^2 e n^2 \operatorname {PolyLog}\left (2,-\frac {i (d+e x)}{e h-d i}\right )}{(e h-d i) (g h-f i)}-\frac {2 b g n \left (a+b \log \left (c (d+e x)^n\right )\right ) \operatorname {PolyLog}\left (2,-\frac {i (d+e x)}{e h-d i}\right )}{(g h-f i)^2}-\frac {2 b^2 g n^2 \operatorname {PolyLog}\left (3,-\frac {g (d+e x)}{e f-d g}\right )}{(g h-f i)^2}+\frac {2 b^2 g n^2 \operatorname {PolyLog}\left (3,-\frac {i (d+e x)}{e h-d i}\right )}{(g h-f i)^2} \] Output:

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

Mathematica [A] (verified)

Time = 0.60 (sec) , antiderivative size = 630, normalized size of antiderivative = 1.48 \[ \int \frac {\left (a+b \log \left (c (d+e x)^n\right )\right )^2}{(f+g x) (h+i x)^2} \, dx=\frac {(e h-d i) (g h-f i) \left (a-b n \log (d+e x)+b \log \left (c (d+e x)^n\right )\right )^2+g (e h-d i) (h+i x) \left (a-b n \log (d+e x)+b \log \left (c (d+e x)^n\right )\right )^2 \log (f+g x)-g (e h-d i) (h+i x) \left (a-b n \log (d+e x)+b \log \left (c (d+e x)^n\right )\right )^2 \log (h+i x)-2 b n \left (a-b n \log (d+e x)+b \log \left (c (d+e x)^n\right )\right ) \left ((g h-f i) (i (d+e x) \log (d+e x)-e (h+i x) \log (h+i x))-g (e h-d i) (h+i x) \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 )+g (e h-d i) (h+i x) \left (\log (d+e x) \log \left (\frac {e (h+i x)}{e h-d i}\right )+\operatorname {PolyLog}\left (2,\frac {i (d+e x)}{-e h+d i}\right )\right )\right )-b^2 n^2 \left ((g h-f i) \left (\log (d+e x) \left (i (d+e x) \log (d+e x)-2 e (h+i x) \log \left (\frac {e (h+i x)}{e h-d i}\right )\right )-2 e (h+i x) \operatorname {PolyLog}\left (2,\frac {i (d+e x)}{-e h+d i}\right )\right )-g (e h-d i) (h+i x) \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 )+g (e h-d i) (h+i x) \left (\log ^2(d+e x) \log \left (\frac {e (h+i x)}{e h-d i}\right )+2 \log (d+e x) \operatorname {PolyLog}\left (2,\frac {i (d+e x)}{-e h+d i}\right )-2 \operatorname {PolyLog}\left (3,\frac {i (d+e x)}{-e h+d i}\right )\right )\right )}{(e h-d i) (g h-f i)^2 (h+i x)} \] Input:

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

Output:

((e*h - d*i)*(g*h - f*i)*(a - b*n*Log[d + e*x] + b*Log[c*(d + e*x)^n])^2 + 
 g*(e*h - d*i)*(h + i*x)*(a - b*n*Log[d + e*x] + b*Log[c*(d + e*x)^n])^2*L 
og[f + g*x] - g*(e*h - d*i)*(h + i*x)*(a - b*n*Log[d + e*x] + b*Log[c*(d + 
 e*x)^n])^2*Log[h + i*x] - 2*b*n*(a - b*n*Log[d + e*x] + b*Log[c*(d + e*x) 
^n])*((g*h - f*i)*(i*(d + e*x)*Log[d + e*x] - e*(h + i*x)*Log[h + i*x]) - 
g*(e*h - d*i)*(h + i*x)*(Log[d + e*x]*Log[(e*(f + g*x))/(e*f - d*g)] + Pol 
yLog[2, (g*(d + e*x))/(-(e*f) + d*g)]) + g*(e*h - d*i)*(h + i*x)*(Log[d + 
e*x]*Log[(e*(h + i*x))/(e*h - d*i)] + PolyLog[2, (i*(d + e*x))/(-(e*h) + d 
*i)])) - b^2*n^2*((g*h - f*i)*(Log[d + e*x]*(i*(d + e*x)*Log[d + e*x] - 2* 
e*(h + i*x)*Log[(e*(h + i*x))/(e*h - d*i)]) - 2*e*(h + i*x)*PolyLog[2, (i* 
(d + e*x))/(-(e*h) + d*i)]) - g*(e*h - d*i)*(h + i*x)*(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*PolyLog[3, (g*(d + e*x))/(-(e*f) + d*g)]) + g*(e*h - d*i)*( 
h + i*x)*(Log[d + e*x]^2*Log[(e*(h + i*x))/(e*h - d*i)] + 2*Log[d + e*x]*P 
olyLog[2, (i*(d + e*x))/(-(e*h) + d*i)] - 2*PolyLog[3, (i*(d + e*x))/(-(e* 
h) + d*i)])))/((e*h - d*i)*(g*h - f*i)^2*(h + i*x))
 

Rubi [A] (verified)

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

\(\Big \downarrow \) 2865

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

\(\Big \downarrow \) 2009

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

Input:

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

Output:

-((i*(d + e*x)*(a + b*Log[c*(d + e*x)^n])^2)/((e*h - d*i)*(g*h - f*i)*(h + 
 i*x))) + (g*(a + b*Log[c*(d + e*x)^n])^2*Log[(e*(f + g*x))/(e*f - d*g)])/ 
(g*h - f*i)^2 + (2*b*e*n*(a + b*Log[c*(d + e*x)^n])*Log[(e*(h + i*x))/(e*h 
 - d*i)])/((e*h - d*i)*(g*h - f*i)) - (g*(a + b*Log[c*(d + e*x)^n])^2*Log[ 
(e*(h + i*x))/(e*h - d*i)])/(g*h - f*i)^2 + (2*b*g*n*(a + b*Log[c*(d + e*x 
)^n])*PolyLog[2, -((g*(d + e*x))/(e*f - d*g))])/(g*h - f*i)^2 + (2*b^2*e*n 
^2*PolyLog[2, -((i*(d + e*x))/(e*h - d*i))])/((e*h - d*i)*(g*h - f*i)) - ( 
2*b*g*n*(a + b*Log[c*(d + e*x)^n])*PolyLog[2, -((i*(d + e*x))/(e*h - d*i)) 
])/(g*h - f*i)^2 - (2*b^2*g*n^2*PolyLog[3, -((g*(d + e*x))/(e*f - d*g))])/ 
(g*h - f*i)^2 + (2*b^2*g*n^2*PolyLog[3, -((i*(d + e*x))/(e*h - d*i))])/(g* 
h - f*i)^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 (a +b \ln \left (c \left (e x +d \right )^{n}\right )\right )}^{2}}{\left (g x +f \right ) \left (i x +h \right )^{2}}d x\]

Input:

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

Output:

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

Fricas [F]

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

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

Output:

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

Sympy [F]

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

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

Output:

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

Maxima [F]

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

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

Output:

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

Giac [F]

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

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

Output:

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

Mupad [F(-1)]

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

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

Output:

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

Reduce [F]

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

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

Output:

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