It was painful to watch: Energy Secretary Steven Chu, onetime advocate of higher gas prices, explaining his change of heart at a Senate hearing this week.

Asked by Senator Mike Lee, Republican of Utah, about his oft-cited 2008 statement that "somehow we have to figure out how to boost the price of gasoline to the levels in Europe" to reduce consumption of fossil fuels, on Tuesday Chu said: "I no longer share that view."

Whence the epiphany? First, Chu left academia a few months after that interview to head the DOE. Second, gas prices have shot up to $3.81 a gallon, according to AAA. Third, his boss is facing reelection with polls showing prices at the pump and Obama's popularity moving in opposite directions.

So what's a good Cabinet secretary to do? Take one for the team, of course. "When I became secretary of Energy, I represented the U.S. government," Chu said at the hearing of the Energy and Natural Resources Committee. "Of course we don’t want the price of gasoline to go up, we want it to go down."

Of course we don't! At his March 6 press conference, President Barack Obama was asked about his suspected support for higher gas prices to make alternative energy more competitive. "Just from a political perspective, do you think the president of the United States going into re-election wants gas prices to go up higher?" Obama said.

I'm glad he included that phrase "from a political perspective." Otherwise, the public might be fooled by his actions, such as his lobbying of Senate Democrats to reject the Keystone XL oil pipeline, into thinking he -- and his energy secretary -- really do harbor a preference for higher gas prices.

(Caroline Baum is a Bloomberg View columnist. Follow her on Twitter.)

For more quick commentary from Bloomberg View, go to the Ticker.