\insertitre{A. Appendix.}{}
\section* {A. Appendix.}


Denoting by $\xi$ the direction orthogonal to the gradient of u, $\vert\nabla u\vert curv(u)$ is equal to $u_{\xi\xi}$.
{\bf Suppose now that the direction $\xi$ is known :}
$$ \xi = (-\sin \theta , \cos \theta)$$
Then, we can write
\fb& u_{\xi\xi} = \sin^2(\theta) u_{xx} - 2 \sin(\theta)\cos(\theta) u_{xy} + \cos^2(\theta)u_{yy} \fe&
We want to write $u_{\xi\xi}$ as a linear combination of the values of $u$ on the fixed stencil 3x3. Of course, the coefficients of the linear combination may depend on $\xi$.

Because the direction of the gradient (and then $\xi$) is defined modulo $\pi$, by symmetry we must assume that the coefficients of  points symmetrical with respect to the central point are the same. 

\begin{figure} [htb]
  \insertps{stencil2.ps} {50mm}{30mm}
\end{figure}


In order to have consistency, we must find $\lambda_0 , \lambda_1 , \lambda_2 , \lambda_3, \lambda_4$, such that :
\fb& \label{KKK}
u_{\xi\xi} = \frac{1}{\Delta x^2} ( -4 \lambda_0 u_{i,j} + \lambda_1 (u_{i+1,j} +u_{i-1,j}) + \lambda_2 (u_{i,j+1} +u_{i,j-1}) 
\fe&
$$
    \qquad + \lambda_3 (u_{i-1,j-1} +u_{i+1,j+1}) +\lambda_4 (u_{i-1,j+1} +u_{i+1,j-1}))
+o(1)
$$
We write 
$$ u_{i+1,j} = u_{i,j} + h (u_x)_{i,j} +\frac{h^2}{2} (u_{xx})_{i,j} + o(\Delta x^2) ,$$
and the same relation for the other points of the stencil. By feeding (12) with these relations and by using relation (11), we obtain four relations between our five coefficients

$$\left\{
\begin{array}{l} 
 \lambda_1(\theta) = 2 \lambda_0(\theta) - \sin^2\theta \\
 \lambda_2(\theta) = 2 \lambda_0(\theta) - \cos^2\theta \\
 \lambda_3(\theta) = - \lambda_0(\theta) + 0.5(\sin \theta \cos \theta + 1) \\
 \lambda_4(\theta) = - \lambda_0(\theta) + 0.5(-\sin \theta \cos \theta + 1) \end{array}
\right. $$

It remains only one degree of freedom for our coefficients : for example the choice of $\lambda_0$.

Now, in order to have the \STAB, we must have  
$$4\lambda_0 \geq 2( \vert \lambda_1 \vert + \vert \lambda_2 \vert + \vert \lambda_3 \vert +  \vert \lambda_4 \vert) $$
Now, since $2\lambda_1 + 2\lambda_2 + 2\lambda_3 + 2\lambda_4 - 4\lambda_0 = 0$,  $\lambda_1, \lambda_2, \lambda_3, \lambda_4$ must be nonnegative.

But, because of the relations between our coefficients, it is impossible to assume such a thing, except for particular values of $\theta ( 0,\frac{\pi}{4}, \frac{\pi}{2},...)$.

Then, for the choice of $\lambda_0$, we impose the \STAB, for the particular values of $\theta$, when we can have it. We have
$$ \lambda_0(0) = 0.5 $$
$$ \lambda_0(\frac{\pi}{4}) =0.25 $$

\vspace{2mm}
\noindent Then, we impose some obvious geometric invariance properties.

\skipaline

Symmetry with respect to the central point,
$$(i) \qquad \lambda_0(\theta +\pi) = \lambda_0(\theta)$$

Invariance by rotation of angle $\frac{\pi}{4}$,
$$(ii) \qquad \lambda_0(\theta +\frac{\pi}{2}) = \lambda_0(\theta)$$

Symmetry with respect to the axis i+j,
$$(iii) \qquad \lambda_0(\frac{\pi}{2}-\theta) = \lambda_0(\theta)$$

\noindent Of course, we seek for a smooth function for $\lambda_0(\theta)$. We shall take it $C^1$. Then,

$$(i) \Rightarrow \lambda_0'(0) =0 \qquad \hbox{ and } \qquad (iii) \Rightarrow \lambda_0'(\frac{\pi}{4})= 0$$
Moreover, $(i)$  and $ (ii)$ imply that $\lambda_0$ is $\frac{\pi}{2}$-periodic, and symmetric with respect to $\frac{\pi}{4}$. We shall now study it on $[0,\frac{\pi}{4}]$.


Let us summarize :
we are looking for a function $\lambda_0$ on the interval $[0,\frac{\pi}{4}]$, such that
\fb& \label{KLF} \left\{
\begin{array}{l}
\lambda_0(0) = 0.5 \\
\lambda_0(\frac{\pi}{4}) =0.25 \\
\lambda_0'(0) =0 \\
\lambda_0'(\frac{\pi}{4})= 0 \\
\lambda_1, \;  \lambda_2, \;  \lambda_3, \;  \lambda_4 \hbox{ as ``positive" as possible} \\
\end{array}
\right.
\fe&
We remark that for $\theta$ in $[0,\frac{\pi}{4}]$, 
$$ \lambda_1 \geq \lambda_2 \qquad \hbox{and} \qquad \lambda_3 \geq \lambda_4 $$
But 
$$ \lambda_2(\theta) \ge 0 \Rightarrow \lambda_0(\theta) \geq \frac{\cos^2(\theta)}{2} $$
$$ \lambda_4(\theta) \ge 0 \Rightarrow \lambda_0(\theta) \leq 
\frac{1 -\sin(\theta)\cos(\theta)}{2}$$
So, we cannot find $\lambda_0(\theta)$ satisfying both inegalities, since
$$ \frac{\cos^2(\theta)}{2} \geq \frac{1 -\sin(\theta)\cos(\theta)}{2}$$
Then, if we choose $\lambda_0(\theta) \geq \frac{\cos^2(\theta)}{2}$ we have $\lambda_4(\theta)$ very negative. If we take $\lambda_0(\theta) \leq 
\frac{1 -\sin(\theta)\cos(\theta)}{2}$ we obtain $\lambda_2(\theta)$ very negative.

We prefer to choose $\lambda_0$ between both functions, and then to have $\lambda_2$ and $\lambda_4$ negative, but slightly.
(see figure above.)

\vspace{2mm}
The periodicity of $\lambda_0$ leads us to choose it as a trigonometric polynomial, of degree as small as possible for numerical simplicity.
The simplest polynomial verifing (\ref{KLF}), and between both functions is
$$ 0.5 - \cos^2(\theta) +\cos^4(\theta) $$

\begin{figure}
\begin{center}
\input{courbe.tex}
\end{center}
\end{figure}

We deduce the others $\lambda$'s:

$$
\left\{
\begin{array}{l}
-4 \lambda_0 = -2 + 4 \cos^2(\theta)\sin^2(\theta) \\
\lambda_1 = \cos^2(\theta) (\cos^2(\theta) - \sin^2(\theta)) \\
\lambda_2 = \sin^2(\theta) (\sin^2(\theta) - \cos^2(\theta)) \\
\lambda_3 = \cos^2(\theta)\sin^2(\theta) + 0.5 \sin(\theta)\cos(\theta) \\
\lambda_4 = \cos^2(\theta)\sin^2(\theta) - 0.5 \sin(\theta)\cos(\theta) \\
\end{array}
\right.
$$
We shall find the above coefficients by a faster method.
\vspace{5mm}

{\bf A polynomial basis approach.}


We still consider the stencil 3x3. And, we want now to have
 an estimate of the second derivative of u in the direction $\xi$, exact for a set of polynomials.
Of course, we want the degree of polynomials as high as possible.

In order to have \CONS, we want at least the polynomials of degree two. that gives us six
 independant relations on our $\alpha_{ij}$.

We remark that on our stencil $x^3 = x$ and $y^3 = y$ and 
that $(x)_{\xi\xi} = (x^3)_{\xi\xi} = (y)_{\xi\xi} = (y^3)_{\xi\xi} = 0 $. 
Then, our calcul will be exact for the two more polynomials : $x^3$ and $y^3$.

The polynomial $x^2y$ and $y^2x$ give us two other independent relations.

It remains us only one degree of freedom, we can choose one more polynomial.
We choose, in order two have the coefficients defined before, the polynomial
$$(x^2+y^2)(x \sin\theta - y \cos\theta ) ^2$$


Then our estimation of $u_{\xi\xi}$, is exact for all the linear combinations of the polynomials
 of degree 0,1,2 and 3, plus the polynomial :$(x^2+y^2)(x \sin\theta - y \cos\theta ) ^2$. Of course, 
 the calculus can be false for the other polynomials.
