What is wrong with this surface? (principle directions) The surface is specified, for simplicity, using an explicit function $f(x,y)$:
$$
f: \mathbb{R}^2 \rightarrow \mathbb{R}
$$
The shape of this surface at point $[x=0,y=0]$ can be described by
figure. It shows the xy-plane, where black lines are straight lines with function value $f(black)=R$ and red lines are circles with the center at $[x=0,y=0]$ and radius equal to $R$.
I can construct this function by blending the plane function and sphere function according to the angle in polar coordinates using the following formula:
$$
f(\phi,r)=f_{blend}(\phi) \cdot f_{plane}(\phi,r)+(1-f_{blend}(\phi)) \cdot f_{sphere}(\phi,r)
$$
Where, i.e.:
$$
f_{blend}(\phi)=\frac{1}{2}\sin(4\phi)+\frac{1}{2}
$$
$$
f_{plane}(\phi,r)=R
$$
$$
f_{sphere}(\phi,r)=\sqrt{R^2-r^2}
$$
I am interested in principle curvatures at point $[x=0,y=0]$ and in principle directions. Since Euler's theorem says that principle directions should be perpendicular and principle curvatures should be the maximum and the minimum value of normal curvature at these points, there has to be some problem with the smoothness of this surface.
I tried to find partial derivatives for this instance and express the curvature as a function of angle coordinate:
$$
f(\phi,r)=(\frac{1}{2}\sin(4\phi)+\frac{1}{2}) \cdot R + (1-(\frac{1}{2}\sin(4\phi)+\frac{1}{2})) \cdot \sqrt{R^2-r^2}
$$
$$
\frac{\partial f(\phi,r)}{\partial r}=-\frac{r(\sin(4\phi)+1)}{2\sqrt{R^2-r^2}}
$$
$$
\frac{\partial^2 f(\phi,r)}{\partial r^2}=-\frac{\sin(4\phi)+1}{2R}
$$
For $r=0$ I get:
$$
\frac{\partial f(\phi,r=0)}{\partial r}=0
$$
$$
\frac{\partial^2 f(\phi,r=0)}{\partial r^2}=-\frac{\sin(4\phi)+1}{2R}
$$
If I use a formula for the curvature of a curve given by explicit function $y:f(x)$ to express the normal curvature as a function of angle coordinate, I get:
$$
k=\frac{\lvert y'' \rvert}{\sqrt{(1+(y')^2)^3}}
$$
$$
k(\phi)=\frac{\lvert -\sin(4\phi)+1 \rvert}{2R}
$$
This result says that the minimum and maximum values of normal curvature are not perpendicular. I know that it is wrong, and there is basically some problem with smoothness at this point, but I don't see what exactly it is.
 A: tl; dr: No twice continuously-differentiable function has a graph that contains both the coordinate axes and vertical circles lying above the lines $y = \pm x$. While the graph of the function $f$ (blue) may have a Gauss map, its Gauss map is not differentiable at the origin, so the shape operator at the origin need not be defined, much less have the "expected" properties guaranteed by Euler's theorem.


Let $f$ be a real-valued function of class $C^{2}$ defined in some neighborhood of the origin in the plane, and whose graph is tangent to the $(x, y)$ plane at the origin. The graph of the quadratic approximation is a plane, parabolic cylinder, elliptic paraboloid, or hyperbolic paraboloid. None of these surfaces has order-$2$ contact with all four of the curves specified, namely the coordinate axes and the two red circles: The only candidate for the two circles is an elliptic paraboloid, and this surface does not have order-$2$ contact with the coordinate axes.
(If it matters, to get the blue graph pictured we want to take the blending function to be $\frac{1}{2}(1 + \cos(4\phi))$ and the sphere function to be $R - \sqrt{R^{2} - r^{2}}$.)
