3.43.61 \(\int \frac {2-4 x+6 x^2-2 x^3+x^4+(4-4 x+5 x^2-2 x^3+x^4) \log (x)}{4-4 x+5 x^2-2 x^3+x^4} \, dx\)

Optimal. Leaf size=25 \[ -2+\frac {x}{-x+\frac {x}{\frac {2}{x}+x}}+x \log (x) \]

________________________________________________________________________________________

Rubi [B]  time = 0.31, antiderivative size = 119, normalized size of antiderivative = 4.76, number of steps used = 26, number of rules used = 13, integrand size = 60, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.217, Rules used = {6688, 6742, 614, 618, 204, 638, 722, 738, 773, 634, 628, 800, 2295} \begin {gather*} \frac {2 (4-x) x^2}{7 \left (x^2-x+2\right )}-\frac {x^2}{7}-\frac {6 (4-x) x}{7 \left (x^2-x+2\right )}-\frac {2 (1-2 x)}{7 \left (x^2-x+2\right )}+\frac {4 (4-x)}{7 \left (x^2-x+2\right )}-\frac {(4-x) x^3}{7 \left (x^2-x+2\right )}+\frac {5 x}{7}+x \log (x) \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(2 - 4*x + 6*x^2 - 2*x^3 + x^4 + (4 - 4*x + 5*x^2 - 2*x^3 + x^4)*Log[x])/(4 - 4*x + 5*x^2 - 2*x^3 + x^4),x
]

[Out]

(5*x)/7 - x^2/7 - (2*(1 - 2*x))/(7*(2 - x + x^2)) + (4*(4 - x))/(7*(2 - x + x^2)) - (6*(4 - x)*x)/(7*(2 - x +
x^2)) + (2*(4 - x)*x^2)/(7*(2 - x + x^2)) - ((4 - x)*x^3)/(7*(2 - x + x^2)) + x*Log[x]

Rule 204

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> -Simp[ArcTan[(Rt[-b, 2]*x)/Rt[-a, 2]]/(Rt[-a, 2]*Rt[-b, 2]), x] /
; FreeQ[{a, b}, x] && PosQ[a/b] && (LtQ[a, 0] || LtQ[b, 0])

Rule 614

Int[((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(p_), x_Symbol] :> Simp[((b + 2*c*x)*(a + b*x + c*x^2)^(p + 1))/((p +
1)*(b^2 - 4*a*c)), x] - Dist[(2*c*(2*p + 3))/((p + 1)*(b^2 - 4*a*c)), Int[(a + b*x + c*x^2)^(p + 1), x], x] /;
 FreeQ[{a, b, c}, x] && NeQ[b^2 - 4*a*c, 0] && LtQ[p, -1] && NeQ[p, -3/2] && IntegerQ[4*p]

Rule 618

Int[((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(-1), x_Symbol] :> Dist[-2, Subst[Int[1/Simp[b^2 - 4*a*c - x^2, x], x]
, x, b + 2*c*x], x] /; FreeQ[{a, b, c}, x] && NeQ[b^2 - 4*a*c, 0]

Rule 628

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

Rule 634

Int[((d_.) + (e_.)*(x_))/((a_) + (b_.)*(x_) + (c_.)*(x_)^2), x_Symbol] :> Dist[(2*c*d - b*e)/(2*c), Int[1/(a +
 b*x + c*x^2), x], x] + Dist[e/(2*c), Int[(b + 2*c*x)/(a + b*x + c*x^2), x], x] /; FreeQ[{a, b, c, d, e}, x] &
& NeQ[2*c*d - b*e, 0] && NeQ[b^2 - 4*a*c, 0] &&  !NiceSqrtQ[b^2 - 4*a*c]

Rule 638

Int[((d_.) + (e_.)*(x_))*((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(p_), x_Symbol] :> Simp[((b*d - 2*a*e + (2*c*d -
b*e)*x)*(a + b*x + c*x^2)^(p + 1))/((p + 1)*(b^2 - 4*a*c)), x] - Dist[((2*p + 3)*(2*c*d - b*e))/((p + 1)*(b^2
- 4*a*c)), Int[(a + b*x + c*x^2)^(p + 1), x], x] /; FreeQ[{a, b, c, d, e}, x] && NeQ[2*c*d - b*e, 0] && NeQ[b^
2 - 4*a*c, 0] && LtQ[p, -1] && NeQ[p, -3/2]

Rule 722

Int[((d_.) + (e_.)*(x_))^(m_)*((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(p_), x_Symbol] :> Simp[((d + e*x)^(m - 1)*(
d*b - 2*a*e + (2*c*d - b*e)*x)*(a + b*x + c*x^2)^(p + 1))/((p + 1)*(b^2 - 4*a*c)), x] - Dist[(2*(2*p + 3)*(c*d
^2 - b*d*e + a*e^2))/((p + 1)*(b^2 - 4*a*c)), Int[(d + e*x)^(m - 2)*(a + b*x + c*x^2)^(p + 1), x], x] /; FreeQ
[{a, b, c, d, e}, x] && NeQ[b^2 - 4*a*c, 0] && NeQ[c*d^2 - b*d*e + a*e^2, 0] && NeQ[2*c*d - b*e, 0] && EqQ[m +
 2*p + 2, 0] && LtQ[p, -1]

Rule 738

Int[((d_.) + (e_.)*(x_))^(m_)*((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(p_), x_Symbol] :> Simp[((d + e*x)^(m - 1)*(
d*b - 2*a*e + (2*c*d - b*e)*x)*(a + b*x + c*x^2)^(p + 1))/((p + 1)*(b^2 - 4*a*c)), x] + Dist[1/((p + 1)*(b^2 -
 4*a*c)), Int[(d + e*x)^(m - 2)*Simp[e*(2*a*e*(m - 1) + b*d*(2*p - m + 4)) - 2*c*d^2*(2*p + 3) + e*(b*e - 2*d*
c)*(m + 2*p + 2)*x, x]*(a + b*x + c*x^2)^(p + 1), x], x] /; FreeQ[{a, b, c, d, e}, x] && NeQ[b^2 - 4*a*c, 0] &
& NeQ[c*d^2 - b*d*e + a*e^2, 0] && NeQ[2*c*d - b*e, 0] && LtQ[p, -1] && GtQ[m, 1] && IntQuadraticQ[a, b, c, d,
 e, m, p, x]

Rule 773

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

Rule 800

Int[(((d_.) + (e_.)*(x_))^(m_)*((f_.) + (g_.)*(x_)))/((a_.) + (b_.)*(x_) + (c_.)*(x_)^2), x_Symbol] :> Int[Exp
andIntegrand[((d + e*x)^m*(f + g*x))/(a + b*x + c*x^2), x], x] /; FreeQ[{a, b, c, d, e, f, g}, x] && NeQ[b^2 -
 4*a*c, 0] && NeQ[c*d^2 - b*d*e + a*e^2, 0] && IntegerQ[m]

Rule 2295

Int[Log[(c_.)*(x_)^(n_.)], x_Symbol] :> Simp[x*Log[c*x^n], x] - Simp[n*x, x] /; FreeQ[{c, n}, x]

Rule 6688

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

Rule 6742

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

Rubi steps

\begin {gather*} \begin {aligned} \text {integral} &=\int \frac {2-4 x+6 x^2-2 x^3+x^4+\left (2-x+x^2\right )^2 \log (x)}{\left (2-x+x^2\right )^2} \, dx\\ &=\int \left (\frac {2}{\left (2-x+x^2\right )^2}-\frac {4 x}{\left (2-x+x^2\right )^2}+\frac {6 x^2}{\left (2-x+x^2\right )^2}-\frac {2 x^3}{\left (2-x+x^2\right )^2}+\frac {x^4}{\left (2-x+x^2\right )^2}+\log (x)\right ) \, dx\\ &=2 \int \frac {1}{\left (2-x+x^2\right )^2} \, dx-2 \int \frac {x^3}{\left (2-x+x^2\right )^2} \, dx-4 \int \frac {x}{\left (2-x+x^2\right )^2} \, dx+6 \int \frac {x^2}{\left (2-x+x^2\right )^2} \, dx+\int \frac {x^4}{\left (2-x+x^2\right )^2} \, dx+\int \log (x) \, dx\\ &=-x-\frac {2 (1-2 x)}{7 \left (2-x+x^2\right )}+\frac {4 (4-x)}{7 \left (2-x+x^2\right )}-\frac {6 (4-x) x}{7 \left (2-x+x^2\right )}+\frac {2 (4-x) x^2}{7 \left (2-x+x^2\right )}-\frac {(4-x) x^3}{7 \left (2-x+x^2\right )}+x \log (x)+\frac {1}{7} \int \frac {(12-2 x) x^2}{2-x+x^2} \, dx-\frac {2}{7} \int \frac {(8-x) x}{2-x+x^2} \, dx+\frac {24}{7} \int \frac {1}{2-x+x^2} \, dx\\ &=-\frac {5 x}{7}-\frac {2 (1-2 x)}{7 \left (2-x+x^2\right )}+\frac {4 (4-x)}{7 \left (2-x+x^2\right )}-\frac {6 (4-x) x}{7 \left (2-x+x^2\right )}+\frac {2 (4-x) x^2}{7 \left (2-x+x^2\right )}-\frac {(4-x) x^3}{7 \left (2-x+x^2\right )}+x \log (x)+\frac {1}{7} \int \left (10-2 x-\frac {2 (10-7 x)}{2-x+x^2}\right ) \, dx-\frac {2}{7} \int \frac {2+7 x}{2-x+x^2} \, dx-\frac {48}{7} \operatorname {Subst}\left (\int \frac {1}{-7-x^2} \, dx,x,-1+2 x\right )\\ &=\frac {5 x}{7}-\frac {x^2}{7}-\frac {2 (1-2 x)}{7 \left (2-x+x^2\right )}+\frac {4 (4-x)}{7 \left (2-x+x^2\right )}-\frac {6 (4-x) x}{7 \left (2-x+x^2\right )}+\frac {2 (4-x) x^2}{7 \left (2-x+x^2\right )}-\frac {(4-x) x^3}{7 \left (2-x+x^2\right )}-\frac {48 \tan ^{-1}\left (\frac {1-2 x}{\sqrt {7}}\right )}{7 \sqrt {7}}+x \log (x)-\frac {2}{7} \int \frac {10-7 x}{2-x+x^2} \, dx-\frac {11}{7} \int \frac {1}{2-x+x^2} \, dx-\int \frac {-1+2 x}{2-x+x^2} \, dx\\ &=\frac {5 x}{7}-\frac {x^2}{7}-\frac {2 (1-2 x)}{7 \left (2-x+x^2\right )}+\frac {4 (4-x)}{7 \left (2-x+x^2\right )}-\frac {6 (4-x) x}{7 \left (2-x+x^2\right )}+\frac {2 (4-x) x^2}{7 \left (2-x+x^2\right )}-\frac {(4-x) x^3}{7 \left (2-x+x^2\right )}-\frac {48 \tan ^{-1}\left (\frac {1-2 x}{\sqrt {7}}\right )}{7 \sqrt {7}}+x \log (x)-\log \left (2-x+x^2\right )-\frac {13}{7} \int \frac {1}{2-x+x^2} \, dx+\frac {22}{7} \operatorname {Subst}\left (\int \frac {1}{-7-x^2} \, dx,x,-1+2 x\right )+\int \frac {-1+2 x}{2-x+x^2} \, dx\\ &=\frac {5 x}{7}-\frac {x^2}{7}-\frac {2 (1-2 x)}{7 \left (2-x+x^2\right )}+\frac {4 (4-x)}{7 \left (2-x+x^2\right )}-\frac {6 (4-x) x}{7 \left (2-x+x^2\right )}+\frac {2 (4-x) x^2}{7 \left (2-x+x^2\right )}-\frac {(4-x) x^3}{7 \left (2-x+x^2\right )}-\frac {26 \tan ^{-1}\left (\frac {1-2 x}{\sqrt {7}}\right )}{7 \sqrt {7}}+x \log (x)+\frac {26}{7} \operatorname {Subst}\left (\int \frac {1}{-7-x^2} \, dx,x,-1+2 x\right )\\ &=\frac {5 x}{7}-\frac {x^2}{7}-\frac {2 (1-2 x)}{7 \left (2-x+x^2\right )}+\frac {4 (4-x)}{7 \left (2-x+x^2\right )}-\frac {6 (4-x) x}{7 \left (2-x+x^2\right )}+\frac {2 (4-x) x^2}{7 \left (2-x+x^2\right )}-\frac {(4-x) x^3}{7 \left (2-x+x^2\right )}+x \log (x)\\ \end {aligned} \end {gather*}

________________________________________________________________________________________

Mathematica [A]  time = 0.08, size = 15, normalized size = 0.60 \begin {gather*} x \left (\frac {1}{-2+x-x^2}+\log (x)\right ) \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[(2 - 4*x + 6*x^2 - 2*x^3 + x^4 + (4 - 4*x + 5*x^2 - 2*x^3 + x^4)*Log[x])/(4 - 4*x + 5*x^2 - 2*x^3 +
x^4),x]

[Out]

x*((-2 + x - x^2)^(-1) + Log[x])

________________________________________________________________________________________

fricas [A]  time = 0.70, size = 30, normalized size = 1.20 \begin {gather*} \frac {{\left (x^{3} - x^{2} + 2 \, x\right )} \log \relax (x) - x}{x^{2} - x + 2} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(((x^4-2*x^3+5*x^2-4*x+4)*log(x)+x^4-2*x^3+6*x^2-4*x+2)/(x^4-2*x^3+5*x^2-4*x+4),x, algorithm="fricas"
)

[Out]

((x^3 - x^2 + 2*x)*log(x) - x)/(x^2 - x + 2)

________________________________________________________________________________________

giac [A]  time = 0.20, size = 18, normalized size = 0.72 \begin {gather*} x \log \relax (x) - \frac {x}{x^{2} - x + 2} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(((x^4-2*x^3+5*x^2-4*x+4)*log(x)+x^4-2*x^3+6*x^2-4*x+2)/(x^4-2*x^3+5*x^2-4*x+4),x, algorithm="giac")

[Out]

x*log(x) - x/(x^2 - x + 2)

________________________________________________________________________________________

maple [A]  time = 0.03, size = 19, normalized size = 0.76




method result size



default \(-\frac {x}{x^{2}-x +2}+x \ln \relax (x )\) \(19\)
risch \(-\frac {x}{x^{2}-x +2}+x \ln \relax (x )\) \(19\)
norman \(\frac {x^{3} \ln \relax (x )-x +2 x \ln \relax (x )-x^{2} \ln \relax (x )}{x^{2}-x +2}\) \(34\)



Verification of antiderivative is not currently implemented for this CAS.

[In]

int(((x^4-2*x^3+5*x^2-4*x+4)*ln(x)+x^4-2*x^3+6*x^2-4*x+2)/(x^4-2*x^3+5*x^2-4*x+4),x,method=_RETURNVERBOSE)

[Out]

-x/(x^2-x+2)+x*ln(x)

________________________________________________________________________________________

maxima [B]  time = 0.62, size = 86, normalized size = 3.44 \begin {gather*} x \log \relax (x) + \frac {2 \, {\left (5 \, x - 6\right )}}{7 \, {\left (x^{2} - x + 2\right )}} - \frac {6 \, {\left (3 \, x + 2\right )}}{7 \, {\left (x^{2} - x + 2\right )}} + \frac {2 \, {\left (2 \, x - 1\right )}}{7 \, {\left (x^{2} - x + 2\right )}} + \frac {x + 10}{7 \, {\left (x^{2} - x + 2\right )}} - \frac {4 \, {\left (x - 4\right )}}{7 \, {\left (x^{2} - x + 2\right )}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(((x^4-2*x^3+5*x^2-4*x+4)*log(x)+x^4-2*x^3+6*x^2-4*x+2)/(x^4-2*x^3+5*x^2-4*x+4),x, algorithm="maxima"
)

[Out]

x*log(x) + 2/7*(5*x - 6)/(x^2 - x + 2) - 6/7*(3*x + 2)/(x^2 - x + 2) + 2/7*(2*x - 1)/(x^2 - x + 2) + 1/7*(x +
10)/(x^2 - x + 2) - 4/7*(x - 4)/(x^2 - x + 2)

________________________________________________________________________________________

mupad [B]  time = 3.21, size = 18, normalized size = 0.72 \begin {gather*} x\,\ln \relax (x)-\frac {x}{x^2-x+2} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((log(x)*(5*x^2 - 4*x - 2*x^3 + x^4 + 4) - 4*x + 6*x^2 - 2*x^3 + x^4 + 2)/(5*x^2 - 4*x - 2*x^3 + x^4 + 4),x
)

[Out]

x*log(x) - x/(x^2 - x + 2)

________________________________________________________________________________________

sympy [A]  time = 0.13, size = 12, normalized size = 0.48 \begin {gather*} x \log {\relax (x )} - \frac {x}{x^{2} - x + 2} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(((x**4-2*x**3+5*x**2-4*x+4)*ln(x)+x**4-2*x**3+6*x**2-4*x+2)/(x**4-2*x**3+5*x**2-4*x+4),x)

[Out]

x*log(x) - x/(x**2 - x + 2)

________________________________________________________________________________________