where Pmkt is the equilibrium price (where supply equals demand), Qmkt is the total quantity purchased at the equilibrium price and Pmax is the price at which the quantity purchased would fall to 0 (that is, where the demand curve intercepts the price axis). For more general demand and supply functions, these areas are not triangles but can still be found using integral calculus. Consumer surplus is thus the definite integral of the demand function with respect to price, from the market price to the maximum reservation price (i.e. the price-intercept of the demand function):