newton.mws

The the main usefulness of linearizing: approximating where f is zero. newton.mws JR Jan 8, 2002

If the linearization L of f at (x0,y0) approximates f pretty well in some neighborhood (pink) of (x0,y0),

then in that neighborhood, the level curves of L can usually be expected to approximate pretty well the level curves of f .
Example:

> with(plots):
f:=x^2+2*y^2-4.5;
x0:=2; y0:=1;
L:=subs(x=x0,y=y0,f) + subs(x=x0,y=y0,diff(f,x))*(x-x0)
+ subs(x=x0,y=y0,diff(f,y))*(y-y0);
pC:=plottools[disk]([x0,y0],0.4,color=pink):
p0:=plottools[point]([x0,y0],color=black,symbol=diamond):
levels:=[-1,0,1,2,3,4,5];
pf:=contourplot(f,x=1.5..2.5,y=0.5..1.5,contours=levels,color=red):
pL:=contourplot(L,x=1.5..2.5,y=0.5..1.5,contours=levels,color=blue):
display(pf,pL,p0,pC,scaling=constrained);

f := x^2+2*y^2-4.5

x0 := 2

y0 := 1

L := -10.5+4*x+4*y

levels := [-1, 0, 1, 2, 3, 4, 5]

[Maple Plot]


If the
zero -level curve of f passes through that neighborhood, then in that neighborhood,

the zero-level curve of L gives us a good straight-line approximation to the zero-level curve of f .

> levels:=[0];
pf:=contourplot(f,x=1.5..2.5,y=0.5..1.5,contours=levels,color=red):
pL:=contourplot(L,x=1.5..2.5,y=0.5..1.5,contours=levels,color=blue):
display(pf,pL,p0,pC,scaling=constrained);

levels := [0]

[Maple Plot]

Zoom out to see that the approximation is only good locally:

> pf:=implicitplot(f=0,x=-3..3,y=-2..2,thickness=1):
pL:=implicitplot(L=0,x=-3..3,y=-2..2,thickness=1,color=blue):
display(pf,pL,p0,pC,scaling=constrained);

[Maple Plot]

Using linearization to (approximately) solve systems of nonlinear equations

Now suppose we want to solve two simultaneous nonlinear equations. For example:

>

x^2-x*y+2*y^2-4 = 0

x^2+y^2-4 = 0

This is the same as saying we want to find an intersection point of the zero-level curves of the two left-hand sides (call them f1 and f2):

> restart:
f1:=expand( x^2-x*y +2*y^2-4 );
f2:=x^2+y^2-4;

f1 := x^2-x*y+2*y^2-4

f2 := x^2+y^2-4

We can approximate this point by the point at which the zero-level curves of the two linearizations intesect.
This point is easy to find: we just solve two simultaneous
linear equations:

> x0:=1; y0:=2;
with(plots):
p0:=plot([[x0,y0]],style=point,symbol=diamond,color=black):
pC:=plottools[disk]([x0,y0],0.8,color=pink):
r:=1.5;
f10:=subs(x=x0,y=y0,f1);
L1:=f10+subs(x=x0,y=y0,diff(f1,x))*(x-x0)
+subs(x=x0,y=y0,diff(f1,y))*(y-y0);
pf1:=implicitplot(f1,x=x0-r..x0+r,y=y0-r..y0+r):
pL1:=implicitplot(L1,x=x0-r..x0+r,y=y0-r..y0+r,color=blue):
f20:=subs(x=x0,y=y0,f2);
L2:=f20+subs(x=x0,y=y0,diff(f2,x))*(x-x0)
+subs(x=x0,y=y0,diff(f2,y))*(y-y0);
pf2:=implicitplot(f2,x=x0-r..x0+r,y=y0-r..y0+r):
pL2:=implicitplot(L2,x=x0-r..x0+r,y=y0-r..y0+r,color=blue):
display(p0,pf1,pL1,pf2,pL2,pC,scaling=constrained);

x0 := 1

y0 := 2

r := 1.5

f10 := 3

L1 := -11+7*y

f20 := 1

L2 := -9+2*x+4*y

[Maple Plot]

> solve({L1=0,L2=0});
evalf(%);

{y = 11/7, x = 19/14}

{y = 1.571428571, x = 1.357142857}

Clearly from the picture above, we our accuracy is not that good.
However, we are
closer to the point we seek, and now we could linearize at this point, and repeat the procedure:
that will get us much closer.

The process of repeatedly linearizing and moving to the zero of the linearization (until you decide you're close enough)
is called
Newton's method for solving simultaneous nonlinear equations.

This is in fact the method that Maple's solve command uses to solve such systems of equations:

> solve({f1=0.0,f2=0.0});

{x = -1.414213562, y = -1.414213562}, {x = 1.414213...

Note that simultaneous nonlinear equations can have more than one solution, and to home in on one of them you often need to start with a decent guess at it (x0,y0).