=(m+1)^2-5(m^2-1)+3(m-1)^2=m^2+1+2m-5m^2+5+3m^2+3-6m=-m^2-4m+9
(m+1)^2-5(m+1)(m-1)+3(m-1)^2=m^2+2m+1-5m^2+5+3m^2-6m+3=(m^2-5m^2+3m^2)+(2m-6m)+(1+5+3)=-m^2-4m+9=9-m^2-4m
—m^2—4m+9