Total Differential of Aggregate Supply Our macroeconomics professor took the total differential on Equation #1 and the result was Equation #2. After multiple attempts using the knowledge I have in calculus, I can't find a way to get from Equation #1 to Equation #2. Can someone show a step by step of how this can be done?
Note: The $e$ in $P^e$ is the Expected Price Level, while $P$ is the Price Level. $e$ is not an exponent.
$$Eq.1:Pf(N)=P^eg(N)$$
$$Eq.2:Pf'dN+f(N)dP=P^eg'dN+g(N)dP^e$$

The endogenous variables are $N$ and $P$ and $P^e$. We are going to take a directional derivative of the equation
$$
\phi(N,P,P^e) = Pf(N) - P^e g(N)
$$
in the direction $z = (dN,dP,dP^e)$. A directional derivative is $\nabla \phi (x) \cdot z$, and gives how $\phi$ is changing in the direction $z$ at $x$.
So
$$
\nabla \phi(N,P,P^e) = \left( \array{Pf'(N) - P^e g'(N)\\ f(N)\\ -g(N)} \right)
$$
and
$$
z = \left( \array{dN \\ dP\\ dP^e} \right)
$$
and
$$
\nabla \phi(N,P,P^e) \cdot z = (Pf'(N)-P^eg'(N))dN+f(N)dP-g(N)dP^e.
$$
If you want to set that equal to zero and re-arrange, you are imposing it as an equilibrium condition. You are saying, ``in the direction $z$, at $x$, the function $\phi(x)$ is not changing its value."  Presumably you have two(-ish) other equations in your model to determine the values of the three endogeneous variables.
