Step 1: Understanding the Concept:
The integrand is a proper rational function whose denominator splits into the repeated factor \((x-1)^2\) and the simple factor \((x+2)\). We break it into partial fractions and integrate each piece.
Step 2: Key Formula or Approach:
For a repeated linear factor we need terms for both powers:
\[ \frac{x}{(x-1)^2(x+2)} = \frac{A}{x-1} + \frac{B}{(x-1)^2} + \frac{C}{x+2} \]
Step 3: Clear the denominators:
Multiply both sides by \((x-1)^2(x+2)\):
\[ x = A(x-1)(x+2) + B(x+2) + C(x-1)^2 \]
Expand the right side:
\[ x = A(x^2 + x - 2) + B(x + 2) + C(x^2 - 2x + 1) \]
\[ x = (A + C)x^2 + (A + B - 2C)x + (-2A + 2B + C) \]
Step 4: Compare coefficients:
Coefficient of \(x^2\): \(A + C = 0\).
Coefficient of \(x\): \(A + B - 2C = 1\).
Constant term: \(-2A + 2B + C = 0\).
From the first equation \(A = -C\). Put this in the second: \(-C + B - 2C = 1\), so \(B = 1 + 3C\).
Put \(A = -C\) and \(B = 1 + 3C\) in the third: \(2C + 2 + 6C + C = 0\), so \(9C = -2\) and \(C = -\frac{2}{9}\).
Then \(A = \frac{2}{9}\) and \(B = 1 - \frac{6}{9} = \frac{1}{3}\).
Step 5: Write the integral in simple pieces:
\[ \int \frac{x\,dx}{(x-1)^2(x+2)} = \frac{2}{9}\int \frac{dx}{x-1} + \frac{1}{3}\int \frac{dx}{(x-1)^2} - \frac{2}{9}\int \frac{dx}{x+2} \]
Step 6: Integrate each piece:
\(\int \frac{dx}{x-1} = \log|x-1|\), \(\int \frac{dx}{(x-1)^2} = -\frac{1}{x-1}\) and \(\int \frac{dx}{x+2} = \log|x+2|\).
\[ = \frac{2}{9}\log|x-1| - \frac{1}{3(x-1)} - \frac{2}{9}\log|x+2| + c \]
Combine the two logarithms:
\[ = \frac{2}{9}\log\left|\frac{x-1}{x+2}\right| - \frac{1}{3(x-1)} + c \]
Final Answer:
The integral is the expression below, where \(c\) is the constant of integration.
\[ \boxed{\frac{2}{9}\log\left|\frac{x-1}{x+2}\right| - \frac{1}{3(x-1)} + c} \]