> # 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);

RootOf(tan(_Z)+_Z)

> # That's not very informative. Try the alternative equation:

> solve( x*cos(x) + sin(x) = 0, x);

RootOf(tan(_Z)+_Z)

> evalf(%);

0.

> # 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) );

newton := proc (f, x) options operator, arrow; eval...

> # Define the recommended function for the Robin problem:

> robin := x -> x*cos(x) + sin(x);

robin := proc (x) options operator, arrow; x*cos(x)...

> # From the graph (p. 77 of notes) we know that the first root is near 2.

> newton(robin, 2);

2.029048281

> newton(robin, %);

2.028757866

> newton(robin, %);

2.028757838

> # Let's try for one of the larger roots.

> newton(robin, 7*Pi/2);

11.08651997

> newton(robin, %);

11.08553849

> # Now let's try the function used for the graph, but not advised for Newton.

> stupidrobin := x-> tan(x) + x;

stupidrobin := proc (x) options operator, arrow; ta...

> newton(stupidrobin, 7*Pi/2);

Error, (in tan) numeric exception: division by zero

> newton(stupidrobin, 7*3.15/2);

11.04484806

> newton(stupidrobin, %);

11.06719376

> newton(stupidrobin, %);

11.08182316

> newton(stupidrobin, %);

11.08538649

> newton(stupidrobin, %);

11.08553815

> newton(stupidrobin, %);

11.08553841

> newton(stupidrobin, 2);

2.027314579

> newton(stupidrobin, %);

2.028754298

> newton(stupidrobin, %);

2.028757838

> newton(stupidrobin, %);

2.028757838

> newton(stupidrobin, 4.6);

4.432798465

> newton(stupidrobin, %);

3.872631829

> newton(stupidrobin, %);

2.171838215

> newton(robin, 4.6);

4.947298366

> newton(robin, %);

4.913382393

> newton(robin, %);

4.913180447

> newton(stupidrobin, 7*3.14/2);

10.98408453

> newton(stupidrobin, %);

10.97114750

> newton(stupidrobin, %);

10.94020406

> newton(stupidrobin, %);

10.85171107

> newton(stupidrobin, %);

10.49412591

> newton(stupidrobin, %);

8.182004173

> newton(stupidrobin, %);

7.688929009

> newton(stupidrobin, %);

7.329004751

> newton(stupidrobin, %);

5.510977757

> # Where SHOULD this have gone?

> newton(robin, 10.494);

11.21275598

> newton(robin, %);

11.08625697

> newton(robin, %);

11.08553845

> evalf(%*2/Pi);

7.057272963

> newton(robin, 8.182);

7.980656170

> newton(robin, %);

7.978666191

> newton(robin, %);

7.978665712

> evalf(%*2/Pi);

5.079376347

>