# 2.1 SOLUTION OF SYSTEMS OF POLYNOMIAL EQUATIONS

```# WORKSHEET#12
#
# SOLUTION OF SYSTEMS OF POLYNOMIAL EQUATIONS
#
#
> f:=x^4-2*x*y^2-y^3-2;g:=x*y^4+x^2*y^2-4;\

4        2    3
f := x  - 2 x y  - y  - 2

4    2  2
g := x y  + x  y  - 4
--------------------------------------------------------------------------------
> with(plots);

[animate, animate3d, conformal, contourplot, cylinderplot, densityplot,

implicitplot, implicitplot3d, loglogplot, logplot, matrixplot, odeplot,

pointplot, polarplot, polygonplot, polygonplot3d, polyhedraplot, replot,

setoptions, setoptions3d, spacecurve, sparsematrixplot, sphereplot,

surfdata, textplot, textplot3d, tubeplot]
--------------------------------------------------------------------------------
> F:=implicitplot(f,x=-4..4,y=-4..4):
--------------------------------------------------------------------------------
> G:=implicitplot(g,x=-4..4,y=-4..4):
--------------------------------------------------------------------------------
> display(F,title=`x^4-2*x*y^2-y^3=2`);display(G,title=`x*y^4+x^2*y^2=4`);\
display([F,G],title=`x^4-2*x*y^2-y^3=2 and x*y^4+x^2*y^2=4`);
--------------------------------------------------------------------------------
#

** Maple V Graphics **

#
--------------------------------------------------------------------------------

** Maple V Graphics **

#
>
--------------------------------------------------------------------------------

** Maple V Graphics **

--------------------------------------------------------------------------------
>
# The last plot indicates that there are 3 solutions.  In the plot window you can point and
# click to see what the coordinates are.  Try it now.  I got (x,y)=(1.562,0.9796),
# (1.417,-1.06) and (0.4386,-1.642).  We can use the solve command to fine exact solutions.
#
--------------------------------------------------------------------------------
> S:=solve({f,g},{x,y});

S := {y = %1,

367       17    15    2129    14    163   13    7453    12    1293   11
x = ---- %1 + ---- %1   - ------ %1   - ---- %1   - ------ %1   - ----- %1
1838      1838        117632        7352        235264        29408

727   10    6233   8   11563   6    2615   7   12329   4     67    16
+ ---- %1   - ----- %1  + ----- %1  - ----- %1  + ----- %1  + ----- %1
7352        29408       58816       29408       14704       29408

139   5    659   2    6599   9     255    18   1139           3
+ ---- %1  - ---- %1  + ----- %1  - ------ %1   + ---- + 2/919 %1
7352       7352       58816       117632        1838

1395    17
- ------ %1
235264

}

19       16       15       14        13       12       11
%1 := RootOf(_Z   + 2 _Z   + 2 _Z   + 7 _Z   + 16 _Z   + 4 _Z   - 4 _Z

10        8        7        4
+ 48 _Z   + 92 _Z  + 32 _Z  + 64 _Z  - 256)
--------------------------------------------------------------------------------
# This means that y is one of the 19 roots of the polynomial in Z and x is the stated
# expression in terms of the value of y.  Notice that %1 has been assigned a value by the use
# of the assignment symbol ":=", but x and y have not.  Check this.
#
--------------------------------------------------------------------------------
> %1;x;y;

19       16       15       14        13       12       11        10
RootOf(_Z   + 2 _Z   + 2 _Z   + 7 _Z   + 16 _Z   + 4 _Z   - 4 _Z   + 48 _Z

8        7        4
+ 92 _Z  + 32 _Z  + 64 _Z  - 256)

x

y
--------------------------------------------------------------------------------
# The next command assigns values S.
#
#
--------------------------------------------------------------------------------
> assign(S);
#
--------------------------------------------------------------------------------
> x;

367       17    15    2129    14    163   13    7453    12    1293   11
---- %1 + ---- %1   - ------ %1   - ---- %1   - ------ %1   - ----- %1
1838      1838        117632        7352        235264        29408

727   10    6233   8   11563   6    2615   7   12329   4     67    16
+ ---- %1   - ----- %1  + ----- %1  - ----- %1  + ----- %1  + ----- %1
7352        29408       58816       29408       14704       29408

139   5    659   2    6599   9     255    18   1139           3
+ ---- %1  - ---- %1  + ----- %1  - ------ %1   + ---- + 2/919 %1
7352       7352       58816       117632        1838

1395    17
- ------ %1
235264

19       16       15       14        13       12       11
%1 := RootOf(_Z   + 2 _Z   + 2 _Z   + 7 _Z   + 16 _Z   + 4 _Z   - 4 _Z

10        8        7        4
+ 48 _Z   + 92 _Z  + 32 _Z  + 64 _Z  - 256)
--------------------------------------------------------------------------------
> y;

19       16       15       14        13       12       11        10
RootOf(_Z   + 2 _Z   + 2 _Z   + 7 _Z   + 16 _Z   + 4 _Z   - 4 _Z   + 48 _Z

8        7        4
+ 92 _Z  + 32 _Z  + 64 _Z  - 256)
--------------------------------------------------------------------------------
# This has the side effect of changing the definitions of the functions f and g.
--------------------------------------------------------------------------------
> f;

367       17    15    2129    14    163   13    7453    12    1293   11
(---- %1 + ---- %1   - ------ %1   - ---- %1   - ------ %1   - ----- %1
1838      1838        117632        7352        235264        29408

727   10    6233   8   11563   6    2615   7   12329   4     67    16
+ ---- %1   - ----- %1  + ----- %1  - ----- %1  + ----- %1  + ----- %1
7352        29408       58816       29408       14704       29408

139   5    659   2    6599   9     255    18   1139           3
+ ---- %1  - ---- %1  + ----- %1  - ------ %1   + ---- + 2/919 %1
7352       7352       58816       117632        1838

1395    17          367       17    15    2129    14    163   13
- ------ %1  )^4 - 2 (---- %1 + ---- %1   - ------ %1   - ---- %1
235264              1838      1838        117632        7352

7453    12    1293   11    727   10    6233   8   11563   6    2615   7
- ------ %1   - ----- %1   + ---- %1   - ----- %1  + ----- %1  - ----- %1
235264        29408        7352        29408       58816       29408

12329   4     67    16    139   5    659   2    6599   9     255    18
+ ----- %1  + ----- %1   + ---- %1  - ---- %1  + ----- %1  - ------ %1
14704       29408        7352       7352       58816       117632

1139           3    1395    17    2     3
+ ---- + 2/919 %1  - ------ %1  ) %1  - %1  - 2
1838               235264

19       16       15       14        13       12       11
%1 := RootOf(_Z   + 2 _Z   + 2 _Z   + 7 _Z   + 16 _Z   + 4 _Z   - 4 _Z

10        8        7        4
+ 48 _Z   + 92 _Z  + 32 _Z  + 64 _Z  - 256)
--------------------------------------------------------------------------------
# The values previously assigned to x and y are used in computing f(x,y).  If we want to use
# the functions again we'll have to convert x and y back into variables.
--------------------------------------------------------------------------------
> X:=x:Y:=y:x:='x':y:='y':
--------------------------------------------------------------------------------
# The assigned values of x and y are saved in X and Y.  Then x and y are changed back into
# variables.  To find explicit numerical values for the intersection points we can do the
# folloeing.
--------------------------------------------------------------------------------
> allvalues(Y);

-1.647432204,  - 1.337971368 - .8833243765 I,  - 1.337971368 + .8833243765 I,

-1.057852433,  - .8832686595 - .7210045074 I,

- .8832686595 + .7210045074 I,  - .2558788231 - 1.256358136 I,

- .2558788231 + 1.256358136 I,  - .07576148742 - 1.477425325 I,

- .07576148742 + 1.477425325 I, .05303535957 - 1.209109819 I,

.05303535957 + 1.209109819 I, .8442838121 - .8587454679 I,

.8442838121 + .8587454679 I, .9961067967, 1.242260568 - .9836072175 I,

1.242260568 + .9836072175 I, 1.267889518 - .8320938192 I,

1.267889518 + .8320938192 I
--------------------------------------------------------------------------------
# Notice that we get 19 values, which we expect since we are solving a degree 19
# polynomial.  Only 3 of the roots are real; this agrees with our expectation that there are
# only 3 real intersection points.  Let's give a name to the degree 19 polynomial.
--------------------------------------------------------------------------------
> p:=op(Y);

19       16       15       14        13       12       11        10
p := _Z   + 2 _Z   + 2 _Z   + 7 _Z   + 16 _Z   + 4 _Z   - 4 _Z   + 48 _Z

8        7        4
+ 92 _Z  + 32 _Z  + 64 _Z  - 256
--------------------------------------------------------------------------------
> Yreal:=fsolve(p,_Z);

Yreal := -1.647432204, -1.057852433, .9961067967
#
--------------------------------------------------------------------------------
# To find the corresponding x values we substitute into the expression for X.
--------------------------------------------------------------------------------
> for k from 1 to 3 do Xreal[k]:=subs(%1=Yreal[k],X) od;

Xreal[1] := .46378423

Xreal[2] := 1.412154629

Xreal[3] := 1.572087242
--------------------------------------------------------------------------------
# This gives us our 3 real solutions.  We should verify that these are solutions by
# substituting back into the original polynomials.
--------------------------------------------------------------------------------
> for k from 1 to 3 do print(Xreal[k],Yreal[k],subs(x=Xreal[k],y=Yreal[k],f),subs(x=Xreal[k],y=Yreal[k],g)) od;

-7          -6
.46378423, -1.647432204, .68*10  , -.131*10

-7       -8
1.412154629, -1.057852433, .13*10  , .8*10

-7        -8
1.572087242, .9961067967, -.102*10  , -.4*10

```