derivation of aggregate demand and aggregate supply