> # ROBIN STURM-LIOUVILLE EIGENVALUES BY NEWTON'S METHOD
>
> # First let's see if Maple can solve the problem already.
> # Take both constants = 1 ("omega" and "beta" in notes).
> solve( tan(x) = - x, x);
> # That's not very informative. Try the alternative equation:
> solve( x*cos(x) + sin(x) = 0, x);
> evalf(%);
> # This is the one root we are NOT interested in.
>
> # Let's write a generalized Newton iteration function.
> newton := (f,x) -> evalf( x - f(x)/D(f)(x) );
> # Define the recommended function for the Robin problem:
> robin := x -> x*cos(x) + sin(x);
> # From the graph (p. 77 of notes) we know that the first root is near 2.
> newton(robin, 2);
> newton(robin, %);
> newton(robin, %);
> # Let's try for one of the larger roots.
> newton(robin, 7*Pi/2);
> newton(robin, %);
> # Now let's try the function used for the graph, but not advised for Newton.
> stupidrobin := x-> tan(x) + x;
> newton(stupidrobin, 7*Pi/2);
Error, (in tan) numeric exception: division by zero
> newton(stupidrobin, 7*3.15/2);
> newton(stupidrobin, %);
> newton(stupidrobin, %);
> newton(stupidrobin, %);
> newton(stupidrobin, %);
> newton(stupidrobin, %);
> newton(stupidrobin, 2);
> newton(stupidrobin, %);
> newton(stupidrobin, %);
> newton(stupidrobin, %);
> newton(stupidrobin, 4.6);
> newton(stupidrobin, %);
> newton(stupidrobin, %);
> newton(robin, 4.6);
> newton(robin, %);
> newton(robin, %);
> newton(stupidrobin, 7*3.14/2);
> newton(stupidrobin, %);
> newton(stupidrobin, %);
> newton(stupidrobin, %);
> newton(stupidrobin, %);
> newton(stupidrobin, %);
> newton(stupidrobin, %);
> newton(stupidrobin, %);
> newton(stupidrobin, %);
> # Where SHOULD this have gone?
> newton(robin, 10.494);
> newton(robin, %);
> newton(robin, %);
> evalf(%*2/Pi);
> newton(robin, 8.182);
> newton(robin, %);
> newton(robin, %);
> evalf(%*2/Pi);
>