The discovery of Neptune was a great triumph of mathematical astronomy. By the 1840s, astronomers had known for years that Uranus was not moving as predictions said it should, and that there must be another planet affecting its orbit.
Acting independently, two mathematician-astronomers, Urbain Le Verrier in France and John Couch Adams in England, took the discrepancies and tried to determine where this planet might be, assuming likely values for distance, mass, and so on.
Their research produced nearly the same result, but the British were slow to follow up Adams's prediction. Le Verrier had more luck, and on 23 September 1846, following Le Verrier's directions, Johann Galle and Heinrich d'Arrest at the Berlin Observatory found the planet on the first night of searching—in tact, within half an hour. In the end, after much embittered finger-pointing among British astronomers, Adams received joint credit with Le Verrier for the discovery.