User:Neil Parker/Sandbox

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

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 $$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:

$$\begin{align}\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{align}$$  The Platonic Sequence.

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:  $$\begin{align} 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{align}$$  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:  $$\begin{align} 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{align}$$  To obtain Pythagorean triples with integer sides we simply scale the above by a factor $$2n^2$$ to give:  $$\begin{align} AB&=2mn\\ OA&=m^2-n^2\\ OB&=m^2+n^2 \end{align}$$ <BR><BR> 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.

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: <BR><BR> $$\begin{align} AB&=t\ where\ t=\tan(\tfrac{\theta}{2})\quad [\tfrac{\theta}{2}\in[0,45^\circ]\Rightarrow 0\leqslant t \leqslant1]\\ 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{align}$$ <BR><BR>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
"To divide a square into a sum of two squares<BR>  To divide 16 into a sum of two squares

''Let the first summand be $$x^2$$ and thus the second $$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 $$4x^2-16x+16$$. I put this expression equal to $$16-x^2$$ and subtract 16. In this way I obtain $$5x^2=16x$$, hence $$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 $$a^2$$. Also since Diophantus refers to an "arbitrary multiple of x" we will use the letter t to represent that coefficient. Then:

$$ \begin{array}{lcl} \qquad (tx-a)^2 & = & a^2-x^2\\ \Rightarrow t^2x^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 $$\left(\tfrac{2at}{t^2+1}\right)^2$$ and the other is $$\left(\tfrac{a(t^2-1)}{t^2+1}\right)^2$$. The sum of these numbers is $$a^2$$ and each summand is a square."

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):<BR><BR>

$$ \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]$$ <BR><BR> 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 $$[\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 $$\quad \tfrac{t^2+1}{2a}$$. Notice also that if a=1, (unit circle) the sides (OB,OA,AB) reduce to:<BR><BR>

$$ \left[ 1; \frac{2t}{t^2+1}; \frac{t^2-1}{t^2+1}\right]$$ <BR><BR> In modern notation this is just $$(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:<BR> Diophantus of Alexandria. <BR> Heath, Sir Thomas L. Diophantus of Alexandria: A Study in the History of Greek Algebra. Dover.<BR> Bashmakova, Isabella Grigoryevna. Diophantus and Diophantine Equations. The Mathematical Association of America. USA, 1997.<BR> Both as quoted by Aaron Zerhusen, Chris Rakes, & Shasta Meece.Diophantine Equations<BR><BR> Further Reading:<BR> Fermat's Last Theorem and Diophantus II.VIII

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:

$$\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:

$$\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:

$$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.

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:

$$\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:

$$\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}$$

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:

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

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

$$\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
In cyclic quadrilateral ABCD the sum of products of opposite sides is equal to the product of diagonals. Referring to the diagram:

$$ \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 $$S_1,S_2,S_3\,$$ and $$S_4\,$$ and subtend angles $$\theta_1,\theta_2,\theta_3\,$$ and $$\theta_4\,$$ respectively. Applying sum of angles in triangle ABC it should be noted that $$\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:<BR><BR>

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

We will also need the identity $$\cos(\theta_i-\theta_j)=cos(\theta_j-\theta_i)\,$$ and the following product to sum identity: <BR><BR>

$$\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: <BR><BR> $$\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 $$ <BR><BR> From this we obtain: <BR><BR> $$\begin{array}{lcl}\\ S_1S_3+S_2S_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}$$<BR><BR> 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: <BR><BR> $$\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}$$ <BR><BR> 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: <BR><BR> $$S_1S_3+S_2S_4=AC \times BD =2r^2[\cos(\theta_2-\theta_4)+\cos(\theta_1-\theta_3)]\;$$ <BR><BR> where r is the radius of the circumscribing circle and $$\theta_1,\theta_2,\theta_3,\theta_4\,$$ are the angles subtended by sides $$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 $$S_1,S_2,S_3,S_4\;$$ of any cyclic quadrilateral ABCD are numerically equal to the sines of the angles $$\theta_1,\theta_2,\theta_3\,$$ and $$\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:

$$\sin\theta_1\sin\theta_3+\sin\theta_2\sin\theta_4=\sin(\theta_3+\theta_2)\sin(\theta_3+\theta_4)\;$$

Applying certain conditions to the subtended angles $$\theta_1,\theta_2,\theta_3\,$$ and $$\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 $$\theta_1+\theta_2+\theta_3+\theta_4=180^0\,$$.

Corollary 1. Pythagoras' Theorem
Let $$\theta_1=\theta_3\;$$ and $$\theta_2=\theta_4\;$$ $$\Rightarrow\theta_1+\theta_2=\theta_3+\theta_4=90^0\;$$ (Since opposite angles of a cyclic quadrilateral are supplementary). Then:

$$\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}$$ <br style="clear:both" />

Corollary 2. The Law of Cosines


Let $$\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 $$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:

$$\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_2cos(\theta_2+\theta_3)]+(S_2)^2=AC^2\\ \Rightarrow (S_1)^2+(S_2)^2-2S_1S_2cos(\theta_2+\theta_3)=AC^2\\ \end{array}$$

The cosine rule for triangle ABC. <br style="clear:both" />

Corollary 3: Compound Angle Sine (+)
Let $$\theta_1+\theta_2=\theta_3+\theta_4=90^0\;$$

$$\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 $$\theta_1=90^0 \Rightarrow \theta_2+(\theta_3+\theta_4)=90^0$$

$$\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 $$\theta_3=90^0 \Rightarrow \theta_1+(\theta_2+\theta_4)=90^0 $$

$$\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

 * 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 $$a$$ then the length of the diagonal is equal to $$\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
 * $${b \over a} = {{1+\sqrt{5}}\over 2}.$$


 * 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:


 * $$ad=2bc\;$$<BR><BR>
 * $$\Rightarrow ad=2kac$$ where k is the golden ratio.<BR>
 * $$\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 $$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
. Then again

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:


 * $$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:


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

<BR>
 * $$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 $$M_a$$. It is well established that:


 * $$\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:


 * $$M_a=\lim_{N\to\infty}Nx=\lim_{N\to\infty}\frac{Pr}{1 - (1 + \frac{r}{N})^{-NT}}=\frac{Pr}{1 - e^{-rT}}$$

Having determined $$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:


 * $$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 [[Media:Mortgage_Balance_model_data.pdf |here.]]

Comparision with Similar Physical Systems
Define the 'reverse time' variable z = T - t. (t=0, z=T and t=T, z=0). Then:


 * $$P(z) = \frac{M_a}{r}(1 - e^{-rz})$$

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


 * $$\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:


 * $$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 $$M_a$$ - the mortgage balance function satisfies the following differential equation:


 * $$\frac{dP(t)}{dt} = rP(t)-M_a$$

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


 * $$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:


 * $$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:


 * $$P(t)=\frac{M_a}{r}(1-e^{r(t-T)})$$

$$\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:


 * $$M_a = rP(t) - \frac{dP(t)}{dt}$$

Integrating both sides of the equation yields:


 * $$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:


 * $$I(t)=M_at-\frac{M_a(e^{rt}-1)}{re^{rT}}$$

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


 * $$I(t)=M_at-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


 * $$P_0=\frac{M_a}{r}(1-e^{-rT})$$

we may write


 * $$rP_0=M_a(1-e^{-rT})\,$$
 * $$\Rightarrow P_0r-M_a+M_ae^{-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:


 * $$f'(r)=0\,$$
 * $$\Rightarrow P_0-M_aTe^{-rT}=0$$
 * $$\Rightarrow r=\frac{1}{T}\ln{\frac{M_aT}{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:


 * $$\Rightarrow r=\frac{2}{T}\ln{\frac{M_aT}{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:


 * $$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


 * $$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 $$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.