Why do books say "of course" it's never that simple, differential equations? I'm reading about differential equations. It says that a first order ODE may be written:
$$M(x,y)dx + N(x,y)dy = 0.$$
Then if there is some function $f(x,y)$ such that  $\frac{\partial f}{\partial x}= M$ and  $\frac{\partial f}{\partial y}= N$ you can write:
$$\frac{\partial f}{\partial x}dx+\frac{\partial f}{\partial y}dy=0.$$
Then it says "Of course, the only way that such an equation holds is if $\frac{\partial f}{\partial x}= 0$ and  $\frac{\partial f}{\partial y}= 0$. And this entails that the function $f$ be identically constant. $f(x,y) =c$."
Here is the whole excerpt:
I don't see why this is the case. First, I thought  $\frac{\partial f}{\partial x}$ and  $\frac{\partial f}{\partial y}$ were not zero but rather  $\frac{\partial f}{\partial x}=M$ and $\frac{\partial f}{\partial y}=N$. Also, if two things add to zero they both don't need to be zero, one can be negative the other positive?
I'm confused, please help.
The fact that it says "of course" is making me feel pretty dumb.
This is from the section on "The Method of Exact Equations"
Thanks.
 A: The equation
$$M(x,y) dx + N(x,y) dy = 0$$
means the following: that $x$ and $y$ are related in such a way that 
if we start at any point $(x,y)$, and then make an infinitesimal change $dx$ in $x$, then the corresponding change in $dy$ is such that the above expression equals zero.
It might be easier to understand if you rewrite this as 
$$M\bigl(x,y(x)\bigr) + N\bigl(x,y(x)\bigr) \dfrac{dy}{dx} = 0.$$  This means that $y$ is a function of $x$,
and the derivative $dy/dx$ satisfies the preceding equation.  It has the same meaning as the preceding equation with $dx$ and $dy$ separated.
Now suppose that $M(x,y) = 
\dfrac{\partial f}{\partial x}(x,y)$ and $N(x,y) = \dfrac{\partial f}{\partial y}(x,y).$
Then we may rewrite the preceding equation as
$$\frac{\partial f}{\partial x}\bigl(x,y(x)\bigr) + \frac{\partial f}{\partial y}\bigl(x,y(x)\bigr) \frac{dy}{dx} = 0,$$
which by the chain rule is the same as saying that
$$\frac{d f\bigl(x,y(x)\bigr)}{d x} = 0,$$
or equivalently, that $f\bigl(x,y(x)\bigr)$ is constant, as $x$ varies.
Your textbook phrases things slightly differently, because it is using the first version of the differential equation: it writes instead
$$\frac{\partial f}{\partial x} (x,y) d x + \frac{\partial f}{\partial y}(x,y) dy = 0.$$
Now this is the total change in $f(x,y)$ when $x$ changes by $dx$ and $y$ changes by $dy$.  
So what this equation says is that if $x$ and $y$ are related so that the
changes $dx$ and $dy$ are related to each other by the original equation,
then the quantity $f(x,y)$ will not change as $x$ (and hence $y$) changes.
So it is not asserting that $f(x,y)$ is constant for any values of $x$ and $y$;
rather, that $f(x,y)$ is constant as $x$ and $y$ change according to the constraints of the original equation.
In short, $$f(x,y) =c$$ 
is a solution of the differential equation.
[As far as I can tell, the reasoning, such as there is, in the text that follows the "Of course" is completely bogus; it is arguing as if $dx$ and $dy$ are independent quanities.  If they were, i.e. if the change in $f(x,y)$ were zero no matter how we varied $x$ and $y$, then indeed $f(x,y)$ would be constant for all values of $x$ and $y$, but then the differential equation wouldn't be very interesting, since $M$ and $N$ themselves would be the zero functions.  Rather, the d.e. asserts that the change in $f(x,y)$ is zero if we vary $x$ and $y$ in some related way, and the conclusion one wants to draw is the one I drew above, namely that $f(x,y)$ is constant when $x$ and $y$ vary according to the particular constraint of the d.e.
Let me give an example: we could take $f(x,y) = xy$, just to choose one of 
the infinitely many different functions $f(x,y)$ of two variables that you
could write down.
Then $M = y$ and $N = x$, and the d.e. is
$$ y dx + x dy = 0,$$
or, in the second form that I wrote it,
$$y + x \frac{dy}{dx} = 0.$$
Now the solutions is given by 
$x y = c$, i.e. by
$$y = \frac{c}{x},$$
for an arbitrary constant $c$.  (Check!)
Note that is certainly not true that the partial derivatives of $f$, i.e. $M$ and $N$, vanish identically!
So one (slightly sarcastic) answer to the question as to why an author writes "of course" is that
this is mathematical shorthand for making an unjustified assertion that is
quite possibly wrong!]
A: The book is being lazy with this derivation, and the "of course" is meant as a bluff to make you not think very hard about why the next step is true.  It should read:
Then if there is some function $f(x,y)$ such that
$$
\frac{\partial f}{\partial x} = M\qquad\text{and}\qquad\frac{\partial f}{\partial y} = N\text{,}
$$
then we can rewrite the differential equation as
$$
\frac{\partial f}{\partial x}dx \,+\, \frac{\partial f}{\partial y}dy \;=\; 0.
$$
From the multivariable chain rule, we can recognize the left side of the equation as the total differential $df$ of the function $f$.  In particular, the equation states that $df = 0$, i.e. that $f$ is identically constant.  In other words,
$$
f(x,y) \;\equiv\; c.
$$
A: Beware the use of "of course", "easily" and "obviously" in math writing. Von Neumann reportedly said "Young man, in mathematics you don't understand things. You just get used to them." talking about the method of characteristics to one of his brilliant students. (The method of characteristics is essentially your question.)
Let me now try to answer your question in a few lines. Let's start by defining the symbols $dx$ and $dy$, you should (forget all the "small quantity" nonsense) and think of them as projection functions that go from $\mathbb R^2$ and return the first and second coordinates, e.g., $dx(1,3)=1$ and $dy(1,3)=3$.  In algebraic words, $dx$ and $dy$ are linear functionals on $\mathbb R^2$.  Denote by $V$ the set of all linear functionals on $\mathbb R^2$, then $dx$ and $dy$ are elements of $V$, which is known as the dual space of $\mathbb R^2$.
Now the dual of $\mathbb R^n$ is isomorphic to $\mathbb R^n$ (this is a nice exercise in linear algebra which you should attempt) and in fact $\{dx_1,\dotsc,dx_n\}$ is a basis of it.  (In the case $n=2$, we write $dx_1=dx$ and $dx_2=dy$.)  In particular, this means that $dx$ and $dy$ are linearly independent elements of $V$.  Hence, for any two real numbers, say $\mu$ and $\nu$ we have
$$\mu dx+\nu dy=0\Rightarrow\mu=\nu=0.$$  Now nothing prevents us from thinking that $\mu$ and $\nu$ depend on some parameter, for example a variable $(x,y)$ in $\mathbb R^2$, in which case linear independence means
$$\mu(x,y)dx+\nu(x,u)dy=0\:\forall(x,y)\quad\Rightarrow\quad \mu(x,y)=\nu(x,y)=0\:\forall(x,y).$$
