It cost more than 47 cents a mile to own and operate new compact cars in big cities last year, half again as expensive as in 1979, according to a Hertz Corp. survey.

Hertz, the nation's biggest rental car agency, said Los Angeles was the costliest city in which to run an automobile. The average owner of a compact car in Los Angeles spent 57.85 cents a mile to operate the vehicle.

In Washington, operating costs were below the big-city average, Hertz's annual survey reported. The average Washington area resident paid 44.63 cents a mile to own and operate a 1981 compact car. That is up from 38.2 cents in 1980 and 30.36 cents in 1979. Washington ranked 16th of the 20 cities surveyed by Hertz.

Detroit, the automobile capital of the nation, was the least expensive, with average costs of 41.95 cents a mile.

Hertz said that continued increases in car prices and high interest rates on automobile loans were the major factors behind operating increases between 1979 and 1981.

"Average major-city compact-model purchase prices jumped to $7,694 in 1981 from $6,542 in 1980 and $5,136 in 1979. Loan rates went from under 13 percent to over 16 percent in the two years," Hertz said.

It costs more money to operate cars in big cities than in suburban or rural areas, Hertz said, because insurance rates and sales taxes usually are higher in major urban areas. While the big-city average was 47.34 cents a mile, the national average was 44.57 cents a mile.

Hertz figures the cost-per-mile based on a four-year life for the vehicle. The rental agency said the typical car is driven 10,000 miles a year. The cost figures do not include tolls or garage costs.