Consider the map $f:\mathbb R^2\to \mathbb R$ defined as
$$ f(x,y)=\begin{cases}
\|(x,y)\|^2\sin(1/\|(x,y)\|) & (x,y)\neq0 \\
0 & (x,y) =0\\
\end{cases}$$
I am trying to get a plot like this:
This is the code I wrote
f[x1_, x2_] :=
Piecewise[{{(Norm[x1, x2])^2 Sin[1/(Norm[x1, x2])],
x1 != 0 && x2 != 0}}];
Plot3D[f[x1, x2], {x1, -5, 5}, {x2, -5, 5}]
But it didn't work.
I am wondering how I can plot and differentiate this map.
Thanks in advance!
Norm[{x1, x2}]
instead ofNorm[x1, x2]
. $\endgroup$