# User:Neil Parker/Sandbox

## Pythagoras' Theorem and the Platonic Sequence: A Common Genesis

Pythagoras' Theorem

Figure 1

In the diagram COD is a diameter with O the centre. Right triangle OAB has sides x,y,r as shown.Let angle AOB = θ and , since this is an external angle of isosceles triangle DOB, angle D is θ/2...

Angle CBD stands on the diameter and is therefore ${\displaystyle 90^{0}.}$

Angle C is complementary to angle D and to angle ABC making the latter also equal to θ/2.

Triangles ACB and ABD are right triangles with angle D = angle ABC = θ/2. Therefore they are similar. Hence:

{\displaystyle {\begin{aligned}{\frac {AB}{AC}}&={\frac {AD}{AB}}\\\therefore {\frac {y}{r-x}}&={\frac {r+x}{y}}\\\Rightarrow y^{2}&=(r-x)(r+x)=r^{2}-x^{2}\\\Rightarrow r^{2}&=x^{2}+y^{2}\end{aligned}}}

The Platonic Sequence.

Figure 2

In the same diagram (Figure 2) let AC = 1 unit. (compared with Figure 1 we are simply scaling everything by a factor r – x). Then:

{\displaystyle {\begin{aligned}AB&=t\ where\ t=\cot({\tfrac {\theta }{2}})\quad [{\tfrac {\theta }{2}}\in (0,45^{\circ }]\Rightarrow t\geqslant 1]\\AD&=AB.\cot({\tfrac {\theta }{2}})=t^{2}\\CD&=CA+AD=t^{2}+1\\OB&=OD={\tfrac {CD}{2}}={\tfrac {t^{2}+1}{2}}\\OA&=OC-1={\tfrac {t^{2}-1}{2}}\end{aligned}}}

It can be seen that the scaled right triangle OAB in Figure 2 has sides which fit the Platonic sequence and since Figure 1 and Figure 2 are otherwise identical, it should be clear that the Platonic sequence is in fact a core expression of the Pythagorean identity. In particular rational triples arise if t is a rational number m/n:

{\displaystyle {\begin{aligned}AB&=t=m/n\\OA&={\frac {t^{2}-1}{2}}={\cfrac {{\tfrac {m^{2}}{n^{2}}}-1}{2}}={\frac {m^{2}-n^{2}}{2n^{2}}}\\OB&={\frac {t^{2}+1}{2}}={\cfrac {{\tfrac {m^{2}}{n^{2}}}+1}{2}}={\frac {m^{2}+n^{2}}{2n^{2}}}\\\end{aligned}}}

To obtain Pythagorean triples with integer sides we simply scale the above by a factor ${\displaystyle 2n^{2}}$ to give:

{\displaystyle {\begin{aligned}AB&=2mn\\OA&=m^{2}-n^{2}\\OB&=m^{2}+n^{2}\end{aligned}}}

All Pythagorean triples are therefore scaled versions of equivalent (ie equi-angular) Platonic sequence triangles which have rational sides. If by definition Platonic sequence triangles must have integer sides, we should rather use the term half angle cot sequence in the above context.

Figure 3

As one would expect there is a corresponding half angle tan sequence: refer to figure 3 and let AD = 1 unit. (compared with Figure 1 we are now scaling everything by a factor r + x). Then:

{\displaystyle {\begin{aligned}AB&=t\ where\ t=\tan({\tfrac {\theta }{2}})\quad [{\tfrac {\theta }{2}}\in [0,45^{\circ }]\Rightarrow 0\leqslant t\leqslant 1]\\AC&=AB.\tan({\tfrac {\theta }{2}})=t^{2}\\CD&=DA+AC=1+t^{2}\\OB&=OD=OC={\tfrac {CD}{2}}={\tfrac {1+t^{2}}{2}}\\OA&=OC-t^{2}={\tfrac {1-t^{2}}{2}}\end{aligned}}}

Once again rational triples arise if t is a rational number m/n where m<n in this instance.

## Diophantus II.VIII and the Platonic Sequence

Diophantus II.VIII: Intersection of line CB and the circle has rational solutions for x and y

"To divide a square into a sum of two squares
To divide 16 into a sum of two squares

Let the first summand be ${\displaystyle x^{2}}$ and thus the second ${\displaystyle 16-x^{2}}$. The latter is to be a square. I form the square of the difference of an arbitrary multiple of x diminished by the root of 16, that is, diminished by 4. I form, for example, the square of 2x-4. It is ${\displaystyle 4x^{2}-16x+16}$. I put this expression equal to ${\displaystyle 16-x^{2}}$ and subtract 16. In this way I obtain ${\displaystyle 5x^{2}=16x}$, hence ${\displaystyle x=16/5}$.

Thus one number is 256/25 and the other 144/25. The sum of these numbers is 16 and each summand is a square."

Without in any way detracting from the method described above, we generalize to solve the problem for any given square which we will represent algebraically as ${\displaystyle a^{2}}$. Also since Diophantus refers to an "arbitrary multiple of x" we will use the letter t to represent that coefficient. Then:

${\displaystyle {\begin{array}{lcl}\qquad (tx-a)^{2}&=&a^{2}-x^{2}\\\Rightarrow t^{2}x^{2}-2atx+a^{2}&=&a^{2}-x^{2}\\\Rightarrow x^{2}(t^{2}+1)&=&2atx\\\Rightarrow x&=&{\frac {2at}{t^{2}+1}}\\\end{array}}}$

"Thus one number is ${\displaystyle \left({\tfrac {2at}{t^{2}+1}}\right)^{2}}$ and the other is ${\displaystyle \left({\tfrac {a(t^{2}-1)}{t^{2}+1}}\right)^{2}}$. The sum of these numbers is ${\displaystyle a^{2}}$ and each summand is a square."

Diophantus II.VIII: Generalized solution in which triangle OAB is a rational triple if line CB has a rational gradient t

The specific results obtained by Diophantus may be obtained by substituting a=4 and t=2 in the above algebraic expressions. In effect his solution yields the following rational triple representing the sides of triangle OAB (it is assumed a and t are both rationals):

${\displaystyle \left[a;{\frac {2at}{t^{2}+1}};{\frac {a(t^{2}-1)}{t^{2}+1}}\right]=\left[{\frac {20}{5}};{\frac {16}{5}};{\frac {12}{5}}\right]={\frac {4}{5}}\left[5;4;3\right]}$

We see that Diophantus' solution is in fact a cleverly disguised 3,4,5 triple!

The algebraic solution needs only one additional algebraic step to arrive at the Platonic sequence ${\displaystyle [{\tfrac {t^{2}+1}{2}};t;{\tfrac {t^{2}-1}{2}}]}$ and that is to multiply all sides of the above triple by a factor ${\displaystyle \quad {\tfrac {t^{2}+1}{2a}}}$. Notice also that if a=1, (unit circle) the sides (OB,OA,AB) reduce to:

${\displaystyle \left[1;{\frac {2t}{t^{2}+1}};{\frac {t^{2}-1}{t^{2}+1}}\right]}$

In modern notation this is just ${\displaystyle (1,sin\theta ,cos\theta )}$ written in terms of the half angle cot which in the particular example given by Diophantus has a value of 2, the "arbitrary coefficient of x". Intriguing that this "arbitrary coefficient" has become the cornerstone of the Diophantine triple generator!

References:
Diophantus of Alexandria. Arithmeticorum Lib II Quaestio VIII
Heath, Sir Thomas L. Diophantus of Alexandria: A Study in the History of Greek Algebra. Dover.
Bashmakova, Isabella Grigoryevna. Diophantus and Diophantine Equations . The Mathematical Association of America. USA, 1997.
Both as quoted by Aaron Zerhusen, Chris Rakes, & Shasta Meece.Diophantine Equations

Fermat's Last Theorem and Diophantus II.VIII

## Using Ptolemy's Theorem

Proof of Law of Cosines using Ptolemy's Theorem

Referring to the diagram, triangle ABC with sides AB=c, BC=a and AC=b is drawn inside its circumcircle as shown. Triangle ABD is constructed congruent to triangle ABC with AD = BC and BD = AC. Perpendiculars from D and C meet base AB at E and F respectively. Then:

${\displaystyle {\begin{array}{lcl}\quad BF=AE=BC\cos {\hat {B}}=a\cos {\hat {B}}\\\Rightarrow DC=EF=AB-2BF=c-2a\cos {\hat {B}}\end{array}}}$

Now the Law of Cosines is rendered by a straightforward application of Ptolemy's theorem to cyclic quadrilateral ABCD:

${\displaystyle {\begin{array}{lcl}\quad AD\times BC+AB\times DC=AC\times BD\\\Rightarrow a^{2}+c.(c-2a\cos {\hat {B}})=b^{2}\\\Rightarrow a^{2}+c^{2}-2ac.\cos {\hat {B}}=b^{2}\end{array}}}$

Plainly if angle B is 90 degrees, then ABCD is a rectangle and application of Ptolemy's theorem yields Pythagoras' Theorem:

${\displaystyle a^{2}+c^{2}=b^{2}\quad }$

## Using Power of a Point Theorem

This proof along with that using Pythagoras theorem are of considerable historical significance since both have their origins in Euclid's Elements and both are referred to in the ground breaking work of Nicolaus Copernicus: "De Revolutionibus Orbium Coelestium". On Page 20 and Page 21 of Book 1 Copernicus describes two techniques for determining angles given all three sides of a triangle. These techniques correspond respectively to the Pythagorean and Power of Points derivations of the Law of Cosines.

Replica of diagrams in Book 1, Page 21 of "De Revolutionibus Orbium Coelestium"

Fig 1 and Fig 2 are replicas of the diagrams from Page 21 of De Revolutionibus Orbium Coelestium.In Fig 1 triangle ABC is drawn with B an acute angle. With C as centre and BC (=a) as radius semi-circle DBF is constructed with DF a diameter and D a point on AC. The circle meets side AB at E and EC is joined forming isosceles triangle ECB with EB = 2acos(B).Power of Points Theorem (intersecting secants theorem) is applied to point A outside the circle:

${\displaystyle {\begin{array}{lcl}\quad \quad AD\times AF=AB\times AE\\\Rightarrow (b-a)(b+a)=c(c-2a\cos {\hat {B}})\\\Rightarrow \quad b^{2}-a^{2}=c^{2}-2ac.\cos {\hat {B}}\\\Rightarrow \quad \quad b^{2}=a^{2}+c^{2}-2ac\cos {\hat {B}}\end{array}}}$

It will be no different in the case of Fig 2 where angle B is obtuse:

${\displaystyle {\begin{array}{lcl}\quad \quad AD\times AF=AB\times AE\\\Rightarrow (b-a)(b+a)=c(c+2a\cos(180-{\hat {B}}))\\\Rightarrow \quad b^{2}-a^{2}=c^{2}-2ac.\cos {\hat {B}}\\\Rightarrow \quad \quad b^{2}=a^{2}+c^{2}-2ac\cos {\hat {B}}\end{array}}}$

Proof of Law of Cosines using Power of a Point Theorem

In addition to the two cases dealt with above, we also need to consider the situation shown in the diagram where Power of Point theorem is applied about point B inside the construction circle.

Triangle ABC is drawn with side AB=c,BC=a and CA=b. With A as centre construct circle DCE with radius b and diameter DE passing through B. CB produced meets the circle at F. Since triangle CAF is isosceles:

${\displaystyle CF=2b\cos {\hat {C}}\quad }$.

Now apply the Power of a Point Theorem (intersecting chords theorem) to point B inside the circle:

${\displaystyle {\begin{array}{lcl}\quad \quad BD\times BE=BC\times BF\\\Rightarrow (b-c)(b+c)=a(2b\cos {\hat {C}}-a)\\\Rightarrow \quad b^{2}-c^{2}=2ab.\cos {\hat {C}}-a^{2}\\\Rightarrow \quad \quad c^{2}=b^{2}+a^{2}-2ab\cos {\hat {C}}\end{array}}}$

## Proof using the Law of Sines

Ptolemy's Theorem

In cyclic quadrilateral ABCD the sum of products of opposite sides is equal to the product of diagonals. Referring to the diagram:

${\displaystyle \quad AD\times BC+AB\times DC=AC\times BD}$

The proof which follows is substantively similar to the previous but adopts a different methodology and concludes with an interestingly symmetric formula for the product of diagonals and sum of products of opposite sides.

Preliminary Observations and Identities

In the diagram sides AB,BC,CD and DA are labelled ${\displaystyle S_{1},S_{2},S_{3}\,}$ and ${\displaystyle S_{4}\,}$ and subtend angles ${\displaystyle \theta _{1},\theta _{2},\theta _{3}\,}$ and ${\displaystyle \theta _{4}\,}$ respectively. Applying sum of angles in triangle ABC it should be noted that ${\displaystyle \theta _{1}+\theta _{2}+\theta _{3}+\theta _{4}=180^{0}\,}$. Therefore the sum of any two angles is supplementary with the sum of the other two and any single angle is supplementary with the sum of the other three. In general for supplementary angles x and y:

${\displaystyle {\begin{array}{lcl}\\\sin(x)=\sin(y)\\\cos(x)=-\cos(y)\\\end{array}}}$:

We will also need the identity ${\displaystyle \cos(\theta _{i}-\theta _{j})=cos(\theta _{j}-\theta _{i})\,}$ and the following product to sum identity:

${\displaystyle \sin(x)sin(y)={\frac {\cos(x-y)-\cos(x+y)}{2}}}$.

Proof

Apply the sine rule to triangles ABC, ADC and ABD within their common circumscribing circle ABCD radius r:

${\displaystyle {\frac {S_{1}}{\sin \theta _{1}}}={\frac {S_{2}}{\sin \theta _{2}}}={\frac {S_{3}}{\sin \theta _{3}}}={\frac {S_{4}}{\sin \theta _{4}}}={\frac {AC}{\sin(\theta _{3}+\theta _{4})}}={\frac {BD}{\sin(\theta _{3}+\theta _{2})}}=2r}$

From this we obtain:

${\displaystyle {\begin{array}{lcl}\\S_{1}S_{3}+S_{2}S_{4}=4r^{2}(\sin \theta _{1}\sin \theta _{3}+\sin \theta _{2}\sin \theta _{4})\\=2r^{2}[\cos(\theta _{1}-\theta _{3})-\cos(\theta _{1}+\theta _{3})-\cos(\theta _{2}+\theta _{4})+\cos(\theta _{2}-\theta _{4})]\\=2r^{2}[\cos(\theta _{1}-\theta _{3})+\cos(\theta _{2}-\theta _{4})]\\\end{array}}}$

The product to sum identity has been applied twice and the middle two terms cancel out on account of being cosines of supplementary angles.

Similarly we can obtain an expression for the product of diagonals:

${\displaystyle {\begin{array}{lcl}\\BD\times AC=4r^{2}[\sin(\theta _{3}+\theta _{2})\sin(\theta _{3}+\theta _{4})]\\=2r^{2}[\cos(\theta _{2}-\theta _{4})-\cos(2\theta _{3}+\theta _{4}+\theta _{2})]\\=2r^{2}[\cos(\theta _{2}-\theta _{4})+\cos(\theta _{1}-\theta _{3})]\\\end{array}}}$

Once again the product to sum identity has been applied and the second term has been re-written in terms of its suppplementary angle.

We may now present Ptolemy's theorem with an addendum by way of the "marrying formula" for product of diagonals and sum of products of opposite sides:

${\displaystyle S_{1}S_{3}+S_{2}S_{4}=AC\times BD=2r^{2}[\cos(\theta _{2}-\theta _{4})+\cos(\theta _{1}-\theta _{3})]\;}$

where r is the radius of the circumscribing circle and ${\displaystyle \theta _{1},\theta _{2},\theta _{3},\theta _{4}\,}$ are the angles subtended by sides ${\displaystyle S_{1},S_{2},S_{3},S_{4}\,}$ respectively.

### "Fluffy unsourced essay"

Although this proof involves some interesting trigonometric manipulations, its relative complexity underlines the exquisite simplicity and elegance of the original geometric proof nominally ascribed to Ptolemy but the actual origins of which disappear into the mists of antiquity - surely the product of some genius amongst those erudite and resourceful minds which over millenia conceived of,designed and brought to fruition the Great Pyramid(s) of Egypt. For it is no exaggeration to say that this crucial theorem is the 'mathematical DNA' which underpins the science of geodesy and only in comparitively recent times have we begun to understand the Pyramids not merely as tombs for the Pharaohs but as geodesic models of our planet built to a precision before which we can only stand in awe.

### The Master Theorem and its Corollaries

In the case of a circle of unit diameter the sides ${\displaystyle S_{1},S_{2},S_{3},S_{4}\;}$ of any cyclic quadrilateral ABCD are numerically equal to the sines of the angles ${\displaystyle \theta _{1},\theta _{2},\theta _{3}\,}$ and ${\displaystyle \theta _{4}\,}$ which they subtend. Similarly the diagonals are equal to the sine of the sum of whichever pair of angles they subtend. We may then write Ptolemy's Theorem in the following trigonometric form:

${\displaystyle \sin \theta _{1}\sin \theta _{3}+\sin \theta _{2}\sin \theta _{4}=\sin(\theta _{3}+\theta _{2})\sin(\theta _{3}+\theta _{4})\;}$

Corollary 1: Pythagoras' Theorem

Applying certain conditions to the subtended angles ${\displaystyle \theta _{1},\theta _{2},\theta _{3}\,}$ and ${\displaystyle \theta _{4}\,}$ it is possible to derive a number of important corollaries using the above as our starting point. In what follows it is important to bear in mind that the sum of angles ${\displaystyle \theta _{1}+\theta _{2}+\theta _{3}+\theta _{4}=180^{0}\,}$.

#### Corollary 1. Pythagoras' Theorem

Let ${\displaystyle \theta _{1}=\theta _{3}\;}$ and ${\displaystyle \theta _{2}=\theta _{4}\;}$ ${\displaystyle \Rightarrow \theta _{1}+\theta _{2}=\theta _{3}+\theta _{4}=90^{0}\;}$ (Since opposite angles of a cyclic quadrilateral are supplementary). Then:

${\displaystyle {\begin{array}{lcl}\\\sin \theta _{1}\sin \theta _{3}+\sin \theta _{2}\sin \theta _{4}=\sin(\theta _{3}+\theta _{2})\sin(\theta _{3}+\theta _{4})\\\Rightarrow \sin ^{2}\theta _{1}+\sin ^{2}\theta _{2}=sin^{2}(\theta _{1}+\theta _{2})\\\Rightarrow \sin ^{2}\theta _{1}+\cos ^{2}\theta _{1}=1\\\end{array}}}$

#### Corollary 2. The Law of Cosines

Corollary 2: The Law of Cosines

Let ${\displaystyle \theta _{2}=\theta _{4}\;}$. The rectangle of corollary 1 is now a symmetrical trapezium with equal diagonals and a pair of equal sides. The parallel sides differ in length by 2x units where ${\displaystyle x=S_{2}.cos(\theta _{2}+\theta _{3})\;}$

It will be easier in this case to revert to the standard statement of Ptolemy's Theorem:

${\displaystyle {\begin{array}{lcl}\\S_{1}\times S_{3}+S_{2}\times S_{4}=AC\times BD\\\Rightarrow S_{1}\times S_{3}+(S_{2})^{2}=AC^{2}\\\Rightarrow S_{1}.[S_{1}-2S_{2}cos(\theta _{2}+\theta _{3})]+(S_{2})^{2}=AC^{2}\\\Rightarrow (S_{1})^{2}+(S_{2})^{2}-2S_{1}S_{2}cos(\theta _{2}+\theta _{3})=AC^{2}\\\end{array}}}$

The cosine rule for triangle ABC.

#### Corollary 3: Compound Angle Sine (+)

Let ${\displaystyle \theta _{1}+\theta _{2}=\theta _{3}+\theta _{4}=90^{0}\;}$

${\displaystyle {\begin{array}{lcl}\\\sin \theta _{1}\sin \theta _{3}+\sin \theta _{2}\sin \theta _{4}=\sin(\theta _{3}+\theta _{2})\sin(\theta _{3}+\theta _{4})\\\Rightarrow \cos \theta _{2}\sin \theta _{3}+\sin \theta _{2}\cos \theta _{3}=\sin(\theta _{3}+\theta _{2})\times 1\\\end{array}}}$

Formula for compound angle sine (+)

#### Corollary 4: Compound Angle Sine (-)

Let ${\displaystyle \theta _{1}=90^{0}\Rightarrow \theta _{2}+(\theta _{3}+\theta _{4})=90^{0}}$

${\displaystyle {\begin{array}{lcl}\\\sin \theta _{1}\sin \theta _{3}+\sin \theta _{2}\sin \theta _{4}=\sin(\theta _{3}+\theta _{2})\sin(\theta _{3}+\theta _{4})\\\Rightarrow \sin \theta _{3}+\sin \theta _{2}\cos(\theta _{2}+\theta _{3})=\sin(\theta _{3}+\theta _{2})\cos \theta _{2}\\\Rightarrow \sin \theta _{3}=\sin(\theta _{3}+\theta _{2})\cos \theta _{2}-\cos(\theta _{2}+\theta _{3})\sin \theta _{2}\\\end{array}}}$

Formula for compound angle sine (-).

This derivation corresponds to the 'Third Theorem' as chronicled by Ptolemy in Almagest. In particular if the sides of a pentagon (subtending 360) and of a hexagon (subtending 300) are given, a chord subtending 60 may be calculated. This was a critical step in the ancient method of calculating tables of chords.

#### Corollary 5: Compound Angle Cosine (+)

This corollary is the core of the "Fifth Theorem" as chronicled by Ptolemy in Almagest.

Let ${\displaystyle \theta _{3}=90^{0}\Rightarrow \theta _{1}+(\theta _{2}+\theta _{4})=90^{0}}$

${\displaystyle {\begin{array}{lcl}\\\sin \theta _{1}\sin \theta _{3}+\sin \theta _{2}\sin \theta _{4}=\sin(\theta _{3}+\theta _{2})\sin(\theta _{3}+\theta _{4})\\\Rightarrow \cos(\theta _{2}+\theta _{4})+\sin \theta _{2}\sin \theta _{4}=\cos \theta _{2}\cos \theta _{4}\\\Rightarrow \cos(\theta _{2}+\theta _{4})=\cos \theta _{2}\cos \theta _{4}-\sin \theta _{2}\sin \theta _{4}\\\end{array}}}$

Formula for compound angle cosine (+)

Despite lacking the dexterity of our modern trigonometric notation, it should be clear from the above corollaries that in Ptolemy's theorem (or more simply the 'Second Theorem') the ancient world had at its disposal an extremely flexible and powerful trigonometric tool which enabled the cogniscenti of those times to draw up accurate tables of chords (corresponding to tables of sines) and to use these in their attempts to understand and map the cosmos as they saw it. Since tables of chords were drawn up by Hipparchus three centuries before Ptolemy, we must assume he knew of the 'Second Theorem' and its derivatives. Following the trail of ancient astronomers, history records the star catalogue of Timocharis of Alexandria. If, as seems likely, the compilation of such catalogues required an understanding of the 'Second Theorem' then the true origins of the latter disappear thereafter into the mists of antiquity but it cannot be unreasonable to presume that the astronomers, architects and construction engineers of ancient Egypt may have had some knowledge of it.

## Examples

The golden ratio follows from this appliation of Ptolemy's theorem
• Any square can be inscribed in a circle whose center is the barycenter of the square. If the common length of its four sides is equal to ${\displaystyle a}$ then the length of the diagonal is equal to ${\displaystyle {\sqrt {2}}a}$ according to the Pythagorean theorem and the relation obviously holds.
• More generally, if the quadrilateral is a rectangle with sides a and b and diagonal c then Ptolemy's theorem reduces to the Pythagorean theorem. In this case the center of the circle coincides with the point of intersection of the diagonals. The product of the diagonals is then c2, the right hand side of Ptolemy's relation is the sum a2 + b2.
• A more interesting example is the relation between the length a of the side and the (common) length b of the 5 chords in a regular pentagon. In this case the relation reads b2 = a2 + ab which yields the golden ratio
${\displaystyle {b \over a}={{1+{\sqrt {5}}} \over 2}.}$
Side of the inscribed decagon
• If now diameter AE is drawn bisecting DC so that DE and CE are sides c of an inscribed decagon, Ptolemy's Theorem can again be applied - this time to cyclic quadrilateral ADEC:
${\displaystyle ad=2bc\;}$

${\displaystyle \Rightarrow ad=2kac}$ where k is the golden ratio.
${\displaystyle \Rightarrow c={\frac {d}{2k}}}$

Whence the side of the inscribed decagon is obtained in terms of the circle diameter. Pythagoras' Theorem applied to right triangle AED then yields "b" in terms of the diameter and "a" the side of the pentagon is thereafter calculated as ${\displaystyle a={\frac {b}{k}}=b(k-1)\;}$.

"The diameter of a circle being given, the sides of the triangle, tetragon, pentagon, hexagon and decagon, which the same circle circumscribes, are also given."

De Revolutionibus Orbium Coelestium: Liber Primum: Theorem Primum

When applied repeatedly, Ptolemy's theorem allows to compute the length of all diagonals for a polygon inscribed in a circle with vertices P1, ..., Pn, if the sides are given together with all the length values of the "next to sides" chords connecting two vertices Pi and Pi+2 (with indices taken modulo n).

## Experiments

[1]. Then again [1]

1. ^ a b Ptolemy's Theorem Cite error: Invalid <ref> tag; name "X" defined multiple times with different content (see the help page).

## Time Continuous Mortgage Model

In the same way that it is possible to derive the formula for continuous compounding by taking to infinity the frequency (N) of compounding periods (N = 12 for monthly compounding), we can derive a formula for a 'continuous payment' mortgage.

In this article the derivation is presented and the result compared with a well known physical system which exhibits the same mathematical characteristics. The time continuous mortgage function obeys a first order linear differential equation and an alternative derivation thereof is obtained by solving the equation using Laplace transforms.

### Derivation of Time Continuous Equation

The classical mortgage formula to determine the monthly payment on a loan of amount P taken out for a period of n months at a monthly interest rate of i% is:

${\displaystyle x={\frac {Pi}{1-(1+i)^{-n}}}}$

We begin with a small adjustment of the formula: replace i with r/N where r is the annual interest rate and N is the annual frequency of compounding periods (N = 12 for monthly payments). Also replace n with NT where T is the total loan period in years. In this more general form of the equation we are calculating x as the fixed payment corresponding to frequency N. For example if N = 365 , x corresponds to a daily fixed payment:

${\displaystyle x={\frac {Pr}{N(1-(1+{\frac {r}{N}})^{-NT})}}}$

${\displaystyle Nx={\frac {Pr}{1-(1+{\frac {r}{N}})^{-NT}}}}$

Note that Nx is simply the amount paid per year - in effect an annual repayment rate ${\displaystyle M_{a}}$. It is well established that:

${\displaystyle \lim _{N\to \infty }\left(1+{\frac {r}{N}}\right)^{Nt}=e^{rt}}$

Applying the same principle to the formula for annual repayment, we can determine a limiting value:

${\displaystyle M_{a}=\lim _{N\to \infty }Nx=\lim _{N\to \infty }{\frac {Pr}{1-(1+{\frac {r}{N}})^{-NT}}}={\frac {Pr}{1-e^{-rT}}}}$

Figure 1

Having determined ${\displaystyle M_{a}}$ and noting that the balance due P(t) on a loan t years after its inception is simply the present value of the remaining payments, we may re-arrange the above equation and write:

${\displaystyle P(t)={\frac {M_{a}}{r}}(1-e^{-r(T-t)})}$

The graph(s) in the diagram are a comparision of balance due on a mortgage (1 million for 20 years @ r = 10%) calculated firstly according to the above time continuous model and secondly using the Excel PV function. As may be seen the curves are virtually indistinguishable - calculations effected using the model differ from those effected using the Excel PV function by a mere 0.3% (max). The data from which the graph(s) were derived can be viewed here.

### Comparision with Similar Physical Systems

Define the 'reverse time' variable z = T - t. (t=0, z=T and t=T, z=0). Then:

${\displaystyle P(z)={\frac {M_{a}}{r}}(1-e^{-rz})}$

This may be recognized as a solution to the 'reverse time' differential equation:

${\displaystyle {\frac {M_{a}}{r}}={\frac {1}{r}}{\frac {dP(z)}{dz}}+P(z)}$

Electrical/electronic engineers and physicists will be familiar with an equation of this nature: it is an exact analogue of the type of differential equation which governs (for example) the charging of a capacitor in an RC circuit:

${\displaystyle V_{0}=RC{\frac {dV(t)}{dt}}+V(t).}$

The key characteristics of such equations are explained in detail in the Wiki page on RC circuits. For home owners with mortgages the important parameter to keep in mind is the time constant of the equation which is simply the reciprocal of r the annual interest rate. So (for example) the time constant when the interest rate is 10% is 10 years and the period of a home loan should be determined - within the bounds of affordability - as a minimum multiple of this if the objective is to minimise interest paid on the loan.

### Ordinary Time Differential Equation

The concept of a 'reverse time variable' is somewhat abstract: it was employed above to demonstrate the similarity between the equations governing mortgage balance and physical systems such as the RC circuit referred to.

In ordinary time - given interest rate r and annual repayment rate ${\displaystyle M_{a}}$ - the mortgage balance function satisfies the following differential equation:

${\displaystyle {\frac {dP(t)}{dt}}=rP(t)-M_{a}}$

From this we may obtain the Laplace transform P(s):

${\displaystyle P(s)={\frac {M_{a}}{s(r-s)}}={\frac {M_{a}}{r}}{\frac {(-r)}{s(s+(-r))}}}$

Using a table of LaPlace transforms and their time domain equivalents, P(t) may be determined:

${\displaystyle P(t)={\frac {M_{a}}{r}}(1-e^{rt})}$

In order to fit this solution to the particular start and end points of the mortgage function we need to introduce a time shift of T years (T = loan period) to ensure the function reaches zero at the end of the loan period:

${\displaystyle P(t)={\frac {M_{a}}{r}}(1-e^{r(t-T)})}$

${\displaystyle \Rightarrow P(t)={\frac {M_{a}}{r}}(1-e^{-r(T-t)})}$

Note that both the original solution and 'time shifted' version satisfy the original differential equation whence both are derived.

### Calculation of Accumulated Interest and Principal Payments

Re-arranging the original differential equation we obtain:

${\displaystyle M_{a}=rP(t)-{\frac {dP(t)}{dt}}}$

Integrating both sides of the equation yields:

${\displaystyle M_{a}.t=\int _{0}^{t}rP(t)\,dt\,-\int _{0}^{t}{\frac {dP(t)}{dt}}\,dt\,}$

The first integral on the right hand side determines the accumulated interest payments from time of inception to time t whilst the second determines the accumulated principal payments over the same period. The sum of these interest and principal payments must equal the cumulative fixed payments at time t ie Mat. Evaluating the first integral on the right we obtain an expression for I(t), the interest paid:

${\displaystyle I(t)=M_{a}t-{\frac {M_{a}(e^{rt}-1)}{re^{rT}}}}$

Unsuprisingly the second integral evaluates to P0 - P(t) and therefore:

${\displaystyle I(t)=M_{a}t-P_{0}+P(t)\,}$

The reader may easily verify that this expression is algebraically identical to the one above.

### Calculation of Interest Rate

In the discrete time interval model, calculation of a mortgage based interest rate given the remaining parameters has not been possible using analytic methods. Implementations such as the Excel 'Rate' function employ a numerical 'trial and improvement' method to determine interest rate. At first glance this would also seem to be the case for the continuous repayment model. Given

${\displaystyle P_{0}={\frac {M_{a}}{r}}(1-e^{-rT})}$

we may write

${\displaystyle rP_{0}=M_{a}(1-e^{-rT})\,}$
${\displaystyle \Rightarrow P_{0}r-M_{a}+M_{a}e^{-rT}=0}$

In order to visualise the above as a function of r (for which we wish to determine zeroes), it will be helpful to select numerical values of P0, Ma and T as 10000, 6000 and 2 respectively and plot as shown at right. It will be noted that the function has a minimum value which can be determined by differentiation:

${\displaystyle f'(r)=0\,}$
${\displaystyle \Rightarrow P_{0}-M_{a}Te^{-rT}=0}$
${\displaystyle \Rightarrow r={\frac {1}{T}}\ln {\frac {M_{a}T}{P_{0}}}}$

Noting that the function is approximately parabolic between the roots at r=0 and the sought value, we may approximate the required root as:

${\displaystyle \Rightarrow r={\frac {2}{T}}\ln {\frac {M_{a}T}{P_{0}}}}$

Using this as a starting point, increasingly accurate values for the root may be determined by repeated iterations of the Newton/Rhapson algorithm:

${\displaystyle r_{1}=r_{0}-{\frac {f(r_{0})}{f'(r_{0})}}.\,\!}$

However some experimentation on Wolfram alpha reveals that an exact analytical solution employing the Lambert-W or 'product log' function can be obtained. Setting s = MaT/P0

${\displaystyle r={\frac {1}{T}}.W(-se^{-s})+{\frac {M_{a}}{P_{0}}}}$

### Concluding Remarks

The concept of a 'continuous repayment' mortgage is a somewhat theoretical construct. Whether it has practical value or not is a question that would need to be carefully considered by economists and actuarials. An obvious question which may be asked is what is the 'real world' meaning of the limiting annual payment ${\displaystyle M_{a}}$ referred to in many of the calculations effected above? However the 'time continuous' model does provide some meaningful insights into the behaviour of the discrete mortgage balance function - in particular that it is largely governed by a time constant equal to the reciprocal of r the nominal annual interest rate. And if a mortgage were to be paid off via fixed daily amounts, then balance due calculations effected using the model would - in general - be accurate to within a small fraction of a percent.

## Bibliography

• Kreyszig, Erwin, Advanced Engineering Mathematics (1998, Wiley Publishers, USA), ISBN 0471154962.
• Munem, M.A and Foulis D.J, Algebra and Trigonometry with Applications (1986, Worth Publishers, USA), ISBN 0879012811