The integral of -cosx is sinx. If I wish to define the interval between zero and pi to calculate the area of f(x) above and below the x-axis, I get:

0 - 0 = 0.

If I redefine the interval as 1/2pi to 3/2pi, I get 2 square units.

But shifting the same interval up and down should not make any difference to the area of f(x) - but it does seem to!

Can somebody tell me where I'm going wrong?