This Andean country's cocaine trade with the United States, after five years of explosive growth, has transformed what for centuries was a locally consumed agricultural product into the dominant force in the economy.

Cocaine is derived from the wide, flat leaves of the coca plant, which grows naturally on the mountain slopes in Bolivia and Peru. For hundreds of years, coca has been cultivated by small farmers and sold to miners and peasants, who chew the leaves to ward off fatigue and hunger and as a remedy for almost any kind of illness.

Since 1976, however, when narcotics traffickers from Colombia first came here on a large scale, the ancient tradition has been transformed into a billion-dollar-a-year business controlled by a network of traders who maintain their own factories, airstrips and fleets of twin-engine planes in Bolivia's remote northern jungles.

Cocaine and coca-leaf paste have became the country's leading exports, and much of Bolivia's small and weak economy is now dependent on the crop. According to U.S. and Bolivian government estimates, more than 25,000 farmers are growing coca, producing in excess of 80,000 tons this year, a 100 percent increase since 1977. Most of the more than 200 tons of cocaine that results winds up in the United States.

The coca boom at times has been facilitated and even encouraged by the country's military governments. During the rule of Gen. Luis Garcia Meza in 1980 and 1981, the United States accused military authorities of involvement in cocaine trafficking.

Bolivia's new government, with U.S. help, is promising a campaign against the coca industry. But the uncontrolled growth of the last five years has caused even the most optimistic analysts to predict that it may take a decade of government intervention to relieve the Bolivian economy of its cocaine addiction.

"You're looking at something that's completely out of control," said one enforcement official. "Even if they were to deploy the entire Bolivian Army, they could probably only affect a small percentage of the crop."

Economics lies behind cocaine's seeming indestructibility. During 20 months in 1979 and 1980, according to a study commissioned by the State Department, coca-leaf prices multiplied 15 times. Bolivian officials say a 2.5 acre crop of coca is worth around $5,000, while the same land planted in coffee yields $500.

Officials hope gradually to turn this lucrative economy around by persuading farmers--by force if necessary--to substitute other cash crops for coca. This program, which has been stalled for 18 months by a U.S. aid cutoff, would involve tens of millions of dollars for building the markets and providing the equipment necessary to make the new crops profitable.

But most Bolivian observers remain skeptical. "How are you going to convince a poor peasant to starve himself growing cotton when he can get four crops of coca a year with less work?" asked one Bolivian analyst. "As long as Americans are paying all those dollars for cocaine, people here will keep planting coca."