Alternative energy investments like wind and solar power have not performed well in recent years. To make matters worse, the Trump administration has opted for a resurgence of coal and other carbon fuels, not an emphasis on alternative energy.

Yet there is a reasonable argument that the outlook for investing in renewable energy may actually be quite good.

For one thing, wind and solar power have been rapidly winning market acceptance. Last year, the installed capacity of solar power in the United States nearly doubled. And wind is now being harnessed to produce 5.5 percent of America’s electricity, according to the U.S. Energy Information Administration.

Five states draw at least 20 percent of their electricity needs from wind. Kansas, for example, relied on wind for less than 1 percent of its electric power as recently as 2005. By 2016, wind produced 29.6 percent of its electric power, according to government figures.

Intriguingly, all five of the most wind-dependent states — Kansas, Iowa, Oklahoma, North Dakota and South Dakota — are traditional Republican strongholds. “The windiest places in the country are all red states,” said Garvin Jabusch, a manager of the Shelton Green Alpha mutual fund.

And the solar industry now employs over 260,000 workers nationwide, many of them in states that have leaned Republican. Texas, Florida, Arizona and North Carolina are among the largest solar employers.

The reliance of these states on wind and solar could foreshadow continuing support for alternative energy within sectors of the Republican party, despite the pro-fossil-fuel stance of the president. Along with Gina M. Raimondo, the Democratic governor of Rhode Island, Sam Brownback, the Republican governor of Kansas, recently wrote a letter to President Trump that said “expanding renewable energy production is one of the best ways to meet the country’s growing demand for energy.” And, the governors added, “The nation’s wind and solar resources are transforming low-income rural areas in ways not seen since the passage of the Homestead Act over 150 years ago.”

Ryan Issakainen, exchange-traded fund strategist and senior vice president at First Trust Bank, said that such sentiments could maintain policy support for solar and wind power. “Policies that favor coal over other sources would be sound in places like West Virginia,” he said. “But if you’re in the middle part of the country where you’ve got more opportunity for wind power, you’re not going to be supportive of pro-coal policies.”

Edward Guinness, portfolio manager of the Guinness Atkinson Alternative Energy fund, went further, saying, “I think the presence of wind and solar production in red states could splinter the G.O.P. on Trump’s plans.”

Still, solar’s recent past has been miserable for many investors. The Guggenheim Global Solar ETF has lost over 24 percent a year over the last three years, according to Morningstar. Wind has fared better, but with an annual total return of 4.95 percent the last three years First Trust Global Wind Energy ETF has lagged in an exuberant bull market. The Standard & Poor’s 500-stock index, for example, gained over 10 percent a year in the same period.

But for solar power, the fundamental economic outlook may conceivably be improving. “The reason solar stocks have done poorly is a big oversupply of panels, which drove down the price,” said Richard Asplund, research director for the MAC Solar Index, the tracking index for the Guggenheim Solar fund. “Pricing looks better for this year and next.”

The Guinness Atkinson fund, loaded with Chinese solar panel producers, has suffered large losses the last three years. But it was up nearly 5 percent in the first quarter.

Mr. Guinness says that investors have been too gloomy. “The sentiment on the sector is terrible,” he said. Negative sentiment has produced valuations “as low as we’ve seen” by measures like price to book, Mr. Guinness said.

Part of the problem, he said, is that solar power has been widely viewed as a heavily subsidized market. But the latest extension of the federal Investment Tax Credit phases out solar subsidies for homes by 2021.

Solar power will soon have to compete without government support, Mr. Guinness said, but he’s untroubled by the switch. “We’re excited about the transition from a government market to a nonsubsidized market,” he said.

Such excitement may be difficult to sustain in the wake of recent Trump actions. On March 28, the president signed an executive order to initiate a rewrite of President Obama’s Clean Power Plan, an initiative designed to speed utility conversion from coal. Under that plan, renewable energy sources were projected to become more important than coal and second only to natural gas in electricity generation by 2030, said Chris Namovicz, lead renewable energy analyst at the U.S. Energy Information Administration. If the Clean Power Plan is really abandoned, he said, “in 2040, renewables will still be third, behind both coal and natural gas.”

Rolling back the plan entirely will be difficult, and Mr. Jabusch, who runs the Shelton Green Alpha fund, remains optimistic about the sector. His fund returned 8.51 percent in the 12 months through March 31. He estimates that 20 to 24 percent of his portfolio is typically invested in companies involved with renewable energy.

Mr. Jabusch is particularly bullish on solar power. “I think solar has been mispriced,” he said. While falling prices have hurt panel producers, he said, price declines have expanded the market, and low valuations represent an enormous buying opportunity. “The solar companies could be 10-baggers over the next decade,” investments that could increase tenfold, Mr. Jabusch said, borrowing a term from Peter Lynch, the Fidelity mutual fund manager.

Mr. Jabusch said he favors companies like 8Point3 Energy Partners, which offers a yield of roughly 8 percent, and JA Solar Holdings Company, which derives most of its revenues from Europe and Asia and is, in his view, attractively priced.

Mr. Asplund, the research director for the MAC Solar Index, argues that even if the Trump administration’s energy policies pose a problem, solar power investments can still prosper. “The solar industry is a global industry,” he said. “U.S. installations are less than one-quarter of global. Trump is a negative for solar, but Trump by himself isn’t going to kill the solar business.”