When can we not treat differentials as fractions? And when is it perfectly OK? Background
I am a first year calculus student so I would prefer if answers remained in Layman's terms.
It is common knowledge and seems to me a mantra that I keep hearing over and over again to "not treat differentials/derivatives as fractions".
I am of course, in particular, referring to Leibniz notation.
However, aside from a quick response such as "oh, it's because its not a fraction but rather a type of operator", I never really got a full answer as to why we can't treat it as such. It just kind of sits at the edge of taboo in my mind where it sometimes gets used and sometimes doesn't.
Confusion is further compounded when a lot of things seem to just work out if we treat them just as fractions (e.g. u-substitution/related-rates)

Example

Air is being pumped into a balloon at a rate of $100cm^3/s$. We want the rate of change of radius when the radius is at $25cm$.

$$\text{we are given}\ \frac{dv}{dt}=100cm^3/s$$
$$\text{we want}\ \frac{dr}{dt}\ \text{when}\ r=25cm$$
Thus we will solve this by using the relation $v=\frac{4}{3}\pi r^3$
$$\frac{dv}{dt}=\frac{dv}{dr}\frac{dr}{dt}$$
$$\frac{dv}{dt}\frac{dr}{dv}=\frac{dr}{dt}$$
$$100\frac{1}{4\pi r^2}=\frac{1}{25\pi}$$
So the answer is $\frac{dr}{dt}=\frac{1}{25\pi}$ when $r=25cm$
*Note the manipulation of derivatives just as if they were common fractions using algebra.

Question
When exactly can I treat differentials/derivatives as fractions and when can I not?
Please keep in mind that at the end of the day, I am a first year college student. An answer that is easy to understand is preferred over one that is more mathematically rigorous but less friendly to a beginner such as me.
 A: Suppose $\Delta x$ is a tiny (but finite and nonzero) real number and $\Delta f$ is the amount that a function $f$ changes when its input changes from $x$ to $x + \Delta x$.  Then, it's not true that $\Delta f = f'(x) \Delta x$ (with exact equality), but it is true that $\Delta f \approx f'(x) \Delta x$.  You are free to manipulate $\Delta x$ and $\Delta f$ however you like, just as you would with any real numbers, so long as you rememember that the equations you derive are only approximately true.  You can hope that "in the limit" you will obtain exactly true equations (as long as you are careful).
For example, suppose that $f(x) = g(h(x))$.  Then
\begin{align}
f(x + \Delta x) &= g(h(x+\Delta x)) \\
&\approx g(h(x) + h'(x) \Delta x) \\
&\approx g(h(x)) + g'(h(x)) h'(x) \Delta x,
\end{align}
which tells us that
\begin{equation}
\frac{f(x+\Delta x) - f(x)}{\Delta x} \approx g'(h(x)) h'(x).
\end{equation}
And it certainly seems plausible that if we take the limit as $\Delta x$ approaches $0$ we will obtain exact equality:
\begin{equation}
f'(x) = g'(h(x)) h'(x).
\end{equation}
These kinds of arguments, introducing tiny changes in $x$ and making linear approximations using the derivative, are the essential intuition behind calculus.
Often, arguments like this can be made into rigorous proofs just by keeping track of the errors in the approximations and bounding them somehow.
A: First, $dx$ and $dy$ are in fact differential forms: things that given a point and a vector with this point as origin gives us some value, linear and antisymmetric in the vector argument, continuous / differentiable / smooth in the point argument.
Now, by Newton-Leibniz, any differential form on $\mathbb{R}$ is of the form $dy = f(x)dx$, where $dx$ is a differential form such that $dx(x, h) = h$ (here, $h$ is a one-dimensional vector - you can treat it as a displacement of $x$).
So, we can try to define division like $\frac{dy}{dx} = \frac{f(x)dx}{dx} = f(x)$. While it works for now, it fails in higher dimensions.
Suppose that we are on a plane, having two basis differential forms: $dx_1$ and $dx_2$ ($dx_i$ is just projection on the $i$-th coordinate). Again, any differential form is $dy = f_1(x)dx_1 + f_2(x)dx_2$. Divide by $dx_1$: $\frac{dy}{dx_1} = f_1(x) + f_2(x)\frac{dx_2}{dx_1}$. We could say here that $\frac{dx_2}{dx_1}$ is zero, since the components of a vector are independent, but let's actually do the division. Let $h = (h_1, h_2)$ be the displacement vector, then $\frac{dx_2}{dx_1}(x,h) = \frac{h_2}{h_1}$. Wow, this is surely not equal to zero, but measures some kind of relative displacement in coordinates. The point is that it depends on $h$ now, and the result of the division cannot be just a function of $x$.
What one really wants here is a some kind of dot product, since, for example, dot product with basis vector gives the corresponding coordinate. Here, this "dot product" arises naturally: take a form $dy$, and plug the basis vector in it: $dy(x, e_1) = f_1(x)dx_1(e_1)+f_2(x)dx_2(e_1) = f_1(x)$ (since $dx_1(e_1) = 1$ and $dx_2(e_1) = 0$). Why $e_1$? It is a vector field dual to the form $dx_1$, that's why.
So, although it looks like a fraction, it's actually more a dot product.
A: The historical truth of the matter is, when Calculus was being invented, mathematicians were not already using limits or $\epsilon$ - $\delta$ arguments or anything nearly rigorous.  All of their arguments were built on reasoning algebraically using infinitesimals - quantities assumed to be infinitely small yet still non-zero.  When Leibnitz introduced the ratio $dy/dx$ he intended it to be an actual ratio of infinitesimals.  When a change of variables in an integral produced an expression such as $dy = 2x$ $dx$, it literally meant that the infinitesimal $dy$ was thicker than $dx$ by a factor of $2x$ (and this scaling was necessary to get the integral - as a sum of infinitely many infinitesimals - to work out right).
"But aren't infinitesimals logical nonsense?", you ask.  In a word, yes - and a whole lot of not-at-all-stupid people repeatedly pointed this out, even at the time. The general response was, essentially: "Well it all works, so stop bugging us about it."  But after a couple hundred years of that, mathematicians finally had to fix the problems that infinitesimals were causing; it is at this point that $\epsilon$ - $\delta$ arguments and limits were invented.
So, if infintesimals are out, why still $dy/dx$?  Aside from mere historical inertia, the fact is that treating these expressions as fractions is no accident - Leibnitz had thought hard about notation, and chose this form so that simple intutive algebraic manipulation of formulae would tend to yield correct results in analysis.  In short, the notation is a great intuition builder (Newton's notation, not so much - which is why it is more rarely used).
For the modern analyst: Think of these expressions as 'bookkeeping terms', whose proper manipulation helps maintain internal relations among formulae which are required for your arguments to adhere to the underlying theorems that justify them (ultimately tied to relationships among the $\epsilon$s and $\delta$s in their proofs).
A: For better or worse, introductory calculus is only expressed in terms of functions and real-valued expressions.
On the one hand, this has the advantage that you don't need to learn about any "new" sorts of objects, since functions and real-valued variables are presumably something already familiar to you.
Differentials $\mathrm{d}x$ are a new kind of object you haven't learned about yet — by the above philosophy, your class wants to avoid dealing with them.
Fortunately, the whole expression $\frac{\mathrm{d}y}{\mathrm{d}x}$, when it makes sense, has the advantage that it is an ordinary real-valued expression; thus, you can avoid having to deal with new sorts of objects if you are always careful to work with such expressions as a whole.
However, this does not cripple you, because you learn or can prove theorems like
$$ \frac{\mathrm{d}z}{\mathrm{d}w} \frac{\mathrm{d}y}{\mathrm{d}x} = \frac{\mathrm{d}z}{\mathrm{d}x} \frac{\mathrm{d}y}{\mathrm{d}w} 
\qquad \text{and} \qquad
\frac{\frac{\mathrm{d}z}{\mathrm{d}x}}{\frac{\mathrm{d}y}{\mathrm{d}x}} = \frac{\mathrm{d}z}{\mathrm{d}y} 
\qquad \text{and} \quad
\frac{\mathrm{d}x}{\mathrm{d}x} = 1 $$
which basically encompass everything you would want to with these expressions, even if you did know about the sort of object that $\mathrm{d}x$ and did want to treat Leibniz notation as a ratio.

Looking towards the future, the interpretation as a ratio becomes less useful.
Differentials still make sense, but often $\mathrm{d}x$ and $\mathrm{d}y$ aren't multiples of one another, so $\frac{\mathrm{d}y}{\mathrm{d}x}$ wouldn't even make sense.
Worse, the similar notation for partial derivatives; e.g. $\frac{\partial z}{\partial x}$ has its own quirks and problems that make it actively misleading to think of it as a ratio of ${\partial z}$ to ${\partial x}$; a particular theorem of note is that
$$ \frac{\partial y}{\partial x} \frac{\partial z}{\partial y} \frac{\partial x}{\partial z} = -1$$
A: Even though this is already closed, I am not pleased with any of these answers personally, and I think I can still say something that might be useful.
First off: when we write something like
$$\frac{\text{d}y}{\text{d}x},$$
the symbols $\text{d}y$ and $\text{d}x$ do NOT represent differential forms. A differential form is a linear, antisymmetric $n$-form: a linear opperator that takes in $n$ vectors and spits out a number. These symbols need not represent that, they can represent actual real numbers. Let's make this formal.
Imagine we have a real function $f\space\colon\space\mathcal{D}\subseteq\mathbb{R} \longrightarrow \mathbb{R}$ which is differentiable ($\iff$ derivable) in $\mathcal{D}$. If we have $y=f(x)$ and we make a change $\Delta x$ to the independent variable, the dependent variable will change by $\Delta y$, so
$$y+\Delta y=f(x+\Delta x) \implies \Delta y=f(x+\Delta x)-y=f(x+\Delta x)-f(x)$$
Let's define a function $\eta(\Delta x)$ just because:
$$\eta(\Delta x) \equiv \frac{f(x+\Delta x)-f(x)}{\Delta x}-f'(x)$$
Here, $f'(x)$ stands for the derivative function of $f$, which we know exists because $f$ is differentiable. This function $\eta(\Delta x)$ has the following property:
$$\lim_{\Delta x \to 0}{\eta(\Delta x)}=f'(x)-f'(x)=0$$
This will be useful in a second. Let's solve for $\Delta y$ in the definition of the function $\eta(\Delta x)$:
$$\Delta y = f'(x)\Delta x + \eta(\Delta x)\Delta x$$
If we make $\Delta x$ go to $0$, we find that the first term goes to $0$ linearly (at the same rate than $\Delta x$ itself does), while the second term, as a consequence of the limit of $\eta(\Delta x)$ being $0$, goes to $0$ faster than $\Delta x$ does. This means that the first term ($f'(x)\Delta x$) is the linear part of $\Delta y$. You might recognise this as the first term of the Taylor expansion of $f$ around a point $x$.
We DEFINE the differential $\text{d}y$ of a variable $y$ as the linear part of its variation (the one that changes like $\Delta x$ and not like $(\Delta x)^k$ for some $k \neq 1$). And you can see from this definition that it makes sense to say that $\text{d}x=\Delta x$ because $\Delta x$ obviously changes like $\Delta x$ does.
So, we have:
$$\text{d}y = f'(x) \text{d}x \implies \frac{\text{d}y}{\text{d}x} = f'(x)$$
Notice that we have always taken $x$ as a fixed point in which $f(x)$ is differentiable, which means that we should really write:
$$\left(\frac{\text{d}y}{\text{d}x}\right)_{x=a}=f'(a)$$
Knowing this, it's not at all surprising that, given $u=\varphi(x)$, $w=\phi(x)$ and $y=f(x)$ differentiable at the points we're interested in, we can prove...
$$\left(\frac{\text{d}y}{\text{d}u}\right)_{u=\varphi(a)}\left(\frac{\text{d}u}{\text{d}x}\right)_{x=a}=\left(\frac{\text{d}y}{\text{d}x}\right)_{x=a}$$
... which we call the chain rule; and, by extension...
$$\left(\frac{\text{d}y}{\text{d}u}\right)_{u=\varphi(a)}\left(\frac{\text{d}w}{\text{d}x}\right)_{x=a}=\left(\frac{\text{d}y}{\text{d}x}\right)_{x=a}\left(\frac{\text{d}w}{\text{d}u}\right)_{u=\varphi(a)}$$
... and its many implications (the inverse of a derivative is the derivative of the inverse function, if there exists one in the first place, etc.)
Notice that this manipulations are ALWAYS TRUE, GIVEN THAT a derivative exists in the first place. Basically, this is saying "manipulating differentials is perfectly okay, but you are supposing that these things are differentiable instead of proving it". If you are doing a proof you won't generally do this kind of manipulations, but it's perfectly fine to cancel, move and do anything with first-order total differentials when solving differential equations or doing any physics problem.
This isn't new, though. Treating derivatives as fractions is just as dangerous as treating good old fractions as fractions. Just like with differentials, doing a manipulation like
$$\frac{x}{y}\frac{y}{z}=\frac{x}{z}$$
is implying that you know that all these fractions exist (i.e. you know that $y,z\neq0$, specially $y$ as it's the one you're "cancelling" here).
So, doing regular fraction cancellation can lead you to problems. For example, if you're given the equation...
$$x^2+5x=0 \implies x(x+5)=0$$
... and you're asked to solve for $x$, you could think you can divide both sides by $x+5$ and get $x=0$ as the only solution, but doing the cancellation of the $x+5$ on the numerator by the one on the denominator implied knowing in advance that $x+5\neq0$, which is why this method didn't give you also the solution $x=-5$.
I hope this helped, thank you for reading. And, oh, as a final comment, the definition of the symbol $\text{d}y$ as a differential form is related to the one I gave here by the following equation (given $y = f(x^1,...,x^n)$ a general scalar function):
$${\text{d}\tilde{y}}(\text{d}\vec{x}) = \text{d}y$$
Here, ${\text{d}\tilde{y}}$ is a differential 1-form called the gradient of $f(\vec{x})$ (the covariant form of $\vec{\nabla}f$) and $\text{d}y$ is the linear part of $\Delta y = f(\vec{x}+\Delta \vec{x}) - f(\vec{x})$.
A: I'll just make two extended comments.
First, if you'd like to treat $dy/dx$ as a fraction, then you need to do two things:


*

*(1) Have a clear, precise mathematical definition of what $dy$ and $dx$ are, and 

*(2) Have a way of dividing the quantities $dy$ and $dx$.


There are a few ways of answering (1), but the most common answer among mathematicians -- that is, to the question of "what are $dy$ and $dx$ really?" -- is somewhat technical: $dy$ and $dx$ are "differential forms," which are objects more advanced than a typical calculus course allows.
More problematic, though, is (2): differential forms are not things which can be divided.  You might protest that surely every mathematical object you can think of can be added, subtracted, multiplied, and divided, but of course that's not true: you cannot (for example) divide a square by a triangle, or $\sqrt{2}$ by an integral sign $\int$.
Second, every single instance in which expressions like $dy/dx$ are treated like fractions -- like, as you say, $u$-substition and related rates -- are just the chain rule or the linearity of derivatives (i.e., $(f+g)' = f' + g'$ and $(cf)' = cf'$).  Every single instance.
So, yes, $dy/dx$ can be treated like a fraction in the sense (and to the extent) that the Chain Rule $dy/dx = (dy/du)(du/dx)$ is a thing that is true, but that's essentially as far as the fraction analogy goes.  (In fact, in multivariable calculus, pushing the fraction analogy too far can lead to real issues, but let's not get into this.)
Edit: On the OP's request, here are examples of fraction-like manipulations which are not valid:
$$\left( \frac{dy}{dx} \right)^2 = \frac{(dy)^2}{(dx)^2} \ \ \text{ or } \ \ 2^{dy/dx} = \sqrt[dx]{2^{dy}}.$$
Because these manipulations are nonsensical, students are often warned not to treat derivatives like fractions.
A: $dy\over dx$ is by definition a limit of a function that maps $x$ to $y$.
it is a symbol, a way of writing that is agreed upon. it could as well be a little doggy sign but that would be unhelpful.
that certain "fraction-like" way of expressing a certain limit comes to help us, humans, use a proven mathematical law.
that law states that the derivative of a composite function $g \circ f$ equals to the derivative of $g$ times the derivative of $f$. that is not trivial.
the fact that many of us get confused as to why we can treat it like it's a fraction comes to show how efficient this notation really is.
let's math it out:
let $f:x\rightarrow y$ be differentiale at any $x$. 
let $g:y\rightarrow z$ be differentiale at any $y$.
${dz\over dx}:=\lim_{\Delta x\to0}{\Delta z\over \Delta x}=\lim_{\Delta x\to0}{\Delta z\over \Delta y}{\Delta y\over \Delta x} $ 
now since we know $f$ and $g$ are differentiable we know that their limits exist, which means we can do the following:
$\lim_{\Delta y\to0}{\Delta z\over \Delta y}\cdot\lim_{\Delta x\to0}{\Delta y\over \Delta x}={dz\over dy}\cdot{dy\over dx}$
thus proving that ${dz\over dx}={dz\over dy}\cdot{dy\over dx}$
but ohh would you look at that! that looks as if we reduced a fraction!
this is so very far from being a full rigorous proof but I do hope some of it helped to your understanding.
A: I am a layman, so I will put my take on the presented related rates problem in layman's terms. To avoid the deep stuff in a case like this, I try to apply the chain rule directly and not worry about treating derivatives as fractions and differentials as numbers. Volume is explicitly given as a function of radius and since the instantaneous rate of change of volume with respect to time is given, volume would also seem to be a function of time. Equating these two expressions for volume allows that time is a function of radius and radius is a function of time, disallowing negative time. 
I like to write $v=v(r)$ and $r=r(t)$ to remind me of what I'm doing, expecting that the quantities on either side of the equals sign should be  interchangeable. Then:
$dv/dt=d(v(r))/dt=d(v(r(t))/dt$  and ${dv\over dt}={{d({4\over3}\pi(r(t))^3)\over d(r(t)}}$ ${d(r(t)\over dt}$$=(4\pi r^2){dr\over dt}$
Although the notation might be a little different, I believe this is one way to solve the problem similar to calculus textbooks and the notation aids me in the understanding. But for all I know it may be just as confusing as the rest of it and not even be correct or widely applicable or relevant, in which case a real mathematician can surely throw it out.
A: This is something that hasn't been mentioned yet. While I'm not aware of cases where $\frac{dy}{dx}$ fails when treated as a fraction and gives incorrect results, the notation $\frac{d^2y}{dx^2}$ will give incorrect results if treated as such. Keep in mind that this is a shorthand for $\frac{d^2y}{(dx)^2}$. Suppose
$$x=sin(t)^2+t$$
$$y=t^2+1$$
and we want to find $\frac{d^2y}{(dx)^2}$ implicitly (that is, without writing y in terms of x in order to do it, which might be hard or not even possible). Finding $\frac{dy}{dx}$ will work fine by treating the differentials as fractions:
$$\frac{dy}{dx} = \frac{\frac{dy}{dt}}{\frac{dx}{dx}}=\frac{2t}{2sin(t)cos(t)+1}$$
which is the correct result that you will get with a direct approach:
$$\frac{dy}{dx} = \frac{d(t^2+1)}{dx} = \frac{dt}{dx}2t$$
Finding $\frac{dt}{dx}$:
$$\frac{dx}{dx} = \frac{dt}{dx}2cos(t)sin(t) + \frac{dt}{dx}$$
$$1 = \frac{dt}{dx}(2cos(t)sin(t)+1)$$
$$\frac{1}{2cos(t)sin(t)+1} = \frac{dt}{dx}$$
Substituting
$$\frac{dy}{dx} = \frac{1}{2cos(t)sin(t)+1}(2t)$$
Which is the same result. However, if you try to do this for $\frac{d^2y}{(dx)^2}$, you will get the wrong answer:
$$\frac{d^2y}{(dx)^2} = \frac{d^2y}{(dt)^2}\frac{(dt)^2}{(dx)^2} = \frac{d^2y}{(dt)^2}(\frac{dt}{dx})^2 = \frac{d^2y}{(dt)^2}\frac{1}{(\frac{dx}{dt})^2}$$
$$\frac{d^2y}{(dt)^2} = 2$$
$$\frac{dx}{dt} = 2sin(t)cos(t)+1$$
hence, by substituting
$$\frac{d^2y}{(dx)^2} = (2)\frac{1}{(2sin(t)cos(t)+1)^2}$$
This can be shown to be false by taking the derivative of $\frac{dy}{dx}$ with respect to x in a direct way:
$$\frac{d(\frac{dy}{dx})}{dx} = \frac{d(\frac{2t}{2sin(t)cos(t)+1})}{dx} = \frac{2\frac{dt}{dx}(2sin(t)cos(t)+1) - \frac{dt}{dx}(2cos(t)^2-2sin(t)^2)(2t)}{(2sin(t)cos(t)+1)^2}$$
Substitute $\frac{dt}{dx} = \frac{1}{2sin(t)cos(t)+1}$
$$\frac{d(\frac{dy}{dx})}{dx} = \frac{4sin(t)cos(t)+ 2 - 4tcos(t)^2-4tsin(t)^2}{(2sin(t)cos(t)+1)^3}$$
which is not the same. I actually discovered this because I made this mistake when I put aside my skepticism and trusted Leibniz notation to give correct results despite not being well-defined. Leibniz notation for higher derivatives in general does not give correct results when manipulated as a fraction. The notation for higher derivatives must be modified for these manipulations to work. See this paper
