The aggregate demand (AD) is the total quantity produced in an economy at a given price and is equal to the national income and real GDP.
AD is composed of 4 parts: Consumption (C), Investment (I), Government spending (G), Net exports (X-M)
The formula is AD = C + I + G + (X-M)