# Comparative statics with multiple equations using calculus

I am currently learning a three market model of the economy, with the goods market, money market and factor market being in equilibrium respectively when-

$$Y=C(Y-tY)+ I(r) + (\bar G) + \bar{NX}$$

$$\frac{\bar M}{P} = M^d(r, Y)$$

$$P=P^e f(\frac{Y}{\bar L}, \bar \mu, \bar z)$$

Here all the variables with bars above them are exogenous, and the rest are endogenous. I have been taught to trace the effect of the change in a parameter by using graphs. The first equation and the second give us the IS and LM curves respectively in the $$(Y, r)$$ space, they together give rise to the downward sloping AD curve in the $$(Y, P)$$ space. The third equation generates the upward sloping AS curve in the same space.

For example, increasing G shifts the IS curve to the right, as given an interest rate, Y rises. This in turn raises r and Y. The increased Y at any given price level shifts the AD curve to the right. This raises P and Y again. The original LM curve moves slightly left but not to completely offset the original increase in Y, as the AD-AS diagram makes sure that Y actually increases.

I often convert the diagrammatic description to calculus and for each specific market, assuming all other markets to be not affected, it seemed fairly easy.

But I got completely lost when I tried to account for derivatives such that all the three equations are simultaneously satisfied, that is, to translate the diagrammatic logic into calculus.

How should I go about it? Also, where can I learn that technique for any arbitrary set of equations, and not just this particular model, to be able to use this in other models in the future?

Since this looks like a homework and there was no attempt made, in order to avoid giving full solution I will just give you conceptual explanation using equation 1 and 2 (you can later add equation 3 using steps below).

The standard method how you approach this is by taking total derivative and solving the system for $$dY$$. Total derivative is similar to regular derivative but you will take it with respect to every variable in the system. Here you will have set of equations:

$$dY = C_Y'dY + C_t'dY + I_r'dr + dG + dNX \\ \frac{PdM-MdP}{P^2}= M^{d'}_Y dY + M^{d'}_r dr$$

The same logic can be also applied to equation 3 that I purposefully omitted.

Now you can employ any method for solving system of multiple equations you want. The most common methods of solving sytems of equations are substitution, linear combination method (i.e. the method where you add multiple equations), various matrix methods such as Cramer's rule. However, no matter what method you use they will all work but get progressively more difficult the more equations you have. There is really no good shortcut here. Even matrix methods that work reasonably well when you have multiple equations can quickly become unwieldy as number of equations grow. In practice you would not solve difficult systems by hand but just set up the system in pyhton or matlab and let it solve it for you (however, in classroom setting it is unlikely you will encounter systems with more than 4 equations).

In this case the substitution is the quickest method so I will us that one. We can solve the equation 2 for $$dr$$:

$$dr = \frac{PdM-MdP}{P^2M^{d'}_r} - \frac{M^{d'}_Y}{M^{d'}_r} dY$$

Now substitute this equation back into the first one to get:

$$dY = C_Y'dY + C_t'dY + I_r' \left( \frac{PdM-MdP}{P^2M^{d'}_r} - \frac{M^{d'}_Y}{M^{d'}_r} dY \right) + dG + dNX$$

solve for $$dY$$:

$$dY = \frac{1}{\left(1 - C_Y' - C_t' - I_r' \frac{M^{d'}_Y}{M^{d'}_r} \right)} \left( I_r' \frac{PdM-MdP}{P^2M^{d'}_r} + dG + dNX\right)$$

This expression should already be familiar to you from your macro 101 class - the first fraction is the multiplier and the second brackets are the exogenous sources of spending.

Now if you want to examine what happens when let's say government spending increases ceteris paribus you will just set all other $$dX=0$$ save for $$dY$$ and $$dG$$ (because other things will not change) giving you in this case:

$$dY = \frac{1}{\left(1 - C_Y' - C_t' - I_r' \frac{M^{d'}_Y}{M^{d'}_r} \right)} dG$$

And then we can find the partial derivative of $$\frac{\partial Y}{\partial G}$$ simply as:

$$\frac{\partial Y}{\partial G} = \frac{1}{\left(1 - C_Y' - C_t' - I_r' \frac{M^{d'}_Y}{M^{d'}_r} \right)}$$.

And you are done this expression tells you by how much the $$Y$$ changes when $$G$$ changes. You can redo the above for any other variable you want, and you can easily add the third equation as well (just take its total derivative and do 1 extra substitution that is required). The above method will work for arbitrary system. Sometimes it is easier to use different method of solving the system of equations but that is very situational and there I don't have better advice than just to practice various ways of solving systems and in the end you will develop 'knack' for knowing which method is quickest in particular case (although they will all work just some are sometimes quicker/easier to apply).