Excerpted from Infinite Powers: How Calculus Reveals the Secrets of the Universe, by Steven Strogatz, to be published by Houghton Mifflin Harcourt on April 2, 2019. Copyright © 2019 by Steven Strogatz. Used by permission. All rights reserved.

Working behind the scenes, calculus is an unsung hero of modern life. By harnessing the forecasting powers of differential equations—the soothsayers of calculus—humans have used an arcane branch of mathematics to change the world. Consider, for instance, the supporting role that calculus played in the fight against HIV, the human immunodeficiency virus.

In the 1980s a mysterious disease began killing tens of thousands of people a year in the U.S. and hundreds of thousands worldwide. No one knew what it was, where it came from or what was causing it, but its effects were clear—it weakened patients’ immune systems so severely that they became vulnerable to rare kinds of cancer, pneumonia and opportunistic infections. Death from the disease was slow, painful and disfiguring. Doctors named it acquired immunodeficiency syndrome (AIDS). No cure was in sight.

Basic research demonstrated that a retrovirus was the culprit. Its mechanism was insidious: The virus attacked and infected white blood cells called helper T cells, a key component of the immune system. Once inside, the virus hijacked the cell’s genetic machinery and co-opted it into making more viruses. Those new virus particles then escaped from the cell, hitched a ride in the bloodstream and other bodily fluids, and looked for more T cells to infect. The body’s immune system responded to this invasion by trying to flush out the virus particles from the blood and kill as many infected T cells as it could find. In so doing, the immune system was killing an important part of itself.

The first antiretroviral drug approved to treat HIV appeared in 1987. It slowed the virus down by interfering with the hijacking process, but it was not as effective as hoped, and HIV often became resistant to it. A different class of drugs called protease inhibitors appeared in 1994. They thwarted HIV by interfering with the newly produced virus particles, keeping them from maturing and rendering them noninfectious. Though also not a cure, protease inhibitors were a godsend.

Soon after protease inhibitors became available, a team of researchers led by David Ho (a former physics major at the California Institute of Technology and so, presumably, someone comfortable with calculus) and a mathematical immunologist named Alan Perelson collaborated on a study that changed how doctors thought about HIV and revolutionized how they treated it. Before the work of Ho and Perelson, it was known that untreated HIV infection typically progressed through three stages: an acute primary stage of a few weeks, a chronic and paradoxically asymptomatic stage of up to 10 years, and a terminal stage of AIDS.

In the first stage, soon after a person becomes infected with HIV, he or she displays flulike symptoms of fever, rash and headaches, and the number of helper T cells (also known as CD4 cells) in the bloodstream plummets. A normal T cell count is about 1,000 cells per cubic millimeter of blood; after a primary HIV infection, the T cell count drops to the low hundreds. Because T cells help the body fight infections, their depletion severely weakens the immune system. Meanwhile the number of virus particles in the blood, known as the viral load, spikes and then drops as the immune system begins to combat the HIV infection. The flulike symptoms disappear, and the patient feels better.

At the end of this first stage, the viral load stabilizes at a level that can, puzzlingly, last for many years. Doctors refer to this level as the set point. A patient who is untreated may survive for a decade with no HIV-related symptoms and no lab findings other than a persistent viral load and a low and slowly declining T cell count. Eventually, however, the asymptomatic stage ends and AIDS sets in, marked by a further decrease in the T cell count and a sharp rise in the viral load. Once an untreated patient has full-blown AIDS, opportunistic infections, cancers and other complications usually cause the patient’s death within two to three years.

The key to the mystery was in the decade-long asymptomatic stage. What was going on then? Was HIV lying dormant in the body? Other viruses were known to hibernate like that. The genital herpesvirus, for example, hunkers down in nerve ganglia to evade the immune system. The chicken pox virus also does this, hiding out in nerve cells for years and sometimes awakening to cause shingles. For HIV, the reason for the latency was unknown.

In a 1995 study, Ho and Perelson gave patients a protease inhibitor, not as a treatment but as a probe. Doing so nudged a patient’s body off its set point and allowed the researchers—for the first time ever—to track the dynamics of the immune system as it battled HIV. They found that after each patient took the protease inhibitor, the number of virus particles in the bloodstream dropped exponentially fast. The rate of decay was incredible: half of all the virus particles in the bloodstream were cleared by the immune system every two days.

Finding the clearance rate

Calculus enabled Perelson and Ho to model this exponential decay and extract its surprising implications. First, they represented the changing concentration of virus in the blood as an unknown function, V(t), where t denotes the elapsed time since the protease inhibitor was administered. Then they hypothesized how much the concentration of virus would change, dV, in an infinitesimally short time interval, dt. Their data indicated that a constant fraction of the virus in the blood was cleared each day, so perhaps the same constancy would hold when extrapolated down to dt. Because dV/V represented the fractional change in the virus concentration, their model could be translated into symbols as the following equation:

dV/V = -c dt

Here the constant of proportionality, c, is the clearance rate, a measure of how fast the body flushes out the virus.

The equation above is an example of a differential equation. It relates the infinitesimal change of V (which is called the differential of V and denoted dV) to V itself and to the differential dt of the elapsed time. By applying the techniques of calculus to this equation, Perelson and Ho solved for V(t) and found it satisfied:

ln [V(t)/V0] = -ct

Here V0 is the initial viral load, and ln denotes a function called the natural logarithm. Inverting this function then implied:

V(t) = V0e-ct

In this equation, e is the base of the natural logarithm, thus confirming that the viral load did indeed decay exponentially fast in the model. Finally, by fitting an exponential decay curve to their experimental data, Ho and Perelson estimated the previously unknown value of c.

For those who prefer derivatives (rates of change) to differentials (infinitesimal increments of change), the model equation can be rewritten as follows:

dV/dt = -cV

Here dV/dt is the derivative of V with respect to t. This derivative measures how fast the virus concentration grows or declines. Positive values signify growth; negative values indicate decline. Because the concentration V is positive, then −cV must be negative. Thus, the derivative must also be negative, which means the virus concentration has to decline, as we know it does in the experiment. Furthermore, the proportionality between dV/dt and V means that the closer V gets to zero, the more slowly it declines.

This slowing decline of V is similar to what happens if you fill a sink with water and then allow it to drain. The less water in the sink, the more slowly it flows out because less water pressure is pushing it down. In this analogy, the volume of water in the sink is akin to the amount of virus in the body; the drainage rate is like the outflow of the virus as it is cleared by the immune system.

Having modeled the effect of the protease inhibitor, Perelson and Ho modified their equation to describe the conditions before the drug was given. They assumed the equation would become:

dV/dt = P -cV

In this equation, P refers to the uninhibited rate of production of new virus particles, another crucial unknown in the early 1990s. Perelson and Ho imagined that before administration of the protease inhibitor, infected cells were releasing new infectious virus particles at every moment, which then infected other cells, and so on. This potential for a raging fire is what makes HIV so devastating.

In the asymptomatic phase, however, there is evidently a balance between the production of the virus and its clearance by the immune system. At this set point, the virus is produced as fast as it is cleared. That gave new insight into why the viral load could stay the same for years. In the water-in-the-sink analogy, it is like what happens if you turn on the faucet and open the drain at the same time. The water will reach a steady-state level at which outflow equals inflow.

At the set point, the concentration of virus does not change, so its derivative has to be zero: dV/dt = 0. Hence, the steady-state viral load V0 satisfies:

P = cV0

Perelson and Ho used this simple equation to estimate a vitally important number that no one had found a way to measure before: the number of virus particles being cleared each day by the immune system. It turned out to be a billion virus particles a day.

That number was unexpected and truly stunning. It indicated that a titanic struggle was taking place during the seemingly calm 10 years of the asymptomatic phase in a patient’s body. The immune system cleared a billion virus particles daily, and the infected cells released a billion new ones. The immune system was in a furious, all-out war with the virus and fighting it to a near standstill.

Turning hibernation on its head

The following year Ho, Perelson and their colleagues conducted a follow-up study to get a better handle on something they could not resolve in 1995. This time they collected viral load data at shorter time intervals after the protease inhibitor was administered because they wanted to obtain more information about an initial lag they had observed in the medicine’s absorption, distribution and penetration into the target cells. After the drug was given, the team measured the patients’ viral load every two hours until the sixth hour, then every six hours until day two and then once a day thereafter until day seven. On the mathematical side, Perelson refined the differential equation model to account for the lag and to track the dynamics of another important variable, the changing number of infected T cells.

When the researchers reran the experiment, fit the data to the model’s predictions and estimated its parameters again, they obtained results even more staggering than before: 10 billion virus particles were being produced and then cleared from the bloodstream each day. Moreover, they found that infected T cells lived only about two days. The surprisingly short life span added another piece to the puzzle, given that T cell depletion is the hallmark of HIV infection and AIDS.

The discovery that HIV replication was so astonishingly rapid changed the way that doctors treated their HIV-positive patients. Previously physicians waited until HIV emerged from its supposed hibernation before they prescribed antiviral drugs. The idea was to conserve forces until the patient’s immune system really needed help because the virus would often become resistant to the drugs. So it was generally thought wiser to wait until patients were far along in their illness.

Ho and Perelson turned this picture upside down. There was no hibernation. HIV and the body were locked in a pitched struggle every second of every day, and the immune system needed all the help it could get and as soon as possible after the critical early period of infection. And now it was obvious why no single medication worked for very long. The virus replicated so rapidly and mutated so quickly, it could find a way to escape almost any therapeutic drug.

Perelson’s mathematics gave a quantitative estimate of how many drugs had to be used in combination to beat HIV down and keep it down. By taking into account the measured mutation rate of HIV, the size of its genome and the newly estimated number of virus particles that were produced daily, he demonstrated mathematically that HIV was generating every possible mutation at every base in its genome many times a day. Because even a single mutation could confer drug resistance, there was little hope of success with single-drug therapy. Two drugs given at the same time would stand a better chance of working, but Perelson’s calculations showed that a sizable fraction of all possible double mutations also occurred each day. Three drugs in combination, however, would be hard for the HIV virus to overcome. The math suggested that the odds were something like 10 million to one against HIV being able to undergo the necessary three simultaneous mutations to escape triple-combination therapy.

When Ho and his colleagues tested a three-drug cocktail on HIV-infected patients in clinical studies in 1996, the results were remarkable. The level of virus in the blood dropped about 100-fold in two weeks. Over the next month it became undetectable.

This is not to say that HIV was eradicated. Studies soon afterward showed the virus can rebound aggressively if patients take a break from therapy. The problem is that HIV can hide out. It can lie low in sanctuary sites in the body that the drugs cannot readily penetrate or lurk in latently infected cells and rest without replicating, a sneaky way of evading treatment. At any time, these dormant cells can wake up and start making new viruses, which is why it is so important for HIV-positive people to keep taking their meds, even when their viral loads are undetectable.

In 1996 Ho was named Time magazine’s Man of the Year. In 2017 Perelson received a major prize for his “profound contributions to theoretical immunology.” Both are still saving lives by applying calculus to medicine: Ho is analyzing viral dynamics, and some of Perelson’s latest work helped to create treatments for hepatitis C that cure the infection in nearly every patient.

The calculus that led to triple-combination therapy did not cure HIV. But it changed a deadly virus into a chronic condition that could be managed—at least for those with access to treatment. It gave hope where almost none had existed before.