Hi Andrew, great question!
What's happening is hidden behind a couple layers of "simple" calculus. While, as written, this thing is dividing by 0, what is actually happening is we are taking a limit as we approach 0. This limit is normally defined to be infinite, but we are left with /0 on the other term. Knowing that, we apply L'Hoptial's rule 3 times, and the term on the left goes to 0, so in the end we don't need to worry about division by zero due to the niceness of limits.
Edit: we need to be a little bit careful, because we have to first combine all of the terms on the right with some algebraic manipulation so that we are left with something that is just a single ratio of functions.