Suppose you want to study the demand for a given good. If you want your work to be grounded in theory, you probably want to start with primitives. That is, you will want to start with (i) consumer preferences, as represented by a utility function U(.) defined over the consumption x of the good, (ii) the price p of the good whose demand you want to study (for ease of notation, I am ignoring the prices of other goods, whether they are substitutes or complements), and (ii) consumer income w.
With that information, you can then maximize the consumer’s utility U(x) by choosing x such that px = w (the constraint will hold with equality if you assume that the consumer’s preferences are monotonic, i.e., consumers derive greater well-being for greater amounts of x). This yields x(p,w), the consumer’s Marshallian demand (some prefer to call it a Walrasian demand) for the good whose demand you are studying when price is equal to p and income is equal to w. From x(p,w), you can calculate how consumer demand changes as price increases or as income increases, which you would respectively denote dx/dp and dx/dw. (Yes, I am abusing notation by using d to denote partial derivatives; bear with me.)
