3.15.3 \(\int \frac {315-105 x-140 x^2+(-420 x+140 x^2+140 x^3) \log (9-6 x+x^2)+(105 x^2-35 x^3) \log ^2(9-6 x+x^2)}{-3 x^4+x^5} \, dx\) [1403]

Optimal. Leaf size=21 \[ \frac {35 \left (\frac {1}{x}-\log \left ((3-x)^2\right )\right )^2}{x} \]

[Out]

35/x*(1/x-ln((3-x)^2))^2

________________________________________________________________________________________

Rubi [B] Leaf count is larger than twice the leaf count of optimal. \(49\) vs. \(2(21)=42\).
time = 0.26, antiderivative size = 49, normalized size of antiderivative = 2.33, number of steps used = 17, number of rules used = 11, integrand size = 69, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.159, Rules used = {1607, 6874, 907, 2465, 2437, 2338, 2442, 46, 2441, 2352, 2444} \begin {gather*} \frac {35}{x^3}-\frac {70 \log \left ((x-3)^2\right )}{x^2}+\frac {35 (3-x) \log ^2\left ((x-3)^2\right )}{3 x}+\frac {35}{3} \log ^2\left ((x-3)^2\right ) \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(315 - 105*x - 140*x^2 + (-420*x + 140*x^2 + 140*x^3)*Log[9 - 6*x + x^2] + (105*x^2 - 35*x^3)*Log[9 - 6*x
+ x^2]^2)/(-3*x^4 + x^5),x]

[Out]

35/x^3 - (70*Log[(-3 + x)^2])/x^2 + (35*Log[(-3 + x)^2]^2)/3 + (35*(3 - x)*Log[(-3 + x)^2]^2)/(3*x)

Rule 46

Int[((a_) + (b_.)*(x_))^(m_)*((c_.) + (d_.)*(x_))^(n_.), x_Symbol] :> Int[ExpandIntegrand[(a + b*x)^m*(c + d*x
)^n, x], x] /; FreeQ[{a, b, c, d}, x] && NeQ[b*c - a*d, 0] && ILtQ[m, 0] && IntegerQ[n] &&  !(IGtQ[n, 0] && Lt
Q[m + n + 2, 0])

Rule 907

Int[((d_.) + (e_.)*(x_))^(m_)*((f_.) + (g_.)*(x_))^(n_)*((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(p_.), x_Symbol] :
> Int[ExpandIntegrand[(d + e*x)^m*(f + g*x)^n*(a + b*x + c*x^2)^p, x], x] /; FreeQ[{a, b, c, d, e, f, g}, x] &
& NeQ[e*f - d*g, 0] && NeQ[b^2 - 4*a*c, 0] && NeQ[c*d^2 - b*d*e + a*e^2, 0] && IntegerQ[p] && ((EqQ[p, 1] && I
ntegersQ[m, n]) || (ILtQ[m, 0] && ILtQ[n, 0]))

Rule 1607

Int[(u_.)*((a_.)*(x_)^(p_.) + (b_.)*(x_)^(q_.))^(n_.), x_Symbol] :> Int[u*x^(n*p)*(a + b*x^(q - p))^n, x] /; F
reeQ[{a, b, p, q}, x] && IntegerQ[n] && PosQ[q - p]

Rule 2338

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))/(x_), x_Symbol] :> Simp[(a + b*Log[c*x^n])^2/(2*b*n), x] /; FreeQ[{a
, b, c, n}, x]

Rule 2352

Int[Log[(c_.)*(x_)]/((d_) + (e_.)*(x_)), x_Symbol] :> Simp[(-e^(-1))*PolyLog[2, 1 - c*x], x] /; FreeQ[{c, d, e
}, x] && EqQ[e + c*d, 0]

Rule 2437

Int[((a_.) + Log[(c_.)*((d_) + (e_.)*(x_))^(n_.)]*(b_.))^(p_.)*((f_) + (g_.)*(x_))^(q_.), x_Symbol] :> Dist[1/
e, Subst[Int[(f*(x/d))^q*(a + b*Log[c*x^n])^p, x], x, d + e*x], x] /; FreeQ[{a, b, c, d, e, f, g, n, p, q}, x]
 && EqQ[e*f - d*g, 0]

Rule 2441

Int[((a_.) + Log[(c_.)*((d_) + (e_.)*(x_))^(n_.)]*(b_.))/((f_.) + (g_.)*(x_)), x_Symbol] :> Simp[Log[e*((f + g
*x)/(e*f - d*g))]*((a + b*Log[c*(d + e*x)^n])/g), x] - Dist[b*e*(n/g), Int[Log[(e*(f + g*x))/(e*f - d*g)]/(d +
 e*x), x], x] /; FreeQ[{a, b, c, d, e, f, g, n}, x] && NeQ[e*f - d*g, 0]

Rule 2442

Int[((a_.) + Log[(c_.)*((d_) + (e_.)*(x_))^(n_.)]*(b_.))*((f_.) + (g_.)*(x_))^(q_.), x_Symbol] :> Simp[(f + g*
x)^(q + 1)*((a + b*Log[c*(d + e*x)^n])/(g*(q + 1))), x] - Dist[b*e*(n/(g*(q + 1))), Int[(f + g*x)^(q + 1)/(d +
 e*x), x], x] /; FreeQ[{a, b, c, d, e, f, g, n, q}, x] && NeQ[e*f - d*g, 0] && NeQ[q, -1]

Rule 2444

Int[((a_.) + Log[(c_.)*((d_) + (e_.)*(x_))^(n_.)]*(b_.))^(p_)/((f_.) + (g_.)*(x_))^2, x_Symbol] :> Simp[(d + e
*x)*((a + b*Log[c*(d + e*x)^n])^p/((e*f - d*g)*(f + g*x))), x] - Dist[b*e*n*(p/(e*f - d*g)), Int[(a + b*Log[c*
(d + e*x)^n])^(p - 1)/(f + g*x), x], x] /; FreeQ[{a, b, c, d, e, f, g, n}, x] && NeQ[e*f - d*g, 0] && GtQ[p, 0
]

Rule 2465

Int[((a_.) + Log[(c_.)*((d_) + (e_.)*(x_))^(n_.)]*(b_.))^(p_.)*(RFx_), x_Symbol] :> 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] && RationalFunct
ionQ[RFx, x] && IntegerQ[p]

Rule 6874

Int[u_, x_Symbol] :> With[{v = ExpandIntegrand[u, x]}, Int[v, x] /; SumQ[v]]

Rubi steps

\begin {gather*} \begin {aligned} \text {integral} &=\int \frac {315-105 x-140 x^2+\left (-420 x+140 x^2+140 x^3\right ) \log \left (9-6 x+x^2\right )+\left (105 x^2-35 x^3\right ) \log ^2\left (9-6 x+x^2\right )}{(-3+x) x^4} \, dx\\ &=\int \left (-\frac {35 \left (-9+3 x+4 x^2\right )}{(-3+x) x^4}+\frac {140 \left (-3+x+x^2\right ) \log \left ((-3+x)^2\right )}{(-3+x) x^3}-\frac {35 \log ^2\left ((-3+x)^2\right )}{x^2}\right ) \, dx\\ &=-\left (35 \int \frac {-9+3 x+4 x^2}{(-3+x) x^4} \, dx\right )-35 \int \frac {\log ^2\left ((-3+x)^2\right )}{x^2} \, dx+140 \int \frac {\left (-3+x+x^2\right ) \log \left ((-3+x)^2\right )}{(-3+x) x^3} \, dx\\ &=\frac {35 (3-x) \log ^2\left ((-3+x)^2\right )}{3 x}-35 \int \left (\frac {4}{9 (-3+x)}+\frac {3}{x^4}-\frac {4}{3 x^2}-\frac {4}{9 x}\right ) \, dx+\frac {140}{3} \int \frac {\log \left ((-3+x)^2\right )}{x} \, dx+140 \int \left (\frac {\log \left ((-3+x)^2\right )}{3 (-3+x)}+\frac {\log \left ((-3+x)^2\right )}{x^3}-\frac {\log \left ((-3+x)^2\right )}{3 x}\right ) \, dx\\ &=\frac {35}{x^3}-\frac {140}{3 x}-\frac {140}{9} \log (3-x)+\frac {35 (3-x) \log ^2\left ((-3+x)^2\right )}{3 x}+\frac {140}{3} \log \left ((-3+x)^2\right ) \log \left (\frac {x}{3}\right )+\frac {140 \log (x)}{9}+\frac {140}{3} \int \frac {\log \left ((-3+x)^2\right )}{-3+x} \, dx-\frac {140}{3} \int \frac {\log \left ((-3+x)^2\right )}{x} \, dx-\frac {280}{3} \int \frac {\log \left (\frac {x}{3}\right )}{-3+x} \, dx+140 \int \frac {\log \left ((-3+x)^2\right )}{x^3} \, dx\\ &=\frac {35}{x^3}-\frac {140}{3 x}-\frac {140}{9} \log (3-x)-\frac {70 \log \left ((-3+x)^2\right )}{x^2}+\frac {35 (3-x) \log ^2\left ((-3+x)^2\right )}{3 x}+\frac {140 \log (x)}{9}+\frac {280}{3} \text {Li}_2\left (1-\frac {x}{3}\right )+\frac {140}{3} \text {Subst}\left (\int \frac {\log \left (x^2\right )}{x} \, dx,x,-3+x\right )+\frac {280}{3} \int \frac {\log \left (\frac {x}{3}\right )}{-3+x} \, dx+140 \int \frac {1}{(-3+x) x^2} \, dx\\ &=\frac {35}{x^3}-\frac {140}{3 x}-\frac {140}{9} \log (3-x)-\frac {70 \log \left ((-3+x)^2\right )}{x^2}+\frac {35}{3} \log ^2\left ((-3+x)^2\right )+\frac {35 (3-x) \log ^2\left ((-3+x)^2\right )}{3 x}+\frac {140 \log (x)}{9}+140 \int \left (\frac {1}{9 (-3+x)}-\frac {1}{3 x^2}-\frac {1}{9 x}\right ) \, dx\\ &=\frac {35}{x^3}-\frac {70 \log \left ((-3+x)^2\right )}{x^2}+\frac {35}{3} \log ^2\left ((-3+x)^2\right )+\frac {35 (3-x) \log ^2\left ((-3+x)^2\right )}{3 x}\\ \end {aligned} \end {gather*}

________________________________________________________________________________________

Mathematica [A]
time = 0.06, size = 32, normalized size = 1.52 \begin {gather*} -35 \left (-\frac {1}{x^3}+\frac {2 \log \left ((-3+x)^2\right )}{x^2}-\frac {\log ^2\left ((-3+x)^2\right )}{x}\right ) \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[(315 - 105*x - 140*x^2 + (-420*x + 140*x^2 + 140*x^3)*Log[9 - 6*x + x^2] + (105*x^2 - 35*x^3)*Log[9
- 6*x + x^2]^2)/(-3*x^4 + x^5),x]

[Out]

-35*(-x^(-3) + (2*Log[(-3 + x)^2])/x^2 - Log[(-3 + x)^2]^2/x)

________________________________________________________________________________________

Maple [A]
time = 0.13, size = 35, normalized size = 1.67

method result size
norman \(\frac {35-70 \ln \left (x^{2}-6 x +9\right ) x +35 \ln \left (x^{2}-6 x +9\right )^{2} x^{2}}{x^{3}}\) \(35\)
risch \(\frac {35 \ln \left (x^{2}-6 x +9\right )^{2}}{x}-\frac {70 \ln \left (x^{2}-6 x +9\right )}{x^{2}}+\frac {35}{x^{3}}\) \(37\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(((-35*x^3+105*x^2)*ln(x^2-6*x+9)^2+(140*x^3+140*x^2-420*x)*ln(x^2-6*x+9)-140*x^2-105*x+315)/(x^5-3*x^4),x,
method=_RETURNVERBOSE)

[Out]

(35-70*ln(x^2-6*x+9)*x+35*ln(x^2-6*x+9)^2*x^2)/x^3

________________________________________________________________________________________

Maxima [B] Leaf count of result is larger than twice the leaf count of optimal. 65 vs. \(2 (19) = 38\).
time = 0.29, size = 65, normalized size = 3.10 \begin {gather*} \frac {140 \, {\left (9 \, x \log \left (x - 3\right )^{2} + {\left (x^{2} - 9\right )} \log \left (x - 3\right ) + 3 \, x\right )}}{9 \, x^{2}} - \frac {35 \, {\left (2 \, x + 3\right )}}{6 \, x^{2}} - \frac {140}{3 \, x} + \frac {35 \, {\left (2 \, x^{2} + 3 \, x + 6\right )}}{6 \, x^{3}} - \frac {140}{9} \, \log \left (x - 3\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(((-35*x^3+105*x^2)*log(x^2-6*x+9)^2+(140*x^3+140*x^2-420*x)*log(x^2-6*x+9)-140*x^2-105*x+315)/(x^5-3
*x^4),x, algorithm="maxima")

[Out]

140/9*(9*x*log(x - 3)^2 + (x^2 - 9)*log(x - 3) + 3*x)/x^2 - 35/6*(2*x + 3)/x^2 - 140/3/x + 35/6*(2*x^2 + 3*x +
 6)/x^3 - 140/9*log(x - 3)

________________________________________________________________________________________

Fricas [A]
time = 0.34, size = 34, normalized size = 1.62 \begin {gather*} \frac {35 \, {\left (x^{2} \log \left (x^{2} - 6 \, x + 9\right )^{2} - 2 \, x \log \left (x^{2} - 6 \, x + 9\right ) + 1\right )}}{x^{3}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(((-35*x^3+105*x^2)*log(x^2-6*x+9)^2+(140*x^3+140*x^2-420*x)*log(x^2-6*x+9)-140*x^2-105*x+315)/(x^5-3
*x^4),x, algorithm="fricas")

[Out]

35*(x^2*log(x^2 - 6*x + 9)^2 - 2*x*log(x^2 - 6*x + 9) + 1)/x^3

________________________________________________________________________________________

Sympy [B] Leaf count of result is larger than twice the leaf count of optimal. 34 vs. \(2 (14) = 28\).
time = 0.08, size = 34, normalized size = 1.62 \begin {gather*} \frac {35 \log {\left (x^{2} - 6 x + 9 \right )}^{2}}{x} - \frac {70 \log {\left (x^{2} - 6 x + 9 \right )}}{x^{2}} + \frac {35}{x^{3}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(((-35*x**3+105*x**2)*ln(x**2-6*x+9)**2+(140*x**3+140*x**2-420*x)*ln(x**2-6*x+9)-140*x**2-105*x+315)/
(x**5-3*x**4),x)

[Out]

35*log(x**2 - 6*x + 9)**2/x - 70*log(x**2 - 6*x + 9)/x**2 + 35/x**3

________________________________________________________________________________________

Giac [A]
time = 0.42, size = 36, normalized size = 1.71 \begin {gather*} \frac {35 \, \log \left (x^{2} - 6 \, x + 9\right )^{2}}{x} - \frac {70 \, \log \left (x^{2} - 6 \, x + 9\right )}{x^{2}} + \frac {35}{x^{3}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(((-35*x^3+105*x^2)*log(x^2-6*x+9)^2+(140*x^3+140*x^2-420*x)*log(x^2-6*x+9)-140*x^2-105*x+315)/(x^5-3
*x^4),x, algorithm="giac")

[Out]

35*log(x^2 - 6*x + 9)^2/x - 70*log(x^2 - 6*x + 9)/x^2 + 35/x^3

________________________________________________________________________________________

Mupad [B]
time = 1.11, size = 20, normalized size = 0.95 \begin {gather*} \frac {35\,{\left (x\,\ln \left (x^2-6\,x+9\right )-1\right )}^2}{x^3} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(-(log(x^2 - 6*x + 9)^2*(105*x^2 - 35*x^3) - 105*x + log(x^2 - 6*x + 9)*(140*x^2 - 420*x + 140*x^3) - 140*x
^2 + 315)/(3*x^4 - x^5),x)

[Out]

(35*(x*log(x^2 - 6*x + 9) - 1)^2)/x^3

________________________________________________________________________________________