In the first hour the energy used is (0.5 + 1 + 1 + 0.5) / 4 = 0.75 MWh. In the second hour the energy used is (1.5 + 2 + 1 + 1) / 4 = 1.375 MWh. Total for the two hour period is 2.125 MWh. The energy used is the integral of power with respect to time and is represented graphically by the area under the curve. More @Wikipedia
Hover over any link to get a description of the article. Please note that search keywords are sometimes hidden within the full article and don't appear in the description or title.