next up previous
Next: Exercises Up: Exponentials - Part 1 Previous: Purpose

Subsections


Background

Exponential functions in Maple

An exponential function is a function of the form

f(x) = bx

where b is a positive constant and x is any real number. The number b is often called the base. The special case b=1 is usually excluded, because that would just give the constant function f(x)=1.

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

f(x) = 2x

the following Maple commands could be used. They also show how to obtain numerical values for several x values.
  > f := x -> 2^x;

\begin{maplelatex}
\begin{displaymath}
{f} := {x} \rightarrow 2^{{x}}\end{displaymath}\end{maplelatex}
  > f(0);

\begin{maplelatex}
\begin{displaymath}
1\end{displaymath}\end{maplelatex}
  > f(2.5);

\begin{maplelatex}
\begin{displaymath}
5.656854249\end{displaymath}\end{maplelatex}
  > f(Pi);

\begin{maplelatex}
\begin{displaymath}
2^{{ \pi}}\end{displaymath}\end{maplelatex}
  > evalf(f(Pi));

\begin{maplelatex}
\begin{displaymath}
8.824977830\end{displaymath}\end{maplelatex}
  > 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 $g(2.5)=1/\pi$. You can use this information to solve for the value of b, because it must satisfy the equation

\begin{displaymath}
b^{2.5} = \frac{1}{\pi} \end{displaymath}

In Maple, this can be done with the solve or fsolve command. The following example shows how to find the value of b, and use it to construct the function g(x). Notice the use of the label b1 in the definition of the function.
  > b1 := solve(b^2.5 = 1/Pi,b);

\begin{maplelatex}
\begin{displaymath}
{\it b1} := .6326158238\end{displaymath}\end{maplelatex}
  > g := x -> b1^x;

\begin{maplelatex}
\begin{displaymath}
{g} := {x} \rightarrow {\it b1}^{{x}}\end{displaymath}\end{maplelatex}
  > g(2.5);

\begin{maplelatex}
\begin{displaymath}
.3183098860\end{displaymath}\end{maplelatex}
  > 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);

\begin{maplelatex}
\begin{displaymath}
{b} := .6326158238\end{displaymath}\end{maplelatex}
  > b := solve(b^2.5 = 1/Pi,b);
Error, (in solve) a constant is invalid as a variable, .6326158238

The problem the second time is that the label b has a value after the first command above, so it can't act as a variable in the second command.

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';

\begin{maplelatex}
\begin{displaymath}
{b} := {b}\end{displaymath}\end{maplelatex}

Exponential growth and decay

Exponential functions show up in lots of applications, ranging from financial calculations to heat transfer to bacterial growth. In this lab, we will work with exponential functions to model the concentration of a drug in a patient. Before we introduce the model, we need some general background on models of growth and decay.

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 ekt

where A is a constant and k is a positive constant. The general form for exponential decay is

g(t) = A e-kt

where A is a constant and k is a positive constant. The reason these conventions are used is that these forms arise naturally in solving problems that involve exponential growth and decay. The constant A is the value of the function at t=0. The constant k is called the growth rate in exponential growth and the decay rate in exponential decay. In a process that can be modeled by exponential functions, the rate constant k depends only on the process and the conditions under which it is carried out.

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.

Exponential decay and effective medicine dosage

In this section we describe an exponential decay model for the concentration of a drug in a patient's body. We assume that the drug is administered intravenously, so that the concentration of the drug in the bloodstream jumps almost immediately to its highest level. The concentration of the drug then decays exponentially. If we use C(t) to represent the concentration at time t, and C0 to represent the concentration just after the dose is administered then our exponential decay model would be given by

C(t) = C0 e-kt

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 C0 and k as follows. The value of C0 is the initial concentration, so we have

C0 = 1.5

To find the value of k we need to solve the equation

0.25 = 1.5 e-4k

which we get by plugging in t=4 and using the data C(4)=0.25. Maple commands for solving for k and defining and plotting the function C(t) are shown below.
  > k1 := solve(0.25=1.5*exp(-4*k),k);

\begin{maplelatex}
\begin{displaymath}
{\it k1} := .4479398673\end{displaymath}\end{maplelatex}
  > C1 := t -> 1.5*exp(-k1*t);

\begin{maplelatex}
\begin{displaymath}
{\it C1} := {t} \rightarrow 1.5\,{\rm e}^{(\, - {\it k1}\,{t}\,)}\end{displaymath}\end{maplelatex}
  > 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

where k would have the same value, k=0.4479398673 found above.

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

This requirement helps determine the initial dose of a drug and when the next dose should be administered. For example, suppose that for the drug in the experiment the maximum safe concentration is 5 mg/ml, or M=5, and the minimum effective concentration is 0.6 mg/ml, or m=0.6. Then the initial dose must not produce a concentration greater than 5 mg/ml. Suppose that the initial dose is chosen to produce an initial concentration of 4.75 mg/ml. Then how many hours later will the drug concentration reach the minimum effective level? The answer is about 4.6 hours, as shown by the following commands.
  > C2 := 4.75*exp(-k1*t);

\begin{maplelatex}
\begin{displaymath}
{\it C2} := 4.75\,{\rm e}^{(\, - .4479398673\,{t}\,)}\end{displaymath}\end{maplelatex}
  > plot(C2(t),t=0..6);
  > fsolve(C2(t)=0.6,t);

\begin{maplelatex}
\begin{displaymath}
4.618857112\end{displaymath}\end{maplelatex}

next up previous
Next: Exercises Up: Exponentials - Part 1 Previous: Purpose

William W. Farr
1/23/1998