# Investigating the firm's supply function

Suppose the firm has a minimum cost function $$C(\vec{w}, q)$$ and sets up the following profit maximisation problem:

$$max_{q} \text{ } pq - C(\vec{w}, q)$$. The below FOC characterises the solution:

$$p = C_q(\vec{w}, q)$$ where the subscript denotes partial derivatives.

If I understand correctly, rearranging the FOC to get the $$q$$ as a function of $$\vec{w}$$ and $$p$$ gives us the supply function $$S(\vec{w}, p) = q$$. To investigate $$q$$'s response to changes in $$p$$ and $$\vec{w}$$ we substitute the supply function into the FOC from which it was originally derived:

$$p = C_q(\vec{w}, S(\vec{w}, p))$$

Then we would compute partial derivatives and study its signs. What is the intution behind the maths that allow us to rearrange an equation only to substitute the result back into that same equation? If we have an equation $$y = x + 3$$ and rearrange it to $$x = y - 3$$, would not there be very little use in substituting the latter into the former to arrive at $$y = y$$?

The identity $$y=y$$ can be surprinsingly useful when both expressions for $$y$$ are spuriously different. This can be illustrated by the inverse function theorem. If $$y=f(x)$$ is equivalent to $$x=f^{-1}(y)$$, it is identically true that: $$y=f(f^{-1}(y)) \hspace{5mm} or \hspace{5mm} x=f^{-1}(f(x)),$$ which yields the classical relationship between $$f'$$ and $$(f^{-1})'$$. In the multiple variable case of your example, it is quite similar.