I'm looking for cases of invalid math operations producing (in spite of it all) correct results (aka "every math teacher's nightmare").
One example would be "cancelling" the 6's in
$$\frac{64}{16}.$$
Another one would be something like
$$\frac{9}{2} - \frac{25}{10} = \frac{9 - 25}{2 - 10} = \frac{-16}{-8} = 2 \;\;.$$
Yet another one would be
$$x^1 - 1^0 = (x - 1)^{(1 - 0)} = x - 1\;\;.$$
Note that I am specifically not interested in mathematical fallacies (aka spurious proofs). Such fallacies produce shockingly wrong ends by (seemingly) valid means, whereas what I am looking for all cases where one arrives at valid ends by (shockingly) wrong means.
Edit: fixed typo in last example.



I was quite amused when a student produced the following when cancelling a fraction:
$$\frac{x^2-y^2}{x-y}$$
He began by "cancelling" the $x$ and the $y$ on top and bottom, to get:
$$\frac{x-y}{-}$$
and then concluded that "two negatives make a positive", so the final answer has to be $x+y$.