Think of all the energy that goes into making a single solar panel. Quartz and copper must be mined. The raw materials must be converted into wafers, then encased in protective material. And after panels leave the factory, they must be shipped all over the world.

Now imagine these consequences spread over four decades—the environmental cost of the solar industry. Given all the research, development, and production time that goes into making any one panel, a skeptical solar-buyer might wonder: Has the solar industry on the whole really saved any energy at all?

To that concern, a new analysis answers: Yes.

The solar industry probably paid off its long-term energy and climate “debts” in 2011, a study published this week in Nature Communications finds. Since its inception in 1975, the solar-panel industry has almost certainly prevented more greenhouse-gas emissions than it emitted. It has also cumulatively produced more energy than it initially required.

In other words, the solar industry is now likely historically carbon-neutral, if not carbon-negative.

The news comes at an odd time for the solar industry worldwide. On the one hand, the cost of solar-panel installation continues to plummet. In many sunny parts of the world, solar energy is now cheaper than fossil fuels, even without subsidies. At the same time, the American renewable-energy industry may face a hostile new presidential administration, which is already staffed with fossil-fuel executives who have signaled they may pull government loans and tax credits for the technology.

This study, conducted by researchers at the University of Utrecht and the University of Groningen, is a type of research called “lifecycle analysis,” which investigates the total environmental impact of a product over time. The paper attempts a lifecycle analysis of the entire industry. That kind of research is tricky: Researchers must find and calibrate years of economic and energy data, collected across 40 years, in many different countries, with different goals in mind.

So the study provides both a best-case and a worst-case scenario. Even in the pessimistic case, the authors find that the solar industry will “break even” on net energy in 2017 and on greenhouse gas emissions in 2018. The most optimistic scenario, on the other hand, indicates that the solar industry paid off its energy and carbon “debts” during the Clinton administration, in 1997.

Once the solar industry becomes net carbon-negative, it will stay that way, as solar-panel manufacturing has gotten cheaper, cleaner, and more energy-efficient over time. And, of course, the carbon footprint of the solar industry is much, much smaller than that of the oil or gas business.

How is the window when the solar industry may have “broken even” more than 20 years long? Outside researchers say that it has to do with the amount of uncertainty associated with this kind of analysis.

“Overall I think their methods are solid, but this type of analysis is fraught with assumptions,” says Scott Hersey, a professor of chemical and environmental engineering at Olin College, in an email. “[The authors] are (mostly) clear about the assumptions they’re making and actually provide ranges of results based on making estimates on the high and low end for particular factors, which is good practice.”

Here are some of the biggest sources of uncertainty that the authors identified:

How old is the solar environmental-impact data? The study’s explicit task is to compare the environmental-impact data from the 1970s to the same data from the 2010s. But most people consider the newer data to be of significantly higher quality.

“The older papers have sometimes murky methods and can’t necessarily be compared apples to apples with new papers,” says Hersey. Even though the authors only used old data they believed could “harmonize” with the new, the uncertainties baked into the old methodologies could compound over time.

Where were the panels produced? Many solar panels are manufactured in Europe and in China. The environmental consequences of production or installation in those locations are very different. China relies on coal burning for much of its electricity, and it has fairly lax environmental protections. The EU, on the other hand, already heavily relies on clean energy, and it has a large and entrenched environmental bureaucracy.

When solar panels are manufactured in China, they require a lot of energy and produce relatively dirty emissions. When they are made in Europe, they need relatively little energy and produce cleaner emissions.

Yet by the same token, a panel installed in China prevents more greenhouse-gas emissions than one installed in Europe.

The authors account for this by recalculating the cost of producing a panel for every year of their analysis, based on whether panels were made in China, Europe, or elsewhere in the world. But they also had to extend their analysis into the future. “They had to make assumptions about where future production and installation would happen, which introduces some uncertainties,” says Hersey.

How much energy do solar panels produce? Production ratio is the term for how much energy is actually being produced by solar panels, as opposed to how much energy they should produce. It is an extremely important figure for analysis like this—and also one of the hardest statistics to track before the present day. Just about everything can alter an individual panel’s production ratio, including whether it’s angled correctly, whether it gets too hot, and whether it wastes energy in transmission. Production ratio is also uneven across the planet: A panel installed in Saudi Arabia, where it’s always sunny and clear, will likely have a higher production ratio than one installed in Argentina.

Solar systems are better at tracking this ratio today. But there’s basically no database for this type of information going back decades.

Therefore, the authors advance two vastly different scenarios for production ratio over time. One scenario assumed that all panels since the 1970s have produced half the energy they should, and that this figure has never improved. (A 50 percent production ratio is about as bad as it gets.) The other scenario assumed that the production ratio started out low in 1975, but that it has slowly risen over time to  a stable 80 percent.

“Different assumptions [about this ratio] impact the break-even point for energy and greenhouse gas emissions by a few years,” says Hersey. He called the lack of data about it “a big point of uncertainty,” but concurred with the authors that “there aren’t many data available to do a better job.”

Does it make sense to get into all this uncertainty? I find it academically interesting—a glimpse at the difficulty of quantifying the sheer extent of the economic flows that remake the world.

For consumers, the researchers’ most general finding might be the most important. The solar industry is poised to prevent more carbon emissions than it has caused, if it hasn’t passed that mark already. People who want to participate in the industry—whether that’s by investing in companies or buying rooftop panels—should do so without feeling like they’re getting involved in a crypto carbon-emitting boondoggle.

And not all the uncertainty in the data is necessarily bad. The authors point out that solar panels keep defying experts’ predictions, as every year they get steadily cheaper, more widespread, and more efficient. “The future development of [photovoltaics] is very difficult to predict,” they say. “Every year of development seems to exceed our expectations.”