To draw a circle of radius \(r\) on a graphics screen, one may proceed to
evaluate pairs of values \(x=r \cos (\theta), y=r \sin (\theta)\) for a
succession of values \(\theta\). But this is computationally expensive. A
cheaper method may be obtained by considering the \(\mathrm{ODE}\)
$$
\begin{array}{lc}
\dot{x}=-y, & x(0)=r, \\
\dot{y}=x, & y(0)=0
\end{array}
$$
where \(\dot{x}=\frac{d x}{d \theta}\), and approximating this using a simple
discretization method. However, care must be taken to ensure that the obtained
approximate solution looks right, i.e., that the approximate curve closes
rather than spirals.
Carry out this integration using a uniform step size \(h=.02\) for \(0 \leq
\theta \leq 120\), applying forward Euler, backward Euler, and the implicit
trapezoidal method. Determine if the solution spirals in, spirals out, or
forms an approximate circle as desired. Explain the observed results. [Hint:
This has to do with a certain invariant function of \(x\) and \(y\), rather than
with the accuracy order of the methods.]