Leibniz notation is unsound, but miraculously produces the correct answer most of the time anyway (at least for first-year calculus).
As it's been said before, the derivative and integral are defined by limits. You can't break the limit into two halves. In other words, it is blatantly false that \lim \frac{a}{b} = \frac{\lim a}{\lim b} or variation like that. You simply can't split a limit. The "dx" can't exist on its own like that. It's not a real number. It's not an infinitesimal. It's nonsense.
But it's nonsense that produces the correct answer (in most cases). The reason for this probably has to do with a generalized notion of a limit. If you had a limit operator that acted on an entire equation (as opposed to an expression -- ie: on both sides of the = sign, not just on the left or right), then you can do a few more tricks. In that case, the definition of a derivative would be
\lim_{h->0} (f'(x) = \frac{f(x+h) - f(x)}{h})
The parentheses are there to show that the limit applies to the whole equation. The important difference is that the variable h is allowed to live anywhere inside the equation (as opposed to just on the left or right side). That means, we can rearrange the equation like this:
\lim_{h->0} (f'(x) h = f(x+h) - f(x))
If someone learned calculus with a concentration in physics, they will recognize this form immediately. The h plays the role of the dx. The limit suggests it plays the role of an infinitesimal. If you use the first equation, you can reduce the limit equation to a regular one, and in the process, you learn the derivative. In the second equation, (the one right above here), the equation reduces to 0 = 0, which (while useless) is still true.
So these bastard "dx"'s can be used to do simple calculus. If you can solve problems using this method, that's cool. But you should understand that you're really working with a more powerful framework. The dx's are NOT real numbers. They are NOT functions. They are just the shadows of more powerful tools.
These methods tend to break down when you get to more difficult problems. When there are more than one function or you are working with a function of more than one parameter, it would not be difficult to run into problems. Especially in multivariable calculus, when learning to do multiple integrals, surface, or line integrals, the equation is more of a summary of the problem than the whole problem.