What's wrong in computing the gradient like this? Say $u(x,y)=x^2+y^2$. Its gradient at (1,1) is (2,2).
Since I'm sure the gradient is directed towards y=x direction. I set y=x. Then $u(x,y)=2x^2=2y^2$. Now compute the gradient again. It's $\nabla u=(\partial_x u,\partial_y u)=(4x,4y)=(4,4)$.
So what goes wrong here?
 A: Recall the definition of the partial derivatives:
$$\partial_x u(x_0,y_0)=\lim_{h\to 0}\frac{u(x_0+h,y_0)-u(x_0,y_0)}{h},$$  and similarly for $\partial_y u$.  If you restrict $u$ exclusively to the line $y=x$, then this difference quotient cannot be found.  Even if $x_0=y_0$, notice that for all $h\neq 0$, $x_0+h\neq x_0$.  Therefore the correct computation of the partial derivative $\partial_x u(x_0,x_0)$ is 
$
\begin{align*}
\partial_x u(x_0,x_0)&=\lim_{h\to 0}\frac{u(x_0+h,x_0)-u(x_0,x_0)}{h}\\
&=\lim_{h\to 0}\frac{(x_0+h)^2+x_0^2-2x_0^2}{h}\\
&=\lim_{h\to 0}\frac{2x_0h+h^2}{h}\\
&=2x_0,
\end{align*}$
and similarly for $\partial_yu(x_0,x_0)$.

You could consider the single variable function $f(x):=u(x,x)$, but that is another story.  Its derivative tells you how $u$ changes along the line $y=x$.  In fact, $f'(x)$ is $\sqrt 2$ times the directional derivative of $u$ in the direction of the unit vector $(1/\sqrt 2,1/\sqrt 2)$, which can also be computed as $\nabla u(x,x)\cdot (1,1) = 4x$.
