A time varying current i in passed through a resistance R as shown in figure. The total heat generated in the resistance is: