The area of the trapezoid shown in the figure is equal to the area of a rectangle that have a similar width (w) and a height of (a+b)/2.
This is because the triangle 1 and the triangle 2 are equivalent and have similar areas.
Area of the trapezoid = average height x width
(a+b)