Integrand size = 23, antiderivative size = 133 \[ \int \frac {(d+e x)^2 \left (a+b \log \left (c x^n\right )\right )^2}{x^2} \, dx=-\frac {2 b^2 d^2 n^2}{x}-2 a b e^2 n x+2 b^2 e^2 n^2 x-2 b^2 e^2 n x \log \left (c x^n\right )-\frac {2 b d^2 n \left (a+b \log \left (c x^n\right )\right )}{x}-\frac {d^2 \left (a+b \log \left (c x^n\right )\right )^2}{x}+e^2 x \left (a+b \log \left (c x^n\right )\right )^2+\frac {2 d e \left (a+b \log \left (c x^n\right )\right )^3}{3 b n} \] Output:
-2*b^2*d^2*n^2/x-2*a*b*e^2*n*x+2*b^2*e^2*n^2*x-2*b^2*e^2*n*x*ln(c*x^n)-2*b *d^2*n*(a+b*ln(c*x^n))/x-d^2*(a+b*ln(c*x^n))^2/x+e^2*x*(a+b*ln(c*x^n))^2+2 /3*d*e*(a+b*ln(c*x^n))^3/b/n
Time = 0.05 (sec) , antiderivative size = 107, normalized size of antiderivative = 0.80 \[ \int \frac {(d+e x)^2 \left (a+b \log \left (c x^n\right )\right )^2}{x^2} \, dx=-\frac {d^2 \left (a+b \log \left (c x^n\right )\right )^2}{x}+e^2 x \left (a+b \log \left (c x^n\right )\right )^2+\frac {2 d e \left (a+b \log \left (c x^n\right )\right )^3}{3 b n}-2 b e^2 n x \left (a-b n+b \log \left (c x^n\right )\right )-\frac {2 b d^2 n \left (a+b n+b \log \left (c x^n\right )\right )}{x} \] Input:
Integrate[((d + e*x)^2*(a + b*Log[c*x^n])^2)/x^2,x]
Output:
-((d^2*(a + b*Log[c*x^n])^2)/x) + e^2*x*(a + b*Log[c*x^n])^2 + (2*d*e*(a + b*Log[c*x^n])^3)/(3*b*n) - 2*b*e^2*n*x*(a - b*n + b*Log[c*x^n]) - (2*b*d^ 2*n*(a + b*n + b*Log[c*x^n]))/x
Time = 0.38 (sec) , antiderivative size = 133, 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 = {2795, 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 {(d+e x)^2 \left (a+b \log \left (c x^n\right )\right )^2}{x^2} \, dx\) |
\(\Big \downarrow \) 2795 |
\(\displaystyle \int \left (\frac {d^2 \left (a+b \log \left (c x^n\right )\right )^2}{x^2}+\frac {2 d e \left (a+b \log \left (c x^n\right )\right )^2}{x}+e^2 \left (a+b \log \left (c x^n\right )\right )^2\right )dx\) |
\(\Big \downarrow \) 2009 |
\(\displaystyle -\frac {d^2 \left (a+b \log \left (c x^n\right )\right )^2}{x}-\frac {2 b d^2 n \left (a+b \log \left (c x^n\right )\right )}{x}+\frac {2 d e \left (a+b \log \left (c x^n\right )\right )^3}{3 b n}+e^2 x \left (a+b \log \left (c x^n\right )\right )^2-2 a b e^2 n x-2 b^2 e^2 n x \log \left (c x^n\right )-\frac {2 b^2 d^2 n^2}{x}+2 b^2 e^2 n^2 x\) |
Input:
Int[((d + e*x)^2*(a + b*Log[c*x^n])^2)/x^2,x]
Output:
(-2*b^2*d^2*n^2)/x - 2*a*b*e^2*n*x + 2*b^2*e^2*n^2*x - 2*b^2*e^2*n*x*Log[c *x^n] - (2*b*d^2*n*(a + b*Log[c*x^n]))/x - (d^2*(a + b*Log[c*x^n])^2)/x + e^2*x*(a + b*Log[c*x^n])^2 + (2*d*e*(a + b*Log[c*x^n])^3)/(3*b*n)
Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))^(p_.)*((f_.)*(x_))^(m_.)*((d_) + (e_.)*(x_)^(r_.))^(q_.), x_Symbol] :> With[{u = ExpandIntegrand[(a + b*Log[ c*x^n])^p, (f*x)^m*(d + e*x^r)^q, x]}, Int[u, x] /; SumQ[u]] /; FreeQ[{a, b , c, d, e, f, m, n, p, q, r}, x] && IntegerQ[q] && (GtQ[q, 0] || (IGtQ[p, 0 ] && IntegerQ[m] && IntegerQ[r]))
Time = 0.75 (sec) , antiderivative size = 226, normalized size of antiderivative = 1.70
method | result | size |
parallelrisch | \(\frac {3 x^{2} \ln \left (c \,x^{n}\right )^{2} b^{2} e^{2} n -6 x^{2} \ln \left (c \,x^{n}\right ) b^{2} e^{2} n^{2}+6 x^{2} b^{2} e^{2} n^{3}+6 x^{2} \ln \left (c \,x^{n}\right ) a b \,e^{2} n -6 x^{2} a b \,e^{2} n^{2}+2 d e \,b^{2} \ln \left (c \,x^{n}\right )^{3} x +6 \ln \left (x \right ) x \,a^{2} d e n +3 x^{2} a^{2} e^{2} n +6 d e a b \ln \left (c \,x^{n}\right )^{2} x -3 \ln \left (c \,x^{n}\right )^{2} b^{2} d^{2} n -6 \ln \left (c \,x^{n}\right ) b^{2} d^{2} n^{2}-6 b^{2} d^{2} n^{3}-6 \ln \left (c \,x^{n}\right ) a b \,d^{2} n -6 a b \,d^{2} n^{2}-3 a^{2} d^{2} n}{3 x n}\) | \(226\) |
risch | \(\text {Expression too large to display}\) | \(2521\) |
Input:
int((e*x+d)^2*(a+b*ln(c*x^n))^2/x^2,x,method=_RETURNVERBOSE)
Output:
1/3/x*(3*x^2*ln(c*x^n)^2*b^2*e^2*n-6*x^2*ln(c*x^n)*b^2*e^2*n^2+6*x^2*b^2*e ^2*n^3+6*x^2*ln(c*x^n)*a*b*e^2*n-6*x^2*a*b*e^2*n^2+2*d*e*b^2*ln(c*x^n)^3*x +6*ln(x)*x*a^2*d*e*n+3*x^2*a^2*e^2*n+6*d*e*a*b*ln(c*x^n)^2*x-3*ln(c*x^n)^2 *b^2*d^2*n-6*ln(c*x^n)*b^2*d^2*n^2-6*b^2*d^2*n^3-6*ln(c*x^n)*a*b*d^2*n-6*a *b*d^2*n^2-3*a^2*d^2*n)/n
Leaf count of result is larger than twice the leaf count of optimal. 291 vs. \(2 (131) = 262\).
Time = 0.08 (sec) , antiderivative size = 291, normalized size of antiderivative = 2.19 \[ \int \frac {(d+e x)^2 \left (a+b \log \left (c x^n\right )\right )^2}{x^2} \, dx=\frac {2 \, b^{2} d e n^{2} x \log \left (x\right )^{3} - 6 \, b^{2} d^{2} n^{2} - 6 \, a b d^{2} n - 3 \, a^{2} d^{2} + 3 \, {\left (2 \, b^{2} e^{2} n^{2} - 2 \, a b e^{2} n + a^{2} e^{2}\right )} x^{2} + 3 \, {\left (b^{2} e^{2} x^{2} - b^{2} d^{2}\right )} \log \left (c\right )^{2} + 3 \, {\left (b^{2} e^{2} n^{2} x^{2} + 2 \, b^{2} d e n x \log \left (c\right ) - b^{2} d^{2} n^{2} + 2 \, a b d e n x\right )} \log \left (x\right )^{2} - 6 \, {\left (b^{2} d^{2} n + a b d^{2} + {\left (b^{2} e^{2} n - a b e^{2}\right )} x^{2}\right )} \log \left (c\right ) + 6 \, {\left (b^{2} d e x \log \left (c\right )^{2} - b^{2} d^{2} n^{2} - a b d^{2} n + a^{2} d e x - {\left (b^{2} e^{2} n^{2} - a b e^{2} n\right )} x^{2} + {\left (b^{2} e^{2} n x^{2} - b^{2} d^{2} n + 2 \, a b d e x\right )} \log \left (c\right )\right )} \log \left (x\right )}{3 \, x} \] Input:
integrate((e*x+d)^2*(a+b*log(c*x^n))^2/x^2,x, algorithm="fricas")
Output:
1/3*(2*b^2*d*e*n^2*x*log(x)^3 - 6*b^2*d^2*n^2 - 6*a*b*d^2*n - 3*a^2*d^2 + 3*(2*b^2*e^2*n^2 - 2*a*b*e^2*n + a^2*e^2)*x^2 + 3*(b^2*e^2*x^2 - b^2*d^2)* log(c)^2 + 3*(b^2*e^2*n^2*x^2 + 2*b^2*d*e*n*x*log(c) - b^2*d^2*n^2 + 2*a*b *d*e*n*x)*log(x)^2 - 6*(b^2*d^2*n + a*b*d^2 + (b^2*e^2*n - a*b*e^2)*x^2)*l og(c) + 6*(b^2*d*e*x*log(c)^2 - b^2*d^2*n^2 - a*b*d^2*n + a^2*d*e*x - (b^2 *e^2*n^2 - a*b*e^2*n)*x^2 + (b^2*e^2*n*x^2 - b^2*d^2*n + 2*a*b*d*e*x)*log( c))*log(x))/x
Time = 0.64 (sec) , antiderivative size = 255, normalized size of antiderivative = 1.92 \[ \int \frac {(d+e x)^2 \left (a+b \log \left (c x^n\right )\right )^2}{x^2} \, dx=\begin {cases} - \frac {a^{2} d^{2}}{x} + \frac {2 a^{2} d e \log {\left (c x^{n} \right )}}{n} + a^{2} e^{2} x - \frac {2 a b d^{2} n}{x} - \frac {2 a b d^{2} \log {\left (c x^{n} \right )}}{x} + \frac {2 a b d e \log {\left (c x^{n} \right )}^{2}}{n} - 2 a b e^{2} n x + 2 a b e^{2} x \log {\left (c x^{n} \right )} - \frac {2 b^{2} d^{2} n^{2}}{x} - \frac {2 b^{2} d^{2} n \log {\left (c x^{n} \right )}}{x} - \frac {b^{2} d^{2} \log {\left (c x^{n} \right )}^{2}}{x} + \frac {2 b^{2} d e \log {\left (c x^{n} \right )}^{3}}{3 n} + 2 b^{2} e^{2} n^{2} x - 2 b^{2} e^{2} n x \log {\left (c x^{n} \right )} + b^{2} e^{2} x \log {\left (c x^{n} \right )}^{2} & \text {for}\: n \neq 0 \\\left (a + b \log {\left (c \right )}\right )^{2} \left (- \frac {d^{2}}{x} + 2 d e \log {\left (x \right )} + e^{2} x\right ) & \text {otherwise} \end {cases} \] Input:
integrate((e*x+d)**2*(a+b*ln(c*x**n))**2/x**2,x)
Output:
Piecewise((-a**2*d**2/x + 2*a**2*d*e*log(c*x**n)/n + a**2*e**2*x - 2*a*b*d **2*n/x - 2*a*b*d**2*log(c*x**n)/x + 2*a*b*d*e*log(c*x**n)**2/n - 2*a*b*e* *2*n*x + 2*a*b*e**2*x*log(c*x**n) - 2*b**2*d**2*n**2/x - 2*b**2*d**2*n*log (c*x**n)/x - b**2*d**2*log(c*x**n)**2/x + 2*b**2*d*e*log(c*x**n)**3/(3*n) + 2*b**2*e**2*n**2*x - 2*b**2*e**2*n*x*log(c*x**n) + b**2*e**2*x*log(c*x** n)**2, Ne(n, 0)), ((a + b*log(c))**2*(-d**2/x + 2*d*e*log(x) + e**2*x), Tr ue))
Time = 0.04 (sec) , antiderivative size = 200, normalized size of antiderivative = 1.50 \[ \int \frac {(d+e x)^2 \left (a+b \log \left (c x^n\right )\right )^2}{x^2} \, dx=b^{2} e^{2} x \log \left (c x^{n}\right )^{2} - 2 \, a b e^{2} n x + 2 \, a b e^{2} x \log \left (c x^{n}\right ) + \frac {2 \, b^{2} d e \log \left (c x^{n}\right )^{3}}{3 \, n} + 2 \, {\left (n^{2} x - n x \log \left (c x^{n}\right )\right )} b^{2} e^{2} - 2 \, b^{2} d^{2} {\left (\frac {n^{2}}{x} + \frac {n \log \left (c x^{n}\right )}{x}\right )} + a^{2} e^{2} x + \frac {2 \, a b d e \log \left (c x^{n}\right )^{2}}{n} - \frac {b^{2} d^{2} \log \left (c x^{n}\right )^{2}}{x} + 2 \, a^{2} d e \log \left (x\right ) - \frac {2 \, a b d^{2} n}{x} - \frac {2 \, a b d^{2} \log \left (c x^{n}\right )}{x} - \frac {a^{2} d^{2}}{x} \] Input:
integrate((e*x+d)^2*(a+b*log(c*x^n))^2/x^2,x, algorithm="maxima")
Output:
b^2*e^2*x*log(c*x^n)^2 - 2*a*b*e^2*n*x + 2*a*b*e^2*x*log(c*x^n) + 2/3*b^2* d*e*log(c*x^n)^3/n + 2*(n^2*x - n*x*log(c*x^n))*b^2*e^2 - 2*b^2*d^2*(n^2/x + n*log(c*x^n)/x) + a^2*e^2*x + 2*a*b*d*e*log(c*x^n)^2/n - b^2*d^2*log(c* x^n)^2/x + 2*a^2*d*e*log(x) - 2*a*b*d^2*n/x - 2*a*b*d^2*log(c*x^n)/x - a^2 *d^2/x
Leaf count of result is larger than twice the leaf count of optimal. 274 vs. \(2 (131) = 262\).
Time = 0.14 (sec) , antiderivative size = 274, normalized size of antiderivative = 2.06 \[ \int \frac {(d+e x)^2 \left (a+b \log \left (c x^n\right )\right )^2}{x^2} \, dx=\frac {2}{3} \, b^{2} d e n^{2} \log \left (x\right )^{3} + 2 \, b^{2} d e n \log \left (c\right ) \log \left (x\right )^{2} + {\left (x \log \left (x\right )^{2} - 2 \, x \log \left (x\right ) + 2 \, x\right )} b^{2} e^{2} n^{2} - b^{2} d^{2} n^{2} {\left (\frac {\log \left (x\right )^{2}}{x} + \frac {2 \, \log \left (x\right )}{x} + \frac {2}{x}\right )} + 2 \, {\left (x \log \left (x\right ) - x\right )} b^{2} e^{2} n \log \left (c\right ) - 2 \, b^{2} d^{2} n {\left (\frac {\log \left (x\right )}{x} + \frac {1}{x}\right )} \log \left (c\right ) + b^{2} e^{2} x \log \left (c\right )^{2} + 2 \, a b d e n \log \left (x\right )^{2} + 2 \, b^{2} d e \log \left (c\right )^{2} \log \left ({\left | x \right |}\right ) + 2 \, {\left (x \log \left (x\right ) - x\right )} a b e^{2} n - 2 \, a b d^{2} n {\left (\frac {\log \left (x\right )}{x} + \frac {1}{x}\right )} + 2 \, a b e^{2} x \log \left (c\right ) + 4 \, a b d e \log \left (c\right ) \log \left ({\left | x \right |}\right ) + a^{2} e^{2} x - \frac {b^{2} d^{2} \log \left (c\right )^{2}}{x} + 2 \, a^{2} d e \log \left ({\left | x \right |}\right ) - \frac {2 \, a b d^{2} \log \left (c\right )}{x} - \frac {a^{2} d^{2}}{x} \] Input:
integrate((e*x+d)^2*(a+b*log(c*x^n))^2/x^2,x, algorithm="giac")
Output:
2/3*b^2*d*e*n^2*log(x)^3 + 2*b^2*d*e*n*log(c)*log(x)^2 + (x*log(x)^2 - 2*x *log(x) + 2*x)*b^2*e^2*n^2 - b^2*d^2*n^2*(log(x)^2/x + 2*log(x)/x + 2/x) + 2*(x*log(x) - x)*b^2*e^2*n*log(c) - 2*b^2*d^2*n*(log(x)/x + 1/x)*log(c) + b^2*e^2*x*log(c)^2 + 2*a*b*d*e*n*log(x)^2 + 2*b^2*d*e*log(c)^2*log(abs(x) ) + 2*(x*log(x) - x)*a*b*e^2*n - 2*a*b*d^2*n*(log(x)/x + 1/x) + 2*a*b*e^2* x*log(c) + 4*a*b*d*e*log(c)*log(abs(x)) + a^2*e^2*x - b^2*d^2*log(c)^2/x + 2*a^2*d*e*log(abs(x)) - 2*a*b*d^2*log(c)/x - a^2*d^2/x
Time = 26.90 (sec) , antiderivative size = 228, normalized size of antiderivative = 1.71 \[ \int \frac {(d+e x)^2 \left (a+b \log \left (c x^n\right )\right )^2}{x^2} \, dx=\ln \left (x\right )\,\left (2\,d\,e\,a^2+4\,d\,e\,a\,b\,n+4\,d\,e\,b^2\,n^2\right )-\frac {a^2\,d^2+2\,a\,b\,d^2\,n+2\,b^2\,d^2\,n^2}{x}-\ln \left (c\,x^n\right )\,\left (\frac {2\,b\,\left (a+b\,n\right )\,d^2+4\,b\,\left (a+b\,n\right )\,d\,e\,x+2\,b\,\left (a-b\,n\right )\,e^2\,x^2}{x}-4\,b\,e^2\,x\,\left (a-b\,n\right )\right )+{\ln \left (c\,x^n\right )}^2\,\left (2\,b^2\,e^2\,x-\frac {b^2\,d^2+2\,b^2\,d\,e\,x+b^2\,e^2\,x^2}{x}+\frac {2\,b\,d\,e\,\left (a+b\,n\right )}{n}\right )+e^2\,x\,\left (a^2-2\,a\,b\,n+2\,b^2\,n^2\right )+\frac {2\,b^2\,d\,e\,{\ln \left (c\,x^n\right )}^3}{3\,n} \] Input:
int(((a + b*log(c*x^n))^2*(d + e*x)^2)/x^2,x)
Output:
log(x)*(2*a^2*d*e + 4*b^2*d*e*n^2 + 4*a*b*d*e*n) - (a^2*d^2 + 2*b^2*d^2*n^ 2 + 2*a*b*d^2*n)/x - log(c*x^n)*((2*b*d^2*(a + b*n) + 2*b*e^2*x^2*(a - b*n ) + 4*b*d*e*x*(a + b*n))/x - 4*b*e^2*x*(a - b*n)) + log(c*x^n)^2*(2*b^2*e^ 2*x - (b^2*d^2 + b^2*e^2*x^2 + 2*b^2*d*e*x)/x + (2*b*d*e*(a + b*n))/n) + e ^2*x*(a^2 + 2*b^2*n^2 - 2*a*b*n) + (2*b^2*d*e*log(c*x^n)^3)/(3*n)
Time = 0.17 (sec) , antiderivative size = 225, normalized size of antiderivative = 1.69 \[ \int \frac {(d+e x)^2 \left (a+b \log \left (c x^n\right )\right )^2}{x^2} \, dx=\frac {2 \mathrm {log}\left (x^{n} c \right )^{3} b^{2} d e x +6 \mathrm {log}\left (x^{n} c \right )^{2} a b d e x -3 \mathrm {log}\left (x^{n} c \right )^{2} b^{2} d^{2} n +3 \mathrm {log}\left (x^{n} c \right )^{2} b^{2} e^{2} n \,x^{2}-6 \,\mathrm {log}\left (x^{n} c \right ) a b \,d^{2} n +6 \,\mathrm {log}\left (x^{n} c \right ) a b \,e^{2} n \,x^{2}-6 \,\mathrm {log}\left (x^{n} c \right ) b^{2} d^{2} n^{2}-6 \,\mathrm {log}\left (x^{n} c \right ) b^{2} e^{2} n^{2} x^{2}+6 \,\mathrm {log}\left (x \right ) a^{2} d e n x -3 a^{2} d^{2} n +3 a^{2} e^{2} n \,x^{2}-6 a b \,d^{2} n^{2}-6 a b \,e^{2} n^{2} x^{2}-6 b^{2} d^{2} n^{3}+6 b^{2} e^{2} n^{3} x^{2}}{3 n x} \] Input:
int((e*x+d)^2*(a+b*log(c*x^n))^2/x^2,x)
Output:
(2*log(x**n*c)**3*b**2*d*e*x + 6*log(x**n*c)**2*a*b*d*e*x - 3*log(x**n*c)* *2*b**2*d**2*n + 3*log(x**n*c)**2*b**2*e**2*n*x**2 - 6*log(x**n*c)*a*b*d** 2*n + 6*log(x**n*c)*a*b*e**2*n*x**2 - 6*log(x**n*c)*b**2*d**2*n**2 - 6*log (x**n*c)*b**2*e**2*n**2*x**2 + 6*log(x)*a**2*d*e*n*x - 3*a**2*d**2*n + 3*a **2*e**2*n*x**2 - 6*a*b*d**2*n**2 - 6*a*b*e**2*n**2*x**2 - 6*b**2*d**2*n** 3 + 6*b**2*e**2*n**3*x**2)/(3*n*x)