Most lingering coughs are the residual effect of a cold or flu, and they can last for weeks and weeks, get better or worse, and still not represent anything more than a nuisance, Dr. Edelman said. But the misery associated with coughs sends more than 30 million people to the doctor every year. And there are certainly circumstances under which a doctor should be consulted.

Among them, Dr. Edelman said, are patients with underlying medical conditions like C.O.P.D. (chronic obstructive pulmonary disease) or asthma, even mild cases of asthma. “People with asthma should have an action plan established in consultation with their doctor — what to do ‘in case’ a cough develops,” he said. “It’s best to catch it early, when the inflammation just starts because it’s harder to treat when it’s well established.”

He added, “People with a significant underlying health problem should not wait four weeks to see a doctor.” Also, he said, “if every winter you get cold after cold followed by a cough, you should see a doctor right away because it could represent an underlying problem.”

Other circumstances that warrant medical attention include persistent coughs that interfere with the ability to sleep; coughs associated with fever, chills and feeling unwell; and coughs that produce blood in the sputum.

Then there are the coughs that become chronic, persisting beyond eight or more weeks. They could result from an irritated, inflamed airway that may require treatment with an inhaled corticosteroid to reduce the inflammation, Dr. Edelman said.

Writing in The New England Journal of Medicine, Dr. Ashley Woodcock and Jaclyn A. Smith estimated that chronic cough affects “as much as 12 percent of the general population.” It affects more women than men, most often in their 40s and 50s, and can persist for years “with substantial physical, social and psychological effects,” they wrote.

In addition to respiratory diseases like asthma, possible causes of chronic cough include a persistent postnasal drip that may result from an allergy, sinus infection, airborne irritant, or even exposure to very dry cold air. Depending on the cause, the best treatment may involve an oral antihistamine, nose drops, a vaporizer or, if an infection is found, antibiotics. But Dr. Edelman warned against using a humidifier with a water reservoir that can become contaminated with a fungus unless it is thoroughly cleaned daily. Also, overly humidifying the air can foster dust mites, which are common allergens.