0% found this document useful (0 votes)
23 views

Chapter 1

Uploaded by

Kariim Diíb
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
23 views

Chapter 1

Uploaded by

Kariim Diíb
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 14

1

Introduction

1.1. Local solution - Numeric solution


In case of nonlinear systems there can be no solution, one solution or frequently many solutions. Employing numerical solution one
requires iteration technique starting from a guess value. The guessed value together with the iteration method will determined the success
of the computation process. Let us consider a multivariate polynomial system { f(x,y), g(x,y)}.
f = (x - 2)2 + (y - 3)2 - 5 (1.1)
1 2 3 2
g= x- + y- -5 (1.2)
2 4

This actual problem has two real solutions


6

-2

-2 0 2 4 6
Fig. 1.1 Geometrical representation of a multivariate polynomial system

Local solution employs a guess value and iterates. You will get one of the solutions. Employing quess values {4, -1} and Newton - method
to iterate,
the solution is
{x  2.73186, y  0.887092}

Substituting this result into the equations,


- 1.77636 × 10-15, - 1.83881 × 10-16

The results of the iteration steps are,


{{4., - 1.}, {3.28571, 0.517857}, {2.8072, 0.836864}, {2.73368, 0.885877},
{2.73186, 0.887092}, {2.73186, 0.887092}, {2.73186, 0.887092}}

The number of the iterations is


7

Let us visualize the iteration steps,


2

-2

-2 0 2 4 6
Fig. 1.2 Local solution with initial guess and iteration

However, if the initial guess is not proper - for example {0, 0} - then, we may have problem
FindRoot::jsing : Encountered a singular Jacobian at the point {x, y} = {0., 0.}. Try perturbing the initial point(s). 

1.2. Global solution - Symbolic solution


First let us transform the original system into another one, which has the same solutions, but the equations can be solved independently.
Employing Gröbner basis we can reduce one of the equation to a univariate equation.
{2113 - 3120 y + 832 y2 , - 65 + 16 x + 24 y}

Then we got both solution without guessing initial value and without iteration. Solving the second order system first,
1 1
y  195 - 2 2639 , y  195 + 2 2639 
104 104
Then employing these roots for y, the corresponding values of x can be computed from the second equation,
1
x  130 + 3 2639 
104
1
x  130 - 3 2639 
104
Let us visualize the two solutions
6

-2

-2 0 2 4 6
Fig. 1.3 Global solution - all solution without initial guess and iteration

Althoug symbolic technique seems very elegant here, but if the system is complicated, there too many variables symbolic global solution
techniques (Gröbner basis, Dixon resultant) can fail. This difficulty may be overcome by global numerical methods, like homotopy
method!
1
Solution of algebraic polynomial systems

1.1 The zeros of Polynomial Systems


Let us consider the following polynomials
p = 2 x + x3 y2 + y2 (1.1)

The monomials are x3 y2, with coefficient 1, and x1y0 with coefficient 2 and x0, y2 with coefficient 1. The degree of such a monomial is
defined as the sum of the involved exponents of the variables. For example, the second monomial x3 y2 , has degree 3 + 2 = 5, etc. The
degree of the polynomial is the maximum degree of its constituent monomials. In this case deg (p) = max( 5, 1, 2) = 5.
Now considering a polynomial system like
g (x, y) = a1 + a2 x + a3 x y + a4 y (1.2)

h (x, y) = b1 + b2 x2 y + b3 x y2 (1.3)

The total degree of the system is


deg (g) deg (h) = 2 * 3 = 6 (1.4)

Bézout’ s Theorem: Consider two polynomial equations in two unknowns: g(x,y) = h(x,y) = 0. If this system has only finitely many zeros
(x, y)∈ 2 , then the number of zeros is at most deg(g)* deg(h). Here deg(g) and deg(h) are the total degree of g(x,y) and h(x,y).

1.2 The Resultant Methods


In this section two different symbolic methods will be introduced: Sylvester and Dixon resultants. These techniques eliminate variables
and result univariate polynomials, which then can be solved numerically.

1.2.1 Sylvester Resultant


Let us consider the following system
p = x y - 1; g = x2 + y2 - 4;
2

Fig. 2.1 Graphical interpretation of the real roots of the system

We are looking for the solution in the following form


x0
-
M (y) x1 = 0 (1.5)
x2

namely
-1 y 0 x0
-
y2 - 4 0 1 x1 = 0 (1.6)
   x2

We need a third equation (polynomial) ! This should be linearly independ from p(x), let say x p(x). Since
x p // Expand

- x + x2 y

Then
-1 y 0
M (y) = y2 - 4 0 1 (1.7)
0 -1 y

The homogeneous system (2.6) has solution if


det (M (y)) = 0 (1.8)

Therefore
-1 y 0
Det y2 - 4 0 1 
0 -1 y
- 1 + 4 y2 - y4

Employing built in function


Resultant[p, g, x]

1 - 4 y2 + y4

For the other variable


Resultant[p, g, y]

1 - 4 x2 + x4

The solutions of these two polynomials are the solutions of the system {p (x, y), g (x, y)}.
Roots[- 1 + 4 y2 - y4  0, y]

y 2- 3 || y  - 2- 3 || y  2+ 3 || y  - 2+ 3

Roots[1 - 4 x2 + x4  0, x]

x 2- 3 || x  - 2- 3 || x  2+ 3 || x  - 2+ 3

These solutions can be computed directly via the built function Solve, too
sol = Solve[{p  0, g  0}, {x, y}]
3/2
x  - 2- 3 , y  -4 2- 3 + 2 - 3  ,
3/2
x  2- 3 ,y4 2- 3 - 2 - 3  ,
3/2
x  - 2+ 3 , y  -4 2+ 3 + 2 + 3  ,
3/2
x  2+ 3 ,y4 2+ 3 - 2 + 3  

Indeed these are solutions


3

{p, g} /. sol // Simplify

{{0, 0}, {0, 0}, {0, 0}, {0, 0}}


Remark
3/2
FullSimplify- 4 2- 3 + 2 - 3  

- 2+ 3

The main handicap of the Sylvester resultant that it can be employed only for systems of two polynomials.

1.2.2 Dixon Resultant


Let us introduce a parameter b and define the following polynomial
p (x, y) g (x, b) - p (x, b) g (x, y)
δ (x, y, b) = (1.9)
y-b

We call this polynomial as Dixon - polynomial,


p (g /. y  b) - (p /. y  b) g
// Simplify
y-b
b - 4 x + x3 + y - b x y

The roots of the system {p (x, y), g (x, y)} is the same as the roots of this Dixon polynomial for any value of the parameter b. The Dixon
polynomial can be written as
δ (x, y, b) = b0 -4 x + x3 + y + b1 (1 - x y) (1.10)

Then the following homogeneous linear system should have solution for every b
-4 x + x3 + y = 0
1- x y = 0
or

-4x +x
3 1  y0 = 0
1 -x y1
therefore
- 4 x + x3 1
Det 
1 -x
- 1 + 4 x2 - x4

should be zero. The matrix


3
-4x +x 1 
1 -x
is called as Dixon matrix, and its determinant is called as Dixon resultant
Let us employ built in function
In[72]:= << Resultant`Dixon`

DixonPolynomial[{p, g}, {y}, {b}]

b - 4 x + x3 + y - b x y

DixonMatrix[{p, g}, {y}, {b}] // MatrixForm


3
 -4 x + x
1 
1 -x
DixonResultant[{p, g}, {y}, {b}]

- 1 + 4 x2 - x4

Similarly for the other variable, we get


DixonResultant[{p, g}, {x}, {a}]
4

- 1 + 4 y2 - y4
Remark

Here a and b are dummy formal variables, should be symbolic variables without assigned values.
Dixon reultant method can be applied to polynomial systems of more than two polynomials, too.
P = x + y + z;

G = x - 2 y + z3 ;

S = x2 - 2 y3 + z;

To eliminate variables x and y, we introduce dummy variables X and Y, then


DixonResultant[{P, G, S}, {x, y}, {X, Y}] // Expand

324 z + 144 z2 + 24 z3 + 144 z4 - 72 z5 + 36 z6 + 72 z7 - 24 z9

or
% / 12 // Expand

27 z + 12 z2 + 2 z3 + 12 z4 - 6 z5 + 3 z6 + 6 z7 - 2 z9

1.3 Gröbner Basis


This technique introduced by Buchberger and named after his PhD supervisor Gröbner, is more general and efficient than the resultant
methods are. To have an idea how this method works first, let us see how the greatest common divisior of polynomials can be defined

1.3.1 Greatest Common Divisior of Polynomials


Let us consider two univariate polynomials s (x) és v (x)
s = 8 + 22 x + 21 x2 + 8 x3 + x4 ;

v = 6 + 11 x + 6 x2 + x3;

The geatest common divisior (GCD) of these polynomials


gcd = PolynomialGCD[s, v]

2 + 3 x + x2

Let us divide s (x) with this GCD


{{Cs}, Rs} = PolynomialReduce[s, gcd, x]

{{4 + 5 x + x2 }, 0}

The remainder is zero and


Cs gcd

(2 + 3 x + x2) (4 + 5 x + x2 )

Expand[%]

8 + 22 x + 21 x2 + 8 x3 + x4

Let us carry out these operations with v (x) , too


{{Cv}, Rv} = PolynomialReduce[v, gcd, x]

{{3 + x}, 0}

and
Cv gcd

(3 + x) (2 + 3 x + x2 )

Expand[%]

6 + 11 x + 6 x2 + x3
5

This means that the original polynomials s(x) and v(x) can be expressed as the linear combination of the GCD, like
s(x) = Cs(x) gcd(x) + 0 gcd(x)
and
v(x) = 0 gcd(x) + Cv(x) gcd(x)
or
 s (x)  =  Cs (x) 0  gcd (x)
(1.11)
v (x) 0 Cv (x)

It is clear that the roots of the gcd(x), the GCD of these two polynomials { s(x), v(x)} are the roots of the polynomial system, namely the
roots of gcd = 2 + 3 x + x2 = 0

1.5

1.0

0.5

-2.0 -1.5 -1.0 -0.5


-0.5

-1.0

-1.5

Fig. 2.2 Common roots of polynomials

However, we have polynomials of two variables (x, y)


p

-1 + x y

- 4 + x2 + y2
In case of more than one variables the greatest common divisior is the Gröbner basis
{G1, G2} = GroebnerBasis[{p, g}, {x, y}]

{1 - 4 y2 + y4 , x - 4 y + y3 }

A kétváltozós rendszer kifejezhető a Gröbner-bázis polinomjainak lineáris kombinációjaként, ahol az együtthatók maguk is polinomok.
Ennek alapján a p(x,y) polinom kifejezhető. Osszuk el a p(x) polinomot a Gröbner bázis polinomjaival
Then similarly to the case of inivariate case, in case of two variables (x, y), the original system can be expressed as the linear combination
of the polynomials of the Gröbner basis {G1 (y), G2(x,y)}, where the coefficients are also polynomials. The coefficients are the
remainders.
{c1, r1} = PolynomialReduce[p, {G1, G2}, {x, y}]

{{-1, y}, 0}

Then p(x, y) can be expressed as


{- 1, y}. G1  // Simplify
G2
{- 1 + x y}

and
{c2, r2} = PolynomialReduce[g, {G1, G2}, {x, y}]

{{-4 + y2 , x + 4 y - y3 }, 0}

then g(x, y)
6

G1
{- 4 + y2 , x + 4 y - y3 }.  // Simplify
G2
{- 4 + x2 + y2 }

In matrix form
-1 y
 p (x, y)  =    G1 (y) 
g (x, y) -4 + y2 x + 4 y - y3 G2 (x, y)

or
p (x, y) -1 y
 =  G1 (y) +   G2 (x, y) (1.12)
g (x, y) -4 + y2 x + 4 y - y3

The roots of the system {p(x,y),g(x,y)} are the same as the roots of the system {G1(y), G2(x,y)}. Let us realize that this basis consists of
special polynomials, since G1(y) is a univariate polynomial!
In generally speaking, the original polynomial system {p(x,y),g(x,y)} can be expressed as the linear combination of the basis polynomials
{G1(x,y) , G2(x,y)}.
There are many other basis polynomials, too and the set of these basis polynomials is called the ideal of the original polynomial. However,
the Gröbner basis is a special basis, since one of its polynomials is a univariate one! If the Gröbner basis is 1, the polynomials have no
common divisiors, consequently they have no common roots.

Let us employ the built-in function for the system {P, S, G} considered in Section 2.2.2
GroebnerBasis[{P, S, G}, {x, y, z}]

{- 27 z - 12 z2 - 2 z3 - 12 z4 + 6 z5 - 3 z6 - 6 z7 + 2 z9 , 3 y + z - z3 , 3 x + 2 z + z3 }

which is the same result provided by the Dixon resultant.

Now, let us compute the Gröbner basis of the following system


U = x2 + y2  1

x2 + y2  1

V = x2 + y2 == 2

x2 + y2  2

GroebnerBasis[{U, V}, {x, y}]

{1}

There is no common roots, see Fig. 2.3, however the upper limit of the number of roots is 2 × 2 = 4.

-1

-2

-2 -1 0 1 2
Fig. 2.3 No common roots of polynomials

1.3.2 Reduced Gröbner Basis


The Mathematica built in function can carry out the elimination process too, empploying so called reduced Gröbner Basis.
7

To get the univariate polynomial of x, we should eliminate y and z,


grbx = GroebnerBasis[{P, S, G}, {x}, {y, z}]

{- 27 x + 18 x2 - 342 x3 + 306 x4 - 186 x5 + 229 x6 - 18 x7 + 12 x8 + 8 x9 }

and similarly for the other variables,


grby = GroebnerBasis[{P, S, G}, {y}, {x, z}]

{- 21 y - 23 y2 - 30 y3 - 36 y4 - 9 y5 + 6 y6 - 12 y7 + 8 y8 }

grbz = GroebnerBasis[{P, S, G}, {z}, {x, y}]

{- 27 z - 12 z2 - 2 z3 - 12 z4 + 6 z5 - 3 z6 - 6 z7 + 2 z9 }

1.4 Applications

1.4.1 Nonlinear heat conduction

Problem

Let consider a 1D steady-state heat conduction problem in a slab with temperature dependent heat conductuion coefficient,
d dθ
λ (θ) =0
dx dx
The boundary conditions are
θ (0) = 0 és θ (1) = 1
and
λ (θ) = 1 + k θ

Let us employ the following trial function for the temperature profile

θ (x) = x + c1 x2 - x + c2 x3 - x

which satisfies the boundary conditions.


The unknown coefficients c1 and c2 should be computed, in a way that the global error is minimized.

Solution

In[86]:= Clear["Global`*"]

The heat condution coeffient


In[87]:= λ = 1+kθ

Out[87]= 1+kθ

The trial function


In[88]:= θ = x + c1 (x2 - x) + c2 (x3 - x)

Out[88]= x + (- x + x2 ) c1 + (- x + x3 ) c2

To get local error, let us substitute it into the differential equation


In[89]:= eq = D[λ D[θ, x], x] // Expand

Out[89]= k + 2 c1 - 2 k c1 + 6 k x c1 + k c21 - 6 k x c21 + 6 k x2 c21 - 2 k c2 + 6 x c2 + 12 k x2 c2 +


2 k c1 c2 - 6 k x c1 c2 - 12 k x2 c1 c2 + 20 k x3 c1 c2 + k c22 - 12 k x2 c22 + 15 k x4 c22

The global error is the integral of the square of the local error
8

1
In[90]:= r =  eq2  x
0

1
Out[90]= k2 + 4 k c1 + 2 k2 c1 + 4 c21 + 4 k c21 + 4 k2 c21 + k2 c41 + 6 k c2 + 4 k2 c2 +
5
4 6
12 c1 c2 + 20 k c1 c2 + 16 k2 c1 c2 + k2 c21 c2 + k2 c31 c2 + 12 c22 + 24 k c22 +
5 5
84 12 20 64 111 48
k2 c22 + k2 c1 c22 + k2 c21 c22 + k2 c32 + k2 c1 c32 + k2 c42
5 5 7 35 35 35
Now we should minimized this r (c1 ,c2, k) function respect to c1 and c2. Considering the necessary conditions,
In[91]:= eq1 = D[r, c1 ]
4
Out[91]= 4 k + 2 k2 + 8 c1 + 8 k c1 + 8 k2 c1 + k2 c31 + 12 c2 + 20 k c2 +
5
8 18 12 40 111
16 k2 c2 + k2 c1 c2 + k2 c21 c2 + k2 c22 + k2 c1 c22 + k2 c32
5 5 5 7 35
In[92]:= eq2 = D[r, c2 ]
4 6
Out[92]= 6 k + 4 k2 + 12 c1 + 20 k c1 + 16 k2 c1 + k2 c21 + k2 c31 + 24 c2 + 48 k c2 +
5 5
168 k2 c2 24 40 192 333 192
+ k2 c1 c2 + k2 c21 c2 + k2 c22 + k2 c1 c22 + k2 c32
5 5 7 35 35 35
In[93]:= {solc1} = GroebnerBasis[{eq1, eq2}, {c1 , c2 }, { c2 }]

Out[93]= {2 222 640 000 k + 25 041 744 000 k2 + 106 983 636 480 k3 + 216 207 482 400 k4 + 217 869 466 458 k5 +
105 383 544 084 k6 + 21 747 027 960 k7 + 982 690 800 k8 + 4 445 280 000 c1 + 45 638 208 000 k c1 +
172 774 344 960 k2 c1 + 305 473 573 440 k3 c1 + 294 315 313 236 k4 c1 + 170 466 205 476 k5 c1 +
78 560 129 424 k6 c1 + 27 948 563 160 k7 c1 + 4 880 962 800 k8 c1 + 4 834 771 200 k2 c21 +
14 644 375 200 k3 c21 + 3 743 455 968 k4 c21 - 11 828 581 632 k5 c21 - 15 676 868 844 k6 c21 -
6 328 977 648 k7 c21 - 849 050 160 k8 c21 + 398 664 000 k2 c31 - 377 496 000 k3 c31 + 1 763 997 312 k4 c31 +
2 443 968 240 k5 c31 + 2 017 898 358 k6 c31 + 441 062 580 k7 c31 + 61 164 425 k8 c31 + 52 698 240 k4 c41 +
370 528 368 k5 c41 + 323 358 168 k6 c41 + 197 374 240 k7 c41 + 18 557 000 k8 c41 - 4 040 400 k4 c51 -
27 938 400 k5 c51 - 12 698 784 k6 c51 - 6 985 752 k7 c51 + 4 109 544 k8 c51 - 1 465 920 k6 c61 -
716 616 k7 c61 - 872 028 k8 c61 + 55 600 k6 c71 + 18 640 k7 c71 + 58 568 k8 c71 - 3120 k8 c81 + 100 k8 c91 }

Let k = 1 and solve this polynomial system. The reduced Groebner basis for c1
{solc1} = GroebnerBasis[{eq1, eq2} /. k  1, {c1 , c2 }, { c2}]

{696 438 232 182 + 1 104 502 580 496 c1 - 11 460 875 916 c21 + 6 749 258 915 c31 +
962 516 016 c41 - 47 553 792 c51 - 3 054 564 c61 + 132 808 c71 - 3120 c81 + 100 c91}

and for c2
solc2 = GroebnerBasis[{eq1, eq2} /. k  1, {c1 , c2 }, { c1 }]

{- 3 224 994 388 + 16 440 204 032 c2 + 2 331 033 488 c22 +
1 352 335 222 c32 - 8 809 024 c42 + 993 132 c52 + 892 430 c62 + 58 212 c72 + 1560 c82 + 75 c92 }

The roots of these polynomials


sol1 = NSolve[solc1, c1 ]

{{c1  - 12.9293 - 3.66147 }, {c1  - 12.9293 + 3.66147 }, {c1  -0.625134},
{c1  2.52044 - 8.1913 }, {c1  2.52044 + 8.1913 }, {c1  2.71118 - 38.721 },
{c1  2.71118 + 38.721 }, {c1  23.6103 - 0.232818 }, {c1  23.6103 + 0.232818 }}
9

sol2 = NSolve[solc2, c2 ]

{{c2  - 14.5317 - 6.04274 }, {c2  - 14.5317 + 6.04274 }, {c2  -1.91375 - 26.8494 },
{c2  - 1.91375 + 26.8494 }, {c2  - 0.996856 - 3.33813 }, {c2  - 0.996856 + 3.33813 },
{c2  0.190454}, {c2  6.94707 - 7.44282 }, {c2  6.94707 + 7.44282 }}

selecting real solutions


solr1 = Select[sol1, (Im[#[[1, 2]]]  0) &] // Flatten

{c1  - 0.625134}

solr2 = Select[sol2, (Im[#[[1, 2]]]  0) &] // Flatten

{c2  0.190454}

Alternatively so called numerical Gröbner basis can be employed, too


sol = NSolve[{eq1, eq2} /. k  1, {c1 , c2 }]

{{c1  2.71118 + 38.721 , c2  - 1.91375 - 26.8494 },


{c1  2.71118 - 38.721 , c2  - 1.91375 + 26.8494 },
{c1  23.6103 + 0.232818 , c2  - 14.5317 - 6.04274 },
{c1  23.6103 - 0.232818 , c2  - 14.5317 + 6.04274 },
{c1  - 12.9293 + 3.66147 , c2  6.94707 - 7.44282 },
{c1  - 12.9293 - 3.66147 , c2  6.94707 + 7.44282 },
{c1  2.52044 + 8.1913 , c2  - 0.996856 - 3.33813 },
{c1  2.52044 - 8.1913 , c2  - 0.996856 + 3.33813 }, {c1  - 0.625134, c2  0.190454}}

solr = Select[sol, (Im[#[[1, 2]]]  0) &] // Flatten

{c1  - 0.625134, c2  0.190454}

Then the temperature profile is


T = θ /. solr

x - 0.625134 (- x + x2) + 0.190454 (- x + x3 )

Fig. 2.4 Approximated temperature profile

1.4.2 Common points of geometrical objects

It is well known that the visualization of curves and surfaces is easy and confortable via parametric explicite equations of the geometrical
objects. However sometimes the implicit form of these equations are needed. For example one should like to decide whether a point is on
10

objects. However sometimes the implicit form of these equations are needed. For example one should like to decide whether a point is on
the curve or surface or it is not. Finding the common points of two or more geometrical objects is just the generalization of this task
Problem 1 Let us compute the implicite equation of a 2D circle!

The form of the implicite equation with the parameter is,


gk(α ) = gk (x(α), y(α))
since
x(α) = cos (α)

y(α) = sin(α)
in addition we know that
sin2 (α) + cos2 (α) = 1
Solution

Our implicite equation can be written as


In[2]:= gk[α_] := {Cos[α], Sin[α]}

Therefore we are looking for the solution of the following equation system with unknowns (x, y, α)
In[3]:= Join[Together[{x, y} - gk[α]], {Cos[α] ^ 2 + Sin[α] ^ 2 - 1}]

Out[3]= x - Cos[α], y - Sin[α], - 1 + Cos[α]2 + Sin[α]2 

Now we should eliminate the variable (parameter) α. Let us compute the Groebner basis for the x and y
In[4]:= GroebnerBasis[%, {x, y}, {α, Cos[α], Sin[α]}]

Out[4]= {- 1 + x2 + y2 }

Problem 2 Now let us compute the common points of a cardioide and a cirle!

The parametric equation of the cardioide is,


x(t) = 2 (1 + cos(t)) cos(t)
y(t) = 2 (1 + cos(t)) sin(t)
Therefore the implicite form
In[5]:= gh[t_] := {2 (1 + Cos[t]) Cos[t], 2 (1 + Cos[t]) Sin[t]}

Out[14]= 0

-1

-2

0 1 2 3 4
Fig. 2.5 A cardioide curve

Solution

As first step we compute the implicite equation of the cardioide.


In[8]:= Join[Together[{x, y} - gh[t]], {Cos[t] ^ 2 + Sin[t] ^ 2 - 1}]

Out[8]= x - 2 Cos[t] - 2 Cos[t]2, y - 2 Sin[t] - 2 Cos[t] Sin[t], - 1 + Cos[t]2 + Sin[t]2 


11

In[9]:= GroebnerBasis[%, {x, y}, {t, Cos[t], Sin[t]}]

Out[9]= {- 4 x3 + x4 - 4 y2 - 4 x y2 + 2 x2 y2 + y4 }

Let us visualize the cardioide using this implicite form,

Out[10]= 0

-1

-2

-1 0 1 2 3 4
Fig. 2.6 Visualization of the cardioide curve via implicite equation

Now let us consider the following cirle,


x2 + y2 -2 = 0

Out[15]= 0

-1

-2

-2 -1 0 1 2 3 4
Fig. 2.7 The circle

Then, the two geometrical objects together


In[16]:= Show[{p2, p1}]

Out[16]= 0

-1

-2

-2 -1 0 1 2 3 4
Fig. 2.8 The two geometrical objects together

The next step is the computation of the common points employing these implicite equations,
In[17]:= g1 = - 4 x3 + x4 - 4 y2 - 4 x y2 + 2 x2 y2 + y4

Out[17]= - 4 x3 + x4 - 4 y2 - 4 x y2 + 2 x2 y2 + y4
12

In[18]:= g2 = x2 + y2 - 2

Out[18]= - 2 + x2 + y2

The reduced Gröbner basis for the x coordinate


In[19]:= GroebnerBasis[{g1, g2}, {x, y}, {y}]

Out[19]= {- 1 - 2 x + x2 }

similarly for the y coordinate


In[20]:= GroebnerBasis[{g1, g2}, {x, y}, {x}]

Out[20]= {- 7 + 2 y2 + y4 }

or with the built-in function Solve


In[21]:= solp = {x, y} /. Solve[{g1  0, g2  0}, {x, y}] // Simplify

Out[21]= 1 - 2 ,- -1 + 2 2 , 1 - 2 , -1 + 2 2 ,

1 + 2 , - 1+2 2 , 1 + 2, 1+2 2 

There are only two real solutions! Let us visualize the common points,

Out[24]= 0

-1

-2

-2 -1 0 1 2 3 4
Fig. 2.9 The common points of the two geometrical objects

You might also like