Question:
prove or disprove that (A+B)2=A2+2AB+B2 if A=[aij] is a matrix of 3×3
such that aij=1 if i+j is even and it zero otherwise and B=[bij] also a 3×3 matrix such that bij=(1)ij.

SOLUTION:

To prove (A+B)2=A2+2AB+B2 we need to generate the matrices A and B.
  before we generate the matrices we look at the definition of each matrix.

Starting with the L.H.S A=[aij] where aij=1 and A is 3×3 matrix.
the matrix A is simple in the sense that: for each i=1,2,3,..,n
j=1,2,3,...,n before generating the both matrix remember the restriction that says aij=1 iff i+j=1 otherwise zero,
then
a11=1,a12=0,a13=1,


a21=0,a22=1,a23=0,

a31=1,a32=0,a33=1

then the matrix becomes A=[101010101]
which is a unit matrix.
now we proceed to generating the matrix B using the definition of B, here B=[aij]=(1)ij where B is a 3×3 then a11=(1)11=1,a12=(1)12=1,a13=(1)13=1
a21=(1)21=1,a22=(1)22=1,a23=(1)23=1

a31=(1)31=1,a32=(1)32=1,a33=(1)31=1

the the matrix B becomes B=[111111111]

Now it remains to show that  (A+B)2=A2+2AB+B2
we first start with
A+B=[101010101]+[111111111]=[212121212]

(A+B)2=(A+B)(A+B)

=[212121212][212121212]=[969666969]

which satisfies the proving of the left hand side . now it remains to show for the Right hand side. now for the right hand side A2+2AB+B2 we proof them one after the other, we begin with A2=A×A=[101010101][101010101]
   =[202010202]

and

2AB=2[101010101][111111111]


=[444222444]

and for

B2=[111111111][111111111]


=[333333333]

now we compute A2+2AB+B2

= [202010202]+[444222444]+[333333333]

     =[979565979]
hence we can conclude that  (A+B)2A2+2AB+B2