I'm asked to compute the gradient of a scalar function

$$h(x,y)=\begin{cases} y- \frac{\sin x}{x}, & x \neq 0; \\ y-1, & x=0 \end{cases}$$

So my thoughts are:

$$\textrm{grad}(h(x,y))=\left(\dfrac{x\cos x-x \sin x}{x^2},1\right), \quad x\neq0$$

Hence:

$$\textrm{grad}(h(0,y))=(0,1)$$

Formally looking at this, would it be safe to say that it is correct?

• Are you Roger Federer, for real? If not then this is impersonation. – OGC Aug 15 '15 at 20:26
• It is not impersonation... – user261396 Aug 15 '15 at 21:17
• Hehe You should've won the Wimbledon this year ;) – OGC Aug 15 '15 at 22:27

As Dr MV first pointed out, you are correct except there should be no multiplier of $x$ before $\sin x$, a fairly small error.
Both he and I are worried, though, that you may have arrived at the second equation, $\nabla h(0, y) = (0, 1)$ incorrectly. I hope that you got this from realizing that $\frac{x\cos x - \sin x}{x^2} \to 0$ as $x \to 0$, and not by differentiating $y - 1$ by $x$, which would be incorrect.