Since w² + w + 1 = 0 and w³ = 1,
(a + bw + cw²)(a + bw² + cw)
= a(a + bw² + cw) + bw(a + bw² + cw) + cw²(a + bw² + cw)
= (a² + abw² + acw) + (abw + b² + bcw²) + (acw² + bcw + c²)
= (a² + b² + c²) + ab(w² + w) + bc(w² + w) + ac(w² + w)
= a² + b² + c² - ab - bc - ac.
I hope this helps!
(a + bw + cw²)(a + bw² + cw)
= a(a + bw² + cw) + bw(a + bw² + cw) + cw²(a + bw² + cw)
= (a² + abw² + acw) + (abw + b² + bcw²) + (acw² + bcw + c²)
= (a² + b² + c²) + ab(w² + w) + bc(w² + w) + ac(w² + w)
= a² + b² + c² - ab - bc - ac.
I hope this helps!