Is $\arctan(x/y)$ a counterexample to the theorem of differentiability? My calculus book says 
If the partial derivatives $f_x$ and $f_y$ exist near $(a,b)$ and are continuous in $(a,b)$ then $f$ is differentiable in $(a,b)$.
However, I confused about whether $\arctan(x/y)$ is possible.
For example, at $x=3, y=0$, $f_x=-y/(x^2+y^2)$ and $f_y=x/(x^2+y^2)$ exist and continuous. So according to the theorem, it must be differentiable. But actually it isn't.(I can see this by software)
What is wrong with this problem?
Thank you.
 A: A necessary criterion for differentiability is continuity. $\arctan(x/y)$ isn't defined at, so can't be continuous at, $(3,0)$. 
The theorem you're referring to seems to be https://calculus.subwiki.org/wiki/Continuous_partials_implies_differentiable
Note that $(3,0)$ isn't in the domain of $\arctan(x/y)$, so this does not contradict the theorem as stated in full here. Remember to always look at the full statement of theorems, each assumption is important!
A: Points with their second component equal to $0$ are not even in the domain of this $f$, so it is not possible to talk about differentiability, or anything else, there.
Now understanding why this doesn't contradict the theorem requires a bit more, and requires some understanding of certain things that aren't stressed as much as they should be about functions, and one of these is making the proper distinction between the domain of a function, and domain of evaluatability of an expression describing the function.
In particular, the partial derivatives $f_x$ and $f_y$ here have the same domain as $f$, that is
$$\mathrm{dom}(f_x) = \mathrm{dom}(f_y) = \mathrm{dom}(f) = \mathbb{R} \setminus \{ (x, 0) : x \in \mathbb{R} \}$$
hence $(3, 0)$ is not in their domains, but the expressions
$$\frac{-y}{x^2 + y^2}\ \ \ \ \ \ \ \ \mbox{and}\ \ \ \ \ \ \ \ \frac{x}{x^2 + y^2}$$
that you use to describe $f_x$ and $f_y$ are evaluatable at points like $(3, 0)$, and this throws you off. The error you made was to plug that point into either expression, and technically that is an "illegal move" because the partial derivative functions in question do not have that point in their domains. Namely, say, the value  $0$ obtained for $f_x(3, 0)$ is nonsense. $f_x(3, 0)$ doesn't exist. The value you get from that expression has no meaning as a value of $f_x$ at that point.
Hence, the theorem, which requires partial derivative existence at $(3, 0)$, doesn't even get off the ground, and thus this is not a counterexample.
A: The problem is you haven't carefully considered the domain of the function. Let $U = \{(x,y) \in \Bbb{R}^2: y \neq 0\}$, and consider the function $f: U \to \Bbb{R}$ defined by
\begin{align}
f(x,y) = \arctan \left( \dfrac{x}{y} \right)
\end{align}
We have to impose the condition $y \neq 0$ in the definition of the set $U$ because otherwise, we would be dividing by zero in $x/y$, and we CANNOT do that.
Before we ask the question "is $f$ differentiable at the point $\alpha$?" we need to check whether $\alpha$ lies in the domain of $f$, because otherwise by definition, it just doesn't even make sense to ask this question. In your particular case, the point $(3,0) \notin U$, doesn't lie in the domain of $f$, hence $f$ is certainly not differentiable there.
A: I'd like to expand my comment to complement the other answers.
One should notice immediately that for $y=0$, the function $f(x,y) = \arctan(x/y)$ is not defined -- or in other words: the points $(x,0)$ for $x \in \mathbb R$ are not in the domain of $f$ -- , so one cannot talk of continuity or differentiability at those points.
However, sometimes that is a technicality. Look e.g. at the function
$$g(x,y) = \dfrac{x\sin(y)}{y}.$$
 For the same reason, it is not defined at any $(x,0)$. However, if that function is discussed, one might see talk of continuity and differentiability of it on the entire $\mathbb R^2$. The reason is that his function $g$ has removable discontinuities at those points; e.g. with Taylor expansions, it is easy to see that if one defines
$$\hat g(x,y) = \begin{cases} \dfrac{x\sin(y)}{y} \quad \text{ if } y\neq 0 \\
x \qquad \qquad \text{ if } y=0
\end{cases}$$
this new function is actually continuous and differentiable everywhere (check this!). In advanced texts, one might see this glanced over, and it would just be said that the function $g(x,y) =  \dfrac{x\sin(y)}{y}$ is differentiable everywhere.
Now, what I wanted to express in my comment is that our function $f$ is not even of this kind, i.e. contrary to $g$, we cannot "fill in" its graph at the points with $y=0$. That is because, e.g. for fixed $x > 0$, we have
$\lim_{y\to 0^+} \arctan(x/y) = \lim_{z\to \infty} \arctan(xz) = \pi/2$
$\lim_{y\to 0^-} \arctan(x/y) = \lim_{z\to -\infty} \arctan(xz) = -\pi/2$,
i.e. the limits from those two directions disagree, so we have non-removable discontinuities, and thus even in the sloppy sense which worked for $g$, we cannot say that $f$ has any chance to be continuous or even differentiable there. Check that an analogous argument works for $(x,0)$ with $x<0$. Finally, for the point $(0,0)$, at first sight one might think now because
$\lim_{y\to 0^-} \arctan(0/y) = \lim_{y\to 0^+} \arctan(0/y) = \arctan(0) = 0$,
maybe we can "fill in" $f(0,0) := 0$ and that would make it continuous and maybe even differentiable there. Can you see why this is not true?
