You never divide by zero. That's what breaks math. Generally in this manner:
5*0 = 0
(5*0)/0 = 0/0
As x/x = 1,
5 = 1
Also, if you ever do any advanced math, then you also learn you can accidentally eliminate possible solutions. Plus there is i, matrices, polar diagrams, and some...