Mathematics with Maple

S.Duzhin

Lesson 6: Elementary Geometry

[Remark: this lesson was OK under Maple V3. I spent 2 hours trying to update it for Maple V5, but without success. It seems that the new geometry package is buggy. I will keep trying to fix it.]

Mathematics: points, lines, circles, triangles in the plane.

Maple: "geometry" package.

Up to now, we have been using Maple primarily as an advanced calculator equipped with numeric, symbolic and graphical capabilities.

In this lesson, we will use Maple as a tool to prove theorems in elementary geometry.

Although theorem proving is quite different from ordinary calculations, in the case of Euclidean geometry in the plane, with the help of cartesian coordinates any theorem can be reformulated as an algebraic fact and then Maple has to verify some algebraic formula.

All the procedures that we will use today, belong to a special Maple package called "geometry". First of all, we load it:

> with(geometry);

The command "with" returns the list of all available procedures. If you know this list very well, you can use this command differently (terminate with colon : instead of a semicolon ;) -- then you will have no output:

> with(geometry):

-- but still, you can use all the geometrical procedures.

Let us prove some well known geometrical theorems with the help of Maple.

As a first example, let me take the following theorem:

Example 1.

Theorem. In any triangle, the three altitudes meet in one point.

Proof.

First of all, we take three arbitrary points in the plane:

> point(A,xa,ya);

> point(B,xb,yb);

> point(C,xc,yc);

The first command means that xa, xb are the two coordinates of the point A.

Since the variables xa, xb do not have any fixed values, this implies that the point A is _arbitrary_. And so are B and C.

Assume that these three points are not collinear:

> AreCollinear(A,B,C,'cond');

> cond;

> evalb(cond);

> assume(cond);

Now let us define a triangle with these three vertices:

> triangle(ABC,[A,B,C]);

An important remark: the "geometry" package does not provide any special drawing procedures: it is geometry without pictures. (Of course, you can use the usual "plot" command, but then you have to use some numeric values of the parameters: you cannot plot an _arbitrary_ line with "plot"!)

A good strategy is to draw the figures on paper with a pencil and look at them, while you are giving these commands to Maple.

Let us draw the altitude of the triangle ABC from the vertex A:

> altitude(ABC, A, hA);

Please make the picture with pencil!

Now two more altitudes:

> altitude(ABC, B, hB);

> altitude(ABC, C, hC);

Now, to test whether three lines pass through one point (in other words, are concurrent, we can use the special Maple Boolean operator "are_concurrent":

> are_concurrent (hA,hB,hC);

The answer is "true", which means that we have proved the theorem!

Using this example, try to solve the following Exercise (do it now! and do not forget to draw the picture with pencil and paper):

Exercise 1. Prove the theorem that the three medians of a triangle are concurrent.

If you forget what is a median, here is a definition: it is a line that passes through a vertex and the midpoint of the opposite side.

If you have done this, then proceed to the next example:

Example 2.

Let ABC be an arbitrary triangle, AP and BQ its altitudes (point P is on the side BC, point Q on the side AC). Let O be the intersection point of AP and BQ.

Prove that there is a circle that passes through the four points CPOQ.

Proof.

We can use the same arbitrary triangle ABC which we have already constructed.

We have also constructed its altitudes, so we know the line AP=hA and the line BQ=hB. But we do not know the points P and Q. Let us find them, using the Maple

function "inter":

> P:=inter(hA,BC);

Ha! This does not work. Why? Because Maple does not understand what is BC.

We think that this is the line passing through the point B and C, but we did not yet explain it to Maple. This can be done like this:

> line(BC,[B,C]);

Now:

> P:=inter(hA,BC);

Works great this time!

Let us do the same with the second altitude (do not forget to draw the picture with pencil and paper!)

> line(AC,[A,C]);

> Q:=inter(hB,AC);

We already have three points C,P and Q. What about the last one?

> O:=inter(hA,hB);

The problem was to check that these 4 points lie on one circle. One way to do this would be to draw a circle through 3 points (this is always -- almost always! -- possible), then test whether the 4th point lies on that circle. But in "geometry" there is a special command to check if the 4 points lie on the same circle or not,

so why don't we use it?

> cocyclic(C,P,O,Q);

For some unknown reason, this does not work!

Let us try the first method:

> circle(c1,[C,P,Q]);

OK, we have the circle through the 3 points. Let us see whether the last point lies on that circle:

> on_circle(O,c1);

Most probably, you will never see the answer!

(I waited for about 10 minutes and only saw the small clock instead of the cursor).

This probably means that the invisible formulas which are being processed by Maple are too difficult in this case.

If this happens and you do not have time to wait, just PRESS the INTERRUPT button on top.

Exercise 2 (to be done at home).

Try to complete Example 2, using other procedures from the geometry package

(note: I do not the answer to this exercise yet).

Below are some more theorems of elementary geometry.

Try to prove them using Maple procedures from the "geometry" package.

Exercise 3. Let ABCD be an arbitrary quadrangle and M,N,P,Q the midpoints of its sides AB,BC,CD,DA. Prove that the midpoints of the segments MP and NQ are the same.

Exercise 4.

If AD is the bissector of the triangle ABC, then DB/DC = AB/AC.

Exercise 5. How to draw the perpendicular from a point P outside a circle c onto its diameter AB using only a ruler (i.e. if you are allowed to draw only straight lines)?

Construct the line PA which meets the circle in the point P1 and the line PB which meets the circle in the point P2. Then draw the lines [A P2] and [B P1].

Let Q be the intersection point of these two lines. Then PQ is perpendicular to AB.

Exercise 6.

The Maple program given below (written by D.Zeilberger) contains a proof of the Pascal theorem about a hexagon inscribed in a circle.

Run this program and try to understand what it means.

The solution of this exercise should contain the STATEMENT of the Pascal theorem.

for i from 0 to 5 do point(A.i,cos (t.i),sin(t.i)) od;

for i from 0 to 2 do line(L.i,[A.i,A.(i+1)]);line(M.i,[A.(i+3) ,A.(i+4 mod 6)]);

point( P.i,coordinates(inter(L.i,M.i)));od;

triangle(T,[P0,P1,P2]);

area(T);

simplify(");