Also found in the Śulba-sūtras of Baudhāyana, Āpastamba, and Kātyāyanai are techniques for adding and subtracting squares; that is, given two squares, construct a third square whose area is the sum or difference of the two given squares. Note that we solve the classical problem of “doubling a square” by simply adding two squares of the same area. As before, these techniques rely on the Pythagorean Theorem, and are illustrated in the corresponding GeoGebra applet. Below is a translation of the original source, found in the Śulba-sūtra of Āpastamba, Section 2.4 [Plofker2, p. 21]:
Now the combination of two [square] quadrilaterals with individual [different measures]. Cut off a part of the larger with the side of the smaller. The cord [equal to] the diagonal of the part [makes an area which] combines both. That is stated.
Figure 6. This applet demonstrates the method in the Śulba-sūtra of Āpastamba for constructing a square with area equal to the sum of the areas of two given squares. Click "Go" to advance to the next step. The areas of the two given squares can be adjusted by sliding points \(D\) and \(H.\) The area of square \(JMDI\) can also be adjusted by sliding point \(I.\) The desired area is achieved when point \(I\) meets point \(K.\)
Consider two squares \(ACDB\) and \(EGHF.\) In the Geogebra applet in Figure 6, the reader may change the dimensions of the two squares, by adjusting the location of points \(D\) and \(H.\) Without loss of generality, we assume that \(EGHF\) has area less than or equal to that of \(ACDB.\)
First we mark points \(K\) and \(L\) on sides \(AB\) and \(CD\) so that \(KB\) and \(LD\) both have length equal to the side length of the smaller square \(EGHF.\) Also observe that the length of \(KL\) is the side length of \(ACDB.\)
Now the square with side length equal to that of \(KD\) is the desired square. Its area is \(KD^2\) and by the Pythagorean Theorem, \[{\rm{Area}}(ACDB)+{\rm{Area}}(EGHF)=KL^2 + LD^2=KD^2.\] In the applet, notice as we slide point \(I\) from \(B\) to \(K,\) the area of the constructed square increases, finally meeting the sum of the given areas when \(I\) meets \(K.\) Notice that when the areas of the two given squares are equal, the side of the desired square is the diagonal of a given square.
A similar technique is used to find the difference of two squares, also from Āpastamba's Śulba-sūtra, Section 2.5 [Plofker2, p. 21]:
Removing a [square] quadrilateral from a [square] quadrilateral: Cut off a part of the larger, as much as the side of the one to be removed. Bring the [long] side of the larger [part] diagonally against the other [long] side. Cut off that [other side] where it falls. With the cut-off [side is made a square equal to] the difference.
Figure 7. This applet demonstrates the method in the Śulba-sūtra of Āpastamba for constructing a square with area equal to the difference of the areas of two given squares. Click "Go" to advance to the next step. The areas of the two given squares can be adjusted by sliding points \(D\) and \(H.\) The area of square \(PNDJ\) can also be adjusted by sliding point \(I.\) The desired area is achieved when point \(I\) meets point \(M.\)
We again consider two squares \(ACDB\) and \(EGHF,\) again assuming that \(EGHF\) has area less than or equal to that of \(ACDB.\) As before, we mark points \(K\) and \(L\) on sides \(AB\) and \(CD,\) so that \(KB\) and \(LD\) have length equal to the side length of \(EGHF.\)
Now consider a circular arc, with center \(D\) and radius equal to the length of \(DB.\) Extend the circular arc until it intersects \(KL,\) say at point \(M.\) The desired square has side length equal to that of \(ML.\) By the Pythagorean Theorem applied to right triangle \(MLD,\)
\[ML^2=DM^2-LD^2={\rm{Area}}(ACDB)+{\rm{Area}}(EGHF).\]
For the last equality, notice the length of \(DM\) is equal to that of side \(DB\) of \(ACDB,\) as they are both radii of the same arc, and that \(LD\) has side length equal to the side length of \(EGHF.\) In the corresponding applet, the reader may move point \(I\) along the constructed arc to its desired position at \(M,\) and observe the change in the area of the constructed square.