expand (a-b)^2
Let's write in expanded form: (a -b)2
ⓘ Raising a sum to an integer power is multiplying it by itself: (a -b)2 = (a -b)·(a -b)
(a -b)·(a -b)
ⓘ Expand by multiplying each term inside the parentheses: (a -b)·(a -b) = a·a + a·(-b) -b·a -b·(-b)
a·a + a·(-b) -b·a -b·(-b)
ⓘ Multiplying powers with the same base adds the exponents: a·a = a2, -b·(-b) = (-b)2■The minus sign is placed in front of the product: a·(-b) = -ab
a2 -ab -ba + (-b)2
ⓘ Like terms are grouped by adding their coefficients: -ab -ba = -2ab■Powers are computed before multiplications, additions and subtractions. With an even integer exponent, the minus sign in the base disappears; with an odd integer exponent, it moves in front of the power: (-b)2 = b2
▶Expanded form:   a2 -2ab + b2