To solve the equation \((x-1)^2 - 5|x-1| + 6 = 0\), we need to consider two cases based on the nature of the absolute value function, which depends on whether the expression inside the absolute value is positive or negative.
- Case 1: \(x-1 \geq 0\), i.e., \(x \geq 1\)
- When \(x-1 \geq 0\), we have \(|x-1| = x-1\).
- The equation becomes:
- Let \(y = x - 1\). Then, the equation simplifies to:
- Solving this quadratic equation by factoring:
- The solutions are \(y = 2\) and \(y = 3\).
- Since \(y = x - 1\), substituting back gives \(x = 3\) and \(x = 4\).
- Case 2: \(x-1 < 0\), i.e., \(x < 1\)
- When \(x-1 < 0\), we have \(|x-1| = -(x-1)\).
- The equation becomes:
- Let \(z = x - 1\). Then, the equation simplifies to:
- Solving this quadratic equation by factoring:
- The solutions are \(z = -2\) and \(z = -3\).
- Since \(z = x - 1\), substituting back gives \(x = -1\) and \(x = -2\).
- However, these values are not valid for \(x < 1\) as they satisfy \(x - 1 < 0\), but the inequality condition should be checked. For \(x = -1\) and \(x = -2\), \(x - 1\) indeed satisfies the condition being less than zero; hence they verify as valid solutions in the secondary check of inequality after the substitution.
Now, combining the valid solutions from both cases, we have \(x = 3, 4, -1, -2\).
To find the sum of all these roots, calculate:
\((3 + 4 + (-1) + (-2)) = 4\)
Thus, the sum of all the roots is 4.