The whole square has side length a+b, and we can square that for the area. But if we look at the pieces, we get 4 triangles and a smaller tilted square. If we equate those two ways of seeing the total area we get ...