In the case of \(\sqrt{5}=\sqrt{2^2+1}\) with \(a=2\) and \(r=1\), \(\:\frac{2a}{r}=\frac{4}{1} = 4\) is an integer. Therefore, its reciprocal, \(\frac{r}{2a}=\frac{1}{4}\), is a unit fraction; that is, a fraction with numerator \(1\). For all square roots for which this is true, and only for these, there is a simplification of al-Hassar's method.
First we see that \[ \left(a\pm \frac{1}{n}\right)^2= a^2\pm\frac{2a}{n}+\frac{1}{n^2}.\] This means that, for both the plus and the minus cases, the excess is \(\frac{1}{n^2}\), again a unit fraction. This is true for all further approximations. In all of these cases the first approximation is \(a\pm \frac{1}{n}=\frac{an\pm 1}{n}\). We call this fraction \(\frac{p}{q}\).
To get the next approximation according to al-Hassar's rule, the excess \(\frac{1}{n^2}=\frac{1}{q^2}\) has to be divided by double the preceding approximation, namely \(2\left (\frac{p}{q}\right)=\frac{2p}{q}\). We have \[\frac{1}{q^2}\div\frac{2p}{q}=\frac{1}{q^2}\times\frac{q}{2p}=\frac{1}{2pq}.\]
This has to be subtracted from \(\frac{p}{q}.\) But \[ \frac{p}{q}-\frac{1}{2pq}= {\frac{2p^2-1}{2pq}}.\] And with this simple formula -- much easier to use than al-Hassar's – we obtain an increasingly accurate series of approximations. (This formula is not new. It was given in 1766 by the Italian-French mathematician Joseph-Louis Lagrange (1736-1813); see Oeuvres de Lagrange, vol. 1, p. 695.)
Let us apply the formula \({\frac{2p^2-1}{2pq}}\) to get the third approximation of \(\sqrt{5}\) from al-Hassar's second approximation \(\frac{p}{q}=\frac{161}{72}.\) We have \(2p^2-1= 2\times 161^2-1=2\times 25921-1=51841\) and \(2pq=2\times 161\times72=23184. \) Therefore, the third approximation is \(\frac{51841}{23184}\), or, in decimals, 2.2360679779158\dots\). Its square is \(5.000000001860\dots\). The excess is \(1.860...\times10^{-9}\). This is equal to \(\left(\frac{1}{23184}\right)^2\).
When we calculate the next approximations with our formula, we find that the excess of the fourth approximation is \(1.730...\times10^{-19}\) and of the fifth approximation \(1.497...\times10^{-39}\), really excellent results obtained so easily.