Ramanujan was born on 22 December 1887 in Erode, Tamil Nadu, India, at the residence of his maternal grandparents. His father, K. Srinivasa Iyengar worked as a clerk in a sari shop and hailed from the district of Thanjavur. His mother, Komalatammal or Komal Ammal (Ammal in Tamil is equivalent of Madam in English) was a housewife and also sang at a local temple. They lived in Sarangapani Street in a traditional home in the town of Kumbakonam. The family home is now a museum. When Ramanujan was a year and a half old, his mother gave birth to a son named Sadagopan, who died less than three months later. In December 1889, Ramanujan had smallpox and recovered, unlike thousands in the Thanjavur district who succumbed to the disease that year. He moved with his mother to her parents' house in Kanchipuram, near Madras (now Chennai). In November 1891, and again in 1894, his mother gave birth, but both children died before their first birthdays.
On 1 October 1892, Ramanujan was enrolled at the local school.
In March 1894, he was moved to a Telugu medium school. After his maternal grandfather lost his job as a court official in Kanchipuram, Ramanujan and his mother moved back to Kumbakonam and he was enrolled in the Kangayan Primary School. After his paternal grandfather died, he was sent back to his maternal grandparents, who were now living in Madras. He did not like school in Madras, and he tried to avoid going to school. His family enlisted a local constable to make sure he attended school. Within six months, Ramanujan was back in Kumbakonam.
Since Ramanujan's father was at work most of the day, his mother took care of him as a child. He had a close relationship with her. From her, he learned about tradition and puranas. He learned to sing religious songs, to attend pujas at the temple and particular eating habits – all of which are part of Brahmin culture. At the Kangayan Primary School, Ramanujan performed well. Just before the age of 10, in November 1897, he passed his primary examinations in English, Tamil, geography and arithmetic. With his scores, he finished first in the district. That year, Ramanujan entered Town Higher Secondary School where he encountered formal mathematics for the first time.
By age 11, he had exhausted the mathematical knowledge of two college students who were lodgers at his home. He was later lent a book on advanced trigonometry written by S. L. Loney. He completely mastered this book by the age of 13 and discovered sophisticated theorems on his own. By 14, he was receiving merit certificates and academic awards which continued throughout his school career and also assisted the school in the logistics of assigning its 1200 students (each with their own needs) to its 35-odd teachers. He completed mathematical exams in half the allotted time, and showed a familiarity with infinite series. When he was 16, Ramanujan came across the book A Synopsis of Elementary Results in Pure and Applied Mathematics by George S. Carr.This book was a collection of 5000 theorems, and it introduced Ramanujan to the world of mathematics. The next year, he had independently developed and investigated the Bernoulli numbers and had calculated Euler's constant up to 15 decimal places. His peers of the time commented that they "rarely understood him" and "stood in respectful awe" of him.
When he graduated from Town Higher Secondary School in 1904, Ramanujan was awarded the K. Ranganatha Rao prize for mathematics by the school's headmaster, Krishnaswami Iyer. Iyer introduced Ramanujan as an outstanding student who deserved scores higher than the maximum possible marks. He received a scholarship to study at Government College in Kumbakonam. However, Ramanujan was so intent on studying mathematics that he could not focus on any other subjects and failed most of them, losing his scholarship in the process. In August 1905, he ran away from home, heading towards Visakhapatnam. He later enrolled at Pachaiyappa's College in Madras. He again excelled in mathematics but performed poorly in other subjects such as physiology. Ramanujan failed his Fine Arts degree exam in December 1906 and again a year later. Without a degree, he left college and continued to pursue independent research in mathematics. At this point in his life, he lived in extreme poverty and was often on the brink of starvation.
On 14 July 1909, Ramanujan was married to a nine-year old bride, Janaki Ammal. – in the branch of Hinduism to which Ramanujan belonged, marriage was a formal engagement that was consummated only after the bride turned 17 or 18, as per the traditional calendar. After the marriage, Ramanujan developed a hydrocele testis, an abnormal swelling of the tunica vaginalis, an internal membrane in the testicle. The condition could be treated with a routine surgical operation that would release the blocked fluid in the scrotal sac. His family did not have the money for the operation, but in January 1910, a doctor volunteered to do the surgery for free. After his successful surgery, Ramanujan searched for a job. He stayed at friends' houses while he went door to door around the city of Madras (now Chennai) looking for a clerical position. To make some money, he tutored some students at Presidency College who were preparing for their F.A. exam. In late 1910, Ramanujan was sick again, possibly as a result of the surgery earlier in the year. He feared for his health, and even told his friend, R. Radakrishna Iyer, to "hand these [my mathematical notebooks] over to Professor Singaravelu Mudaliar [mathematics professor at Pachaiyappa's College] or to the British professor Edward B. Ross, of the Madras Christian College." After Ramanujan recovered and got back his notebooks from Iyer, he took a northbound train from Kumbakonam to Villupuram, a coastal city under French control.
Life in England
Ramanujan boarded the S.S. Nevasa on 17 March 1914, and at 10 o'clock in the morning, the ship departed from Madras. He arrived in London on 14 April, with E. H. Neville waiting for him with a car. Four days later, Neville took him to his house on Chesterton Road in Cambridge. Ramanujan immediately began his work with Littlewood and Hardy. After six weeks, Ramanujan moved out of Neville's house and took up residence on Whewell's Court, just a five-minute walk from Hardy's room. Hardy and Ramanujan began to take a look at Ramanujan's notebooks. Hardy had already received 120 theorems from Ramanujan in the first two letters, but there were many more results and theorems to be found in the notebooks. Hardy saw that some were wrong, some had already been discovered, while the rest were new breakthroughs. Ramanujan left a deep impression on Hardy and Littlewood.
Littlewood commented, "I can believe that he's at least a Jacobi", while Hardy said he "can compare him only with [Leonhard] Euler or Jacobi."
Ramanujan spent nearly five years in Cambridge collaborating with Hardy and Littlewood and published a part of his findings there. Hardy and Ramanujan had highly contrasting personalities. Their collaboration was a clash of different cultures, beliefs and working styles. Hardy was an atheist and an apostle of proof and mathematical rigour, whereas Ramanujan was a deeply religious man and relied very strongly on his intuition. While in England, Hardy tried his best to fill the gaps in Ramanujan's education without interrupting his spell of inspiration.
Ramanujan was awarded a B.A. degree by research (this degree was later renamed PhD) in March 1916 for his work on highly composite numbers, which was published as a paper in the Journal of the London Mathematical Society. The paper was over 50 pages with different properties of such numbers proven. Hardy remarked that this was one of the most unusual papers seen in mathematical research at that time and that Ramanujan showed extraordinary ingenuity in handling it. On 6 December 1917, he was elected to the London Mathematical Society.
He became a Fellow of the Royal Society in 1918, becoming the second Indian to do so, following Ardaseer Cursetjee in 1841, and he was the youngest Fellow in the entire history of the Royal Society. He was elected for his investigation in Elliptic functions and the Theory of Numbers.
On 13 October 1918, he became the first Indian to be elected a Fellow of Trinity College, Cambridge.
Plagued by health problems all throughout his life, living in a country far away from home, and obsessively involved with his mathematics, Ramanujan's health worsened in England, perhaps exacerbated by stress and by the scarcity of vegetarian food during the First World War. He was diagnosed with tuberculosis and a severe vitamin deficiency and was confined to a sanatorium.
Ramanujan returned to Kumbakonam, India in 1919 and died soon thereafter at the age of 32. His widow, S. Janaki Ammal, lived in Chennai (formerly Madras) until her death in 1994.
Ramanujan's home state of Tamil Nadu celebrates 22 December (Ramanujan's birthday) as 'State IT Day', memorializing both the man and his achievements, as a native of Tamil Nadu. A stamp picturing Ramanujan was released by the Government of India in 1962 – the 75th anniversary of Ramanujan's birth – commemorating his achievements in the field of Number Theory.