The only known book by Mahavira is Ganita Sara Samgraha , dated 850 AD, which was designed as an updating of Brahmagupta's book. Filliozat writes :-
This book deals with the teaching of Brahmagupta but contains both simplifications and additional information. ... Although like all Indian versified texts, it is extremely condensed, this work, from a pedagogical point of view, has a significant advantage over earlier texts.It consisted of nine chapters and included all mathematical knowledge of mid-ninth century India. It provides us with the bulk of knowledge which we have of Jaina mathematics and it can be seen as in some sense providing an account of the work of those who developed this mathematics. There were many Indian mathematicians before the time of Mahavira but, perhaps surprisingly, their work on mathematics is always contained in texts which discuss other topics such as astronomy. The Ganita Sara Samgraha by Mahavira is the earliest Indian text which we possess which is devoted entirely to mathematics.
In the introduction to the work Mahavira paid tribute to the mathematicians whose work formed the basis of his book. These mathematicians included Aryabhata I, Bhaskara I, and Brahmagupta. Mahavira writes:-
With the help of the accomplished holy sages, who are worthy to be worshipped by the lords of the world ... I glean from the great ocean of the knowledge of numbers a little of its essence, in the manner in which gems are picked from the sea, gold from the stony rock and the pearl from the oyster shell; and I give out according to the power of my intelligence, the Sara Samgraha, a small work on arithmetic, which is however not small in importance.The nine chapters of the Ganita Sara Samgraha are:
2. Arithmetical operations
3. Operations involving fractions
4. Miscellaneous operations
5. Operations involving the rule of three
6. Mixed operations
7. Operations relating to the calculations of areas
8. Operations relating to excavations
9. Operations relating to shadows
Throughout the work a place-value system with nine numerals is used or sometimes Sanskrit numeral symbols are used. Of interest in Chapter 1 regarding the development of a place-value number system is Mahavira's description of the number 12345654321 which he obtains after a calculation. He describes the number as:-
... beginning with one which then grows until it reaches six, then decreases in reverse order.Notice that this wording makes sense to us using a place-value system but would not make sense in other systems. It is a clear indication that Mahavira is at home with the place-value number system.
Among topics Mahavira discussed in his treatise was operations with fractions including methods to decompose integers and fractions into unit fractions. For example
An example of a problem given in the Ganita Sara Samgraha which leads to indeterminate linear equations is the following:
Three merchants find a purse lying in the road. One merchant says "If I keep the purse, I shall have twice as much money as the two of you together". "Give me the purse and I shall have three times as much" said the second merchant. The third merchant said "I shall be much better off than either of you if I keep the purse, I shall have five times as much as the two of you together". How much money is in the purse? How much money does each merchant have?If the first merchant has x, the second y, the third z and p is the amount in the purse then
Mahavira gave special rules for the use of permutations and combinations which was a topic of special interest in Jaina mathematics. He also described a process for calculating the volume of a sphere and one for calculating the cube root of a number. He looked at some geometrical results including right-angled triangles with rational sides, see for example .
Mahavira also attempts to solve certain mathematical problems which had not been studied by other Indian mathematicians. For example, he gave an approximate formula for the area and the perimeter of an ellipse. In  Hayashi writes:-
The formulas for a conch-like figure have so far been found only in the works of Mahavira and Narayana.It is reasonable to ask what a "conch-like figure" is. It is two unequal semicircles (with diameters AB and BC) stuck together along their diameters. Although it might be reasonable to suppose that the perimeter might be obtained by considering the semicircles, Hayashi claims that the formulae obtained:-
... were most probably obtained not from the two semicircles AB and BC.
Article by: J J O'Connor and E F Robertson