The giant Medicare hospital trust fund, which the Reagan administration last year predicted would go bankrupt by 1991, now looks financially sound until near the end of the century, according to government sources.

Lower inflation rates and tighter controls over hospital reimbursements from Medicare have caused the change, hospital industry officials said.

The Social Security trustees are expected to declare shortly in their annual report to the president and Congress that the trust fund will remain solvent at least another decade and probably until 1997-98 under the most likely set of economic projections.

The projections are based on general Reagan administration economic assumptions.

Congressional sources said they also assume that the rate of payments to hospitals under Medicare will be frozen in fiscal 1986 with no increase for inflation, as the president has planned, and then will be increased no more than the medical inflation rate plus one-quarter of 1 percent.

The new figures are a reversal of the extremely pessimistic views in every annual trustee report in recent years.

Congress has been under tremendous pressure for nearly a decade to do something to save the trust fund from imminent bankruptcy.

The projections foresee a breathing space of about a dozen years before the hospital fund begins to face insolvency.

"You're talking the year 2000," one Capitol Hill expert predicted with a note of relief in his voice.

The trust fund pays hospital bills for 30 million aged and disabled beneficiaries and is expected to have outlays of about $47 billion in 1985, financed by part of the Social Security payroll tax.

For years, Medicare costs have been rising steeply because inflation in the medical sector of the economy has far outpaced general inflation.

Last year, the board of trustees, then consisting of the secretaries of health and human services, labor and the treasury, declared that the trust fund's reserve as a proportion of a year's benefits "is projected to remain between 20 and 40 percent through the late 1980s and then decline rapidly with complete exhaustion of the fund in 1991." At that time the reserve totaled about $13 billion.

The new projections reflect changes that have been going on for several years, including the new Medicare prospective-payment system enacted in 1983, which sets fixed payment rates in advance for each illness.

Mike Bromberg, director of the Federation of American Hospitals, the organization of about 1,000 for-profit hospitals (15 percent of the nation's hospitals) said, "I think the trust fund is going to be okay way beyond 1995, maybe beyond 2000, as a result of recent developments. The assumptions about hospital cost increases in the past have been too pessimistic.

"The Medicare patient average length of stay has gone down from 9.5 to 7.5 [days] from 1983 to 1984. Admissions are down 1.7 percent. Doctors are changing the way they practice medicine."

He said the prospective-payment system puts pressure on doctors and hospitals to hold costs down because a hospital receives a fixed payment per case rather than getting extra money for keeping patients hospitalized longer or requiring more tests.

Others have said a factor in reducing medical inflation is the increased tendency of business, which pays about $85 billion a year for employe medical insurance, to shop around more for services and policies.

Carolyne K. Davis, administrator of Medicare, said in a speech last week that inpatient hospital costs of Medicare, which increased an average of 10.3 percent annually from 1973 to 1982, rose 3.8 percent in 1984. She added that if this rate is maintained, the trust fund will be secure to the end of the century.