Algebra · real student question

Factor x^2(x - y) + (y - x) completely.

Question

Factor

x2(xy)+(yx)x^2(x-y)+(y-x)

completely.

Step-by-step solution

  1. Notice the near-match between the two brackets. The expression contains (xy)(x-y) and (yx)(y-x) — not identical, but opposites. This is the standard obstacle in factoring by grouping, and it is fixed by a single sign flip rather than by expanding everything.

  2. Flip the second bracket. Since

    yx=(xy)y-x=-(x-y)

    the expression becomes

    x2(xy)(xy)x^2(x-y)-(x-y)

    Both terms now share the identical factor (xy)(x-y).

  3. Factor out the common bracket. Writing the second term as 1(xy)1\cdot(x-y) makes the coefficient explicit:

    x2(xy)1(xy)=(xy)(x21)x^2(x-y)-1(x-y)=(x-y)\left(x^2-1\right)

  4. Recognise the difference of squares. x21=x212x^2-1=x^2-1^2, so by a2b2=(ab)(a+b)a^2-b^2=(a-b)(a+b):

    x21=(x1)(x+1)x^2-1=(x-1)(x+1)

    Leaving the answer as (xy)(x21)(x-y)(x^2-1) would be incomplete factoring.

  5. Write the complete factorisation.

    x2(xy)+(yx)=(xy)(x1)(x+1)x^2(x-y)+(y-x)=(x-y)(x-1)(x+1)

    Three linear factors, so the expression vanishes exactly when x=yx=y, x=1x=1, or x=1x=-1.

  6. Verify numerically and by expanding. Testing 6060 random pairs (x,y)(x,y) in [4,4][-4,4] gives agreement to machine precision at every point ✓. As a spot check at x=3,y=1x=3,y=1: the original is 9(2)+(13)=182=169(2)+(1-3)=18-2=16, and the factored form is (2)(2)(4)=16(2)(2)(4)=16 ✓.

Answer

x2(xy)+(yx)=(xy)(x1)(x+1)x^2(x-y)+(y-x)=(x-y)(x-1)(x+1)

Need to solve a different problem like this? Open the solver →