The physicist Freeman Dyson, who has died aged 96, became famous within science for mathematical solutions so advanced that they could only be applied to complex problems of atomic theory and popular with the public for ideas so far-fetched they seemed beyond lunacy.

As a young postgraduate student, Dyson devised – while taking a Greyhound bus ride in America – the answer to a conundrum in quantum electrodynamics that had stumped giants of physics such as Richard Feynman and Hans Bethe. As an author, guru and apostle for science, Dyson also cheerfully proposed that humans might genetically engineer trees that could grow on comets, to provide new habitats for genetically altered humans.

He had already proposed the ultimate solution to the energy crisis: a sufficiently advanced civilisation would, he argued, crunch up all the unused planets and asteroids to form a giant shell around its parent star, to reflect and exploit its radiation. Science fiction writers were delighted. The first suggestion became known as the Dyson tree. The second is called the Dyson sphere.

He was born in Crowthorne, Berkshire. His father, George Dyson, was a musician and composer, and his mother, Mildred Atkey, a lawyer. The young Dyson reported that his happiest ever school holiday – from Winchester college – was spent working his way, from 6am to 10pm, through 700 problems in Piaggio’s Differential Equations. “I intended to speak the language of Einstein,” he said in his 1979 memoir Disturbing the Universe. “I was in love with mathematics and nothing else mattered.”

He graduated from Cambridge and in 1943 became a civilian scientist with RAF Bomber Command, which experienced hideous losses with each raid over Germany. Dyson and his colleagues suggested that the Lancaster bomber’s gun turrets slowed the plane, increased its burden and made it more vulnerable to German fighters: without the turrets, it might gain an extra 50mph and be much more manoeuvrable.

He was ignored. Bomber Command, he was later to write, “might have been invented by a mad scientist as an example to exhibit as clearly as possible the evil aspects of science and technology: the Lancaster, in itself a magnificent flying machine, made into a death trap for the boys who flew it. A huge organisation dedicated to the purpose of burning cities and killing people, and doing it badly.”

The young Dyson was already convinced of some moral purpose to the universe and remained a non-denominational Christian all his life.

After the second world war he went to Cornell University in New York state to begin research in physics under Bethe, one of the team at Los Alamos that fashioned the atomic bomb.

By 1947, the challenge was one of pure science: to forge an accurate theory that described how atoms and electrons behaved when they absorbed or emitted light. The broad basis of what was called quantum electrodynamics had been proposed by the British scientist Paul Dirac and other giants of physics. The next step was to calculate the precise behaviour inside an atom. Using different aproaches, both Julian Schwinger and Feynman delivered convincing solutions, but their answers did not quite square with each other.

It was while crossing Nebraska by bus, reading James Joyce and the biography of Pandit Nehru, that the young Dyson saw how to resolve the work of the two men and help win them the 1965 Nobel prize: “It came bursting into my consciousness, like an explosion,” Dyson wrote. “I had no pencil and paper, but everything was so clear I did not need to write it down.”

A few days later he moved – for almost all of the rest of his life – to the Institute of Advanced Study at Princeton, home of Albert Einstein and Robert Oppenheimer, the father of the atomic bomb. “It was exactly a year since I had left England to learn physics from the Americans. And now here I was a year later, walking down the road to the institute on a fine September morning, to teach the great Oppenheimer how to do physics. The whole situation seemed too absurd to be credible,” Dyson wrote later.

He went on to deliver a series of papers that resolved the problems of quantum electrodynamics. He did not share in Feynman’s and Schwinger’s Nobel prize. He did not complain. “I was not inventing new physics,” he said. “I merely clarified what was already there so that others could see the larger picture.”

Dyson tackled complex problems in theoretical physics and mathematics – there is a mathematical tool called the Dyson series, and another called Dyson’s transform – and enjoyed the affection and respect of scientists everywhere. He took US citizenship, and worked on Project Orion, one of America’s oddest and most ambitious space ventures.

Orion was to be an enormous spacecraft, with a crew of 200 scientists and engineers, driven by nuclear weapons: warheads would be ejected one after another from the spaceship and detonated. This repeated pulse of blasts would generate speeds so colossal that the spacecraft could reach Mars in two weeks, and get to Saturn, explore the planet’s moons, and get back to Earth again within seven months. Modern spacecraft launched by chemical rockets can take 12 months to reach Mars, and more than seven years to reach Saturn.

The Orion project faltered under the burden of technical problems, and then was abandoned in 1965 after the partial test ban treaty that outlawed nuclear explosions in space.

Dyson was a widely read man with a gift for memorable remarks and a great talent for presenting – with calm logic and bright language – ideas for which the term “outside the envelope” could only be the most feeble understatement.

In 1960, in a paper for the journal Science, he argued that a technologically advanced civilisation would sooner or later surround its home star with reflective material to make full use of all its radiation. The extraterrestrials could do this by pulverising a planet the size of Jupiter, and spreading its fabric in a thin shell around their star, at twice the distance of the Earth from the sun. Although the starlight would be masked, the shell or sphere would inevitably warm up. So people seeking extraterrestrial intelligence should first look for a very large infra-red glow somewhere in the galaxy.

In 1972 – a year before the first serious experiments in manipulating DNA – Dyson outlined, in a Birkbeck College lecture, in London, his vision of biological engineering. He predicted that scavenging microbes could be altered to harvest minerals, neutralise toxins and to clean up plastic litter and hazardous radioactive materials.

He then proposed that comets – lumps of ice and organic chemicals that periodically orbit the sun – could serve as nurseries for genetically altered trees that could grow, in the absence of gravity, to heights of hundreds of miles, and release oxygen from their roots to sustain human life. “Seen from far away, the comet will look like a small potato sprouting an immense growth of stems and foliage. When man comes to live on the comets, he will find himself returning to the arboreal existence of his ancestors,” he told a delighted audience.

He went on to predict robot explorers that could replicate themselves, and plants that would make seeds and propagate across the galaxy. Plants could grow their own greenhouses, he argued, just as turtles could grow shells and polar bears grow fur. His audience may not have believed a word, but they listened intently.

Dyson had a gift for the memorable line and a disarming honesty that admitted the possibility of error. It was, he would say, better to be wrong than to be vague, and much more fun to be contradicted than to be ignored. Dyson was by instinct and reason a pacificist, but he understood the fascination with nuclear weaponry.

He enjoyed unorthodox propositions and contrarian arguments; he maintained a certain scepticism about climate change (“the fuss about global warming is greatly exaggerated”) and he argued that a commercial free-for-all was more likely to deliver the right design for spacecraft than a government-directed effort.

He had little patience with those physicists who argued that the world was the consequence of blind chance. “The more I examine the universe and the details of its architecture, the more evidence I find that the universe must in some sense have known we were coming,” he once said.

His Cambridge mentor, the mathematician GH Hardy, had told him: “Young men should prove theorems, old men should write books.” After Disturbing the Universe, Dyson wrote a number of compelling books, including Infinite in All Directions (1988) and Imagined Worlds (1997). In 2000, he was awarded the Templeton prize – worth more than the Nobel – given annually for progress towards discoveries about spiritual realities.

He was a frequent essayist and to the end a contributor to the New York Review of Books. But he continued to think as a scientist and in 2012 entered the field of mathematical biology with a published paper on game theory in human cooperation and Darwinian evolution.

Dyson is survived by his second wife, Imme (nee Jung), whom he married in 1958, and their four daughters, Dorothy, Emily, Mia and Rebecca; by a son, George, and daughter, Esther, from his first marriage, to Verena Huber, which ended in divorce; and by a stepdaughter, Katarina, and 16 grandchildren.

• Freeman John Dyson, mathematician and physicist, born 15 December 1923; died 28 February 2020