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

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

Optimal result

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

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

Mathematica [A] (verified)

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

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

Output:

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

Rubi [A] (verified)

Time = 0.99 (sec) , antiderivative size = 126, normalized size of antiderivative = 0.89, number of steps used = 6, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.156, Rules used = {2858, 27, 2779, 2821, 7143}

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 (c (e+f x)))^2}{(h+i x) (d e+d f x)} \, dx\)

\(\Big \downarrow \) 2858

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

\(\Big \downarrow \) 27

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

\(\Big \downarrow \) 2779

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

\(\Big \downarrow \) 2821

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

\(\Big \downarrow \) 7143

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

Input:

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

Output:

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

Defintions of rubi rules used

rule 27
Int[(a_)*(Fx_), x_Symbol] :> Simp[a   Int[Fx, x], x] /; FreeQ[a, x] &&  !Ma 
tchQ[Fx, (b_)*(Gx_) /; FreeQ[b, x]]
 

rule 2779
Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))^(p_.)/((x_)*((d_) + (e_.)*(x_)^(r 
_.))), x_Symbol] :> Simp[(-Log[1 + d/(e*x^r)])*((a + b*Log[c*x^n])^p/(d*r)) 
, x] + Simp[b*n*(p/(d*r))   Int[Log[1 + d/(e*x^r)]*((a + b*Log[c*x^n])^(p - 
 1)/x), x], x] /; FreeQ[{a, b, c, d, e, n, r}, x] && IGtQ[p, 0]
 

rule 2821
Int[(Log[(d_.)*((e_) + (f_.)*(x_)^(m_.))]*((a_.) + Log[(c_.)*(x_)^(n_.)]*(b 
_.))^(p_.))/(x_), x_Symbol] :> Simp[(-PolyLog[2, (-d)*f*x^m])*((a + b*Log[c 
*x^n])^p/m), x] + Simp[b*n*(p/m)   Int[PolyLog[2, (-d)*f*x^m]*((a + b*Log[c 
*x^n])^(p - 1)/x), x], x] /; FreeQ[{a, b, c, d, e, f, m, n}, x] && IGtQ[p, 
0] && EqQ[d*e, 1]
 

rule 2858
Int[((a_.) + Log[(c_.)*((d_) + (e_.)*(x_))^(n_.)]*(b_.))^(p_.)*((f_.) + (g_ 
.)*(x_))^(q_.)*((h_.) + (i_.)*(x_))^(r_.), x_Symbol] :> Simp[1/e   Subst[In 
t[(g*(x/e))^q*((e*h - d*i)/e + i*(x/e))^r*(a + b*Log[c*x^n])^p, x], x, d + 
e*x], x] /; FreeQ[{a, b, c, d, e, f, g, h, i, n, p, q, r}, x] && EqQ[e*f - 
d*g, 0] && (IGtQ[p, 0] || IGtQ[r, 0]) && IntegerQ[2*r]
 

rule 7143
Int[PolyLog[n_, (c_.)*((a_.) + (b_.)*(x_))^(p_.)]/((d_.) + (e_.)*(x_)), x_S 
ymbol] :> Simp[PolyLog[n + 1, c*(a + b*x)^p]/(e*p), x] /; FreeQ[{a, b, c, d 
, e, n, p}, x] && EqQ[b*d, a*e]
 
Maple [B] (verified)

Leaf count of result is larger than twice the leaf count of optimal. \(333\) vs. \(2(142)=284\).

Time = 3.51 (sec) , antiderivative size = 334, normalized size of antiderivative = 2.35

method result size
parts \(\frac {a^{2} \left (\frac {\ln \left (i x +h \right )}{e i -f h}-\frac {\ln \left (f x +e \right )}{e i -f h}\right )}{d}+\frac {b^{2} c \left (\frac {\ln \left (c f x +c e \right )^{2} \ln \left (1+\frac {i \left (c f x +c e \right )}{-c e i +h c f}\right )+2 \ln \left (c f x +c e \right ) \operatorname {polylog}\left (2, -\frac {i \left (c f x +c e \right )}{-c e i +h c f}\right )-2 \operatorname {polylog}\left (3, -\frac {i \left (c f x +c e \right )}{-c e i +h c f}\right )}{c \left (e i -f h \right )}-\frac {\ln \left (c f x +c e \right )^{3}}{3 c \left (e i -f h \right )}\right )}{d}+\frac {2 a b \operatorname {dilog}\left (\frac {-c e i +h c f +i \left (c f x +c e \right )}{-c e i +h c f}\right )}{d \left (e i -f h \right )}+\frac {2 a b \ln \left (c f x +c e \right ) \ln \left (\frac {-c e i +h c f +i \left (c f x +c e \right )}{-c e i +h c f}\right )}{d \left (e i -f h \right )}-\frac {a b \ln \left (c f x +c e \right )^{2}}{d \left (e i -f h \right )}\) \(334\)
risch \(\frac {a^{2} \ln \left (i x +h \right )}{d \left (e i -f h \right )}-\frac {a^{2} \ln \left (f x +e \right )}{d \left (e i -f h \right )}+\frac {b^{2} \ln \left (c f x +c e \right )^{2} \ln \left (1+\frac {i \left (c f x +c e \right )}{-c e i +h c f}\right )}{d \left (e i -f h \right )}+\frac {2 b^{2} \ln \left (c f x +c e \right ) \operatorname {polylog}\left (2, -\frac {i \left (c f x +c e \right )}{-c e i +h c f}\right )}{d \left (e i -f h \right )}-\frac {2 b^{2} \operatorname {polylog}\left (3, -\frac {i \left (c f x +c e \right )}{-c e i +h c f}\right )}{d \left (e i -f h \right )}-\frac {b^{2} \ln \left (c f x +c e \right )^{3}}{3 d \left (e i -f h \right )}+\frac {2 a b \operatorname {dilog}\left (\frac {-c e i +h c f +i \left (c f x +c e \right )}{-c e i +h c f}\right )}{d \left (e i -f h \right )}+\frac {2 a b \ln \left (c f x +c e \right ) \ln \left (\frac {-c e i +h c f +i \left (c f x +c e \right )}{-c e i +h c f}\right )}{d \left (e i -f h \right )}-\frac {a b \ln \left (c f x +c e \right )^{2}}{d \left (e i -f h \right )}\) \(365\)
derivativedivides \(\frac {\frac {c f \,a^{2} \ln \left (c e i -h c f -i \left (c f x +c e \right )\right )}{d \left (e i -f h \right )}-\frac {c f \,a^{2} \ln \left (c f x +c e \right )}{d \left (e i -f h \right )}-\frac {c^{2} f \,b^{2} \left (-\frac {\ln \left (c f x +c e \right )^{2} \ln \left (1+\frac {i \left (c f x +c e \right )}{-c e i +h c f}\right )+2 \ln \left (c f x +c e \right ) \operatorname {polylog}\left (2, -\frac {i \left (c f x +c e \right )}{-c e i +h c f}\right )-2 \operatorname {polylog}\left (3, -\frac {i \left (c f x +c e \right )}{-c e i +h c f}\right )}{c \left (e i -f h \right )}+\frac {\ln \left (c f x +c e \right )^{3}}{3 c \left (e i -f h \right )}\right )}{d}-\frac {2 c^{2} f a b \left (-\frac {\left (\frac {\operatorname {dilog}\left (\frac {-c e i +h c f +i \left (c f x +c e \right )}{-c e i +h c f}\right )}{i}+\frac {\ln \left (c f x +c e \right ) \ln \left (\frac {-c e i +h c f +i \left (c f x +c e \right )}{-c e i +h c f}\right )}{i}\right ) i}{c \left (e i -f h \right )}+\frac {\ln \left (c f x +c e \right )^{2}}{2 c \left (e i -f h \right )}\right )}{d}}{c f}\) \(374\)
default \(\frac {\frac {c f \,a^{2} \ln \left (c e i -h c f -i \left (c f x +c e \right )\right )}{d \left (e i -f h \right )}-\frac {c f \,a^{2} \ln \left (c f x +c e \right )}{d \left (e i -f h \right )}-\frac {c^{2} f \,b^{2} \left (-\frac {\ln \left (c f x +c e \right )^{2} \ln \left (1+\frac {i \left (c f x +c e \right )}{-c e i +h c f}\right )+2 \ln \left (c f x +c e \right ) \operatorname {polylog}\left (2, -\frac {i \left (c f x +c e \right )}{-c e i +h c f}\right )-2 \operatorname {polylog}\left (3, -\frac {i \left (c f x +c e \right )}{-c e i +h c f}\right )}{c \left (e i -f h \right )}+\frac {\ln \left (c f x +c e \right )^{3}}{3 c \left (e i -f h \right )}\right )}{d}-\frac {2 c^{2} f a b \left (-\frac {\left (\frac {\operatorname {dilog}\left (\frac {-c e i +h c f +i \left (c f x +c e \right )}{-c e i +h c f}\right )}{i}+\frac {\ln \left (c f x +c e \right ) \ln \left (\frac {-c e i +h c f +i \left (c f x +c e \right )}{-c e i +h c f}\right )}{i}\right ) i}{c \left (e i -f h \right )}+\frac {\ln \left (c f x +c e \right )^{2}}{2 c \left (e i -f h \right )}\right )}{d}}{c f}\) \(374\)

Input:

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

Output:

a^2/d*(1/(e*i-f*h)*ln(i*x+h)-1/(e*i-f*h)*ln(f*x+e))+b^2/d*c*(1/c/(e*i-f*h) 
*(ln(c*f*x+c*e)^2*ln(1+i/(-c*e*i+c*f*h)*(c*f*x+c*e))+2*ln(c*f*x+c*e)*polyl 
og(2,-i/(-c*e*i+c*f*h)*(c*f*x+c*e))-2*polylog(3,-i/(-c*e*i+c*f*h)*(c*f*x+c 
*e)))-1/3/c/(e*i-f*h)*ln(c*f*x+c*e)^3)+2*a*b/d/(e*i-f*h)*dilog((-c*e*i+h*c 
*f+i*(c*f*x+c*e))/(-c*e*i+c*f*h))+2*a*b/d/(e*i-f*h)*ln(c*f*x+c*e)*ln((-c*e 
*i+h*c*f+i*(c*f*x+c*e))/(-c*e*i+c*f*h))-a*b/d*ln(c*f*x+c*e)^2/(e*i-f*h)
 

Fricas [F]

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

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

Output:

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

Sympy [F]

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

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

Output:

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

Maxima [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 331 vs. \(2 (141) = 282\).

Time = 0.09 (sec) , antiderivative size = 331, normalized size of antiderivative = 2.33 \[ \int \frac {(a+b \log (c (e+f x)))^2}{(d e+d f x) (h+i x)} \, dx=a^{2} {\left (\frac {\log \left (f x + e\right )}{d f h - d e i} - \frac {\log \left (i x + h\right )}{d f h - d e i}\right )} - \frac {{\left (\log \left (f x + e\right )^{2} \log \left (\frac {f i x + e i}{f h - e i} + 1\right ) + 2 \, {\rm Li}_2\left (-\frac {f i x + e i}{f h - e i}\right ) \log \left (f x + e\right ) - 2 \, {\rm Li}_{3}(-\frac {f i x + e i}{f h - e i})\right )} b^{2}}{{\left (f h - e i\right )} d} - \frac {2 \, {\left (b^{2} \log \left (c\right ) + a b\right )} {\left (\log \left (f x + e\right ) \log \left (\frac {f i x + e i}{f h - e i} + 1\right ) + {\rm Li}_2\left (-\frac {f i x + e i}{f h - e i}\right )\right )}}{{\left (f h - e i\right )} d} - \frac {{\left (b^{2} \log \left (c\right )^{2} + 2 \, a b \log \left (c\right )\right )} \log \left (i x + h\right )}{{\left (f h - e i\right )} d} + \frac {b^{2} \log \left (f x + e\right )^{3} + 3 \, {\left (b^{2} \log \left (c\right ) + a b\right )} \log \left (f x + e\right )^{2} + 3 \, {\left (b^{2} \log \left (c\right )^{2} + 2 \, a b \log \left (c\right )\right )} \log \left (f x + e\right )}{3 \, {\left (f h - e i\right )} d} \] Input:

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

Output:

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

Giac [F]

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

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

Output:

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

Mupad [F(-1)]

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

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

Output:

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

Reduce [F]

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

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

Output:

(int(log(c*e + c*f*x)**2/(e*h + e*i*x + f*h*x + f*i*x**2),x)*b**2*e*i - in 
t(log(c*e + c*f*x)**2/(e*h + e*i*x + f*h*x + f*i*x**2),x)*b**2*f*h + 2*int 
(log(c*e + c*f*x)/(e*h + e*i*x + f*h*x + f*i*x**2),x)*a*b*e*i - 2*int(log( 
c*e + c*f*x)/(e*h + e*i*x + f*h*x + f*i*x**2),x)*a*b*f*h - log(e + f*x)*a* 
*2 + log(h + i*x)*a**2)/(d*(e*i - f*h))