In
1786, Frederick died, and Lagrange, who had found the climate of Berlin trying, gladly accepted the offer of
Louis XVI to migrate to Paris. He received similar invitations from
Spain and
Naples. In France he was received with every mark of distinction and special apartments in the Louvre were prepared for his reception, and he became a member of the
French Academy of Sciences, which later became part of the
National Institute. At the beginning of his residence in Paris he was seized with an attack of the melancholy, and even the printed copy of his
Mécanique on which he had worked for a quarter of a century lay for more than two years unopened on his desk. Curiosity as to the results of the
French revolution first stirred him out of his lethargy, a curiosity which soon turned to alarm as the revolution developed.
It was about the same time,
1792, that the unaccountable sadness of his life and his timidity moved the compassion of a young girl who insisted on marrying him, and proved a devoted wife to whom he became warmly attached. Although the decree of
October 1793 that ordered all foreigners to leave France specifically exempted him by name, he was preparing to escape when he was offered the presidency of the commission for the reform of weights and measures. The choice of the units finally selected was largely due to him, and it was mainly owing to his influence that the decimal subdivision was accepted by the commission of
1799. In 1795, Lagrange was one of the founding members of the
Bureau des Longitudes.
Though Lagrange had determined to escape from France while there was yet time, he was never in any danger; and the different revolutionary governments (and at a later time,
Napoleon) loaded him with honours and distinctions. A striking testimony to the respect in which he was held was shown in
1796 when the French commissary in Italy was ordered to attend in full state on Lagrange's father, and tender the congratulations of the republic on the achievements of his son, who "had done honour to all mankind by his genius, and whom it was the special glory of
Piedmont to have produced." It may be added that Napoleon, when he attained power, warmly encouraged scientific studies in France, and was a liberal benefactor of them.