I know that this question was asked over a year ago and that no one will read this post. But I can't sit idly by and watch all these wrong answers get posted.

The if a and b were real or complex numbers, then the equation a^2 - b^2 = (a + b)(a - b) would be true, for the reasons posted above. But a and b are matrices, not real numbers. Implicit in all of the calculations above is that ab = ba. But that doesn't hold for most pairs of matrices.

So for example, if you take

a =

1 2

3 4

b =

5 6

7 8

You'll find you get

a^2 - b^2 =

-60 -68

-76 -84

and yet

(a + b)(a - b) =

-56 -56

-88 -88

The if a and b were real or complex numbers, then the equation a^2 - b^2 = (a + b)(a - b) would be true, for the reasons posted above. But a and b are matrices, not real numbers. Implicit in all of the calculations above is that ab = ba. But that doesn't hold for most pairs of matrices.

So for example, if you take

a =

1 2

3 4

b =

5 6

7 8

You'll find you get

a^2 - b^2 =

-60 -68

-76 -84

and yet

(a + b)(a - b) =

-56 -56

-88 -88