There is a very silly, but handy, mnemonic for remembering this formula. It runs as follows:

If you pretend you're Santa Claus, you could call f(x) "Hi" (as in, high, on top), and g(x) "Ho" (rhymes with "low"). Then the formula is "HoDeeHi minus HiDeeHo over HoHo".

(dy / dx) = HoDeeHi - HiDeeHo
                 (Ho)(Ho)
You will probably feel like an idiot reciting this to calculus students, but hey, whatever works.