# All Roots of Two Systems of Algebraic Equations

All Roots of Two Systems of Algebraic Equations

This Demonstration illustrates how one can use NDSolve's WhenEvent option to determine the roots of a system of nonlinear algebraic equations: (x,y)=0 and (x,y)=0. An attractive feature of the method is that one does not need not need to know at the outset an approximate guess for the roots. All one needs to do is specify the solution domain , <y<.

f

1

f

2

:<x<

x

1

x

2

y

1

y

2

Consider the two test problems consisting of two-dimensional systems of algebraic equations:

1. (x,y)=+-1=0,

f

1

2

x

2

b

2

y

f

2

2. (x,y)=cos(bx)-axy+1=0,

f

1

f

2

You can vary the parameters and .

a

b

This Demonstration finds all the roots of these two problems in the range (for test problem 1) and (for test problem 2).

-20<x<20

0<x<10

The first contour plot is the graph of (x,y)=0 and (x,y)=0, and the second shows the level curves of +, which is minimized at a solution to the system.

f

1

f

2

f

1

2

(x,y)

f

2

2

(x,y)