How to get the percentage-change form of the quantity equation? In my book, the quantity equation is presented as
$$M\bar{V}=PY$$
And on the next page, the author presents its percentage-change form:
$$\% \ \text{Change in}\ M + \% \ \text{Change in}\ V = \% \ \text{Change in}\ P + \% \ \text{Change in}\ Y$$
My question is: where exactly does the second equation come from? I've tried manipulating the original equation to see if I could get the percentage-change form, but I didn't get anywhere. Any help will be appreciated. Thanks.

@edit

I've actually found an explanation in a footnote in another chapter of the book (see below), but there's still one thing I don't understand: what are we differentiating with respect to? If it's $Y$, then $d(PY)=P$; if it's $P$, then $d(PY)=Y$; unless we're actually differentiating with respect to some third variable of which $P$ and $Y$ are both functions. In this case, what would that variable be? (I may be misunderstanding it too). Thanks. 

Here's the explanation (Mankiw Macroeconomics 7th edition, page 26):


  The proof that this trick works begins with the product rule from
  calculus: $$d(PY)=Y \ dP+P \ dY$$ Now divide both sides of this
  equation by PY to obtain: $$d(PY)/PY)=dP/P+dY/Y$$ Notice that all
  three terms in this equation are percentage changes.
I think the author is just taking logs of the original equation.  The natural log approximates percent changes for small changes.  More info here.  Using that and properties of the log, $\ln(ab)=\ln(a)+\ln(b)$, you get that formula.