Factorise the following:

x^4 - x^3 - x^2 + x

The answer is x(x+1)(x-1)^2
but I cannot understand how to get this answer. Can someone please show me the working? Thanks!

factor out x

x(x^3-x^2 -x + 1)
Now, on the cubic part, notice the 1 a the end. That means the factors have to multiply to one.
x( x(x^2-1) -(x^2-1))
x(x-1)(x^2-1) and you can factor the x^2-1 into two factors..

To factorize the expression x^4 - x^3 - x^2 + x, we can use the factoring by grouping method. Let's break it down step by step:

Step 1: Group the terms.
x^4 - x^3 - x^2 + x = (x^4 - x^3) + (-x^2 + x)

Step 2: Factor out the common factor from each group.
In the first group, you can factor out x^3:
x^4 - x^3 = x^3(x - 1)
In the second group, you can factor out -x:
-x^2 + x = -x(x - 1)

Step 3: Combine the factored groups.
Putting the two factored groups together, we have:
x^3(x - 1) - x(x - 1)

Step 4: Factor out the common binomial factor.
Now, you can factor out the common binomial factor (x - 1) from both terms:
x^3(x - 1) - x(x - 1) = (x - 1)(x^3 - x)

Step 5: Further factor the remaining expression.
To factor x^3 - x, you can factor out an x:
(x - 1)(x^3 - x) = (x - 1)(x(x^2 - 1))

Step 6: Factor the remaining expression.
Notice that x^2 - 1 is a difference of squares, which can be further factored:
(x - 1)(x(x^2 - 1)) = (x - 1)(x(x - 1)(x + 1))

Step 7: Simplify the expression.
Finally, we can simplify by combining like terms and common factors:
(x - 1)(x(x - 1)(x + 1)) = x(x - 1)(x - 1)(x + 1)

Thus, the expression x^4 - x^3 - x^2 + x factors to: x(x + 1)(x - 1)^2.