** Next:** Exercises
**Up:** Exponentials - Part 1
** Previous:** Purpose

- Exponential functions in Maple
- Exponential growth and decay
- Exponential decay and effective medicine dosage

*f*(*x*) = *b*^{x}

Defining an exponential function in Maple is straightforward. For example, to define and plot the exponential function

*f*(*x*) = 2^{x}

> f := x -> 2^x;

> f(0);

> f(2.5);

> f(Pi);

> evalf(f(Pi));

> plot(f(x),x=-3..3);

The behavior of an exponential function depends very much on whether
the base, *b* is smaller or larger than 1. For example, look at the
plot generated by the following command. Make sure you understand
which curve is which, and how these two curves are related.

> plot({2^x,(1/2)^x},x=-3..3);

A problem that often arises in applications is to fit data to an
exponential function. For example, suppose you knew that *g*(*x*) was an
exponential function and that . You can use this
information to solve for the value of *b*, because it must satisfy the
equation

> b1 := solve(b^2.5 = 1/Pi,b);

> g := x -> b1^x;

> g(2.5);

> plot(g(x),x=0..6);

You might ask why it wouldn't have been simpler to just use `b`
for the label. The answer is that this would have worked the first
time you executed the command, but would generate an error the second
time you tried it, as shown below.

> b := solve(b^2.5 = 1/Pi,b);

> b := solve(b^2.5 = 1/Pi,b);

Error, (in solve) a constant is invalid as a variable, .6326158238The problem the second time is that the label

The conclusion you should draw here is the following. If you need to
solve an equation in Maple and want to label the result so you can
use it later, **don't** use the same name for the variable in the
equation and the label. Before you go on, you should clear out the
value of `b` with the command below. This makes `b` back
into a variable.

> b := 'b';

In exponential growth and decay problems, the independent variable is
almost always *t*, representing time. Another convention is to always
write the exponential functions in terms of the natural constant
*e*. That is, the general function describing exponential growth is
written

*f*(*t*) = *A e*^{kt}

*g*(*t*) = *A e*^{-kt}

For example, suppose that
growth of a population of bacteria can be modeled by an exponential
function. By running an experiment in which the number of bacteria are
counted as a function of time, a value of *k* can be determined. The
crucial fact is that the value of *k* depends on the environmental
conditions of the experiment, but does not depend on the initial
amount of bacteria present.
That is, the same value of *k* can be used to model the growth of
the same bacteria in other experiments, as long as the environmental
conditions are the same as in the original experiment. Put more
simply, if you do another experiment with the same bacteria under the
same conditions, only the value of *A*, the number of bacteria present
initially, changes.

*C*(*t*) = *C _{0}*

For example, suppose that for a particular drug, the following data
were obtained. Just after the drug is injected, the concentration is
1.5 mg/ml (milligrams per milliliter). After four hours the
concentration has dropped to 0.25 mg/ml. From this data we can
determine values of *C _{0}* and

*C _{0}* = 1.5

0.25 = 1.5 *e*^{-4k}

> k1 := solve(0.25=1.5*exp(-4*k),k);

> C1 := t -> 1.5*exp(-k1*t);

> plot(C1(t),t=0..6);

Now, suppose we are working with the same drug, but the initial dose
is doubled. Under the assumptions we have made, this means that the
initial concentration would also double to 3.0 mg/ml, and the
concentration *C*(*t*) given by our model would be

*C*(*t*) = 3.0 *e*^{-kt}

A problem facing physicians is the fact that for most drugs, there is
a concentration, *m*, below which the drug is ineffective and a
concentration, *M*, above which the drug is dangerous. Thus the
physician would like the have the concentration *C*(*t*) satisfy

*m* < *C*(*t*) < *M*

> C2 := 4.75*exp(-k1*t);

> plot(C2(t),t=0..6);

> fsolve(C2(t)=0.6,t);

1/23/1998