(C) Copyright 1994 D.C.M. Burbulla and  C.T.J. Dodson
       Notebook to support the book
     Self-Tutor for Computer  Calculus

Using Mathematica 2

by
     D. C. M. Burbulla and C. T. J. Dodson, University of Toronto
 Published by:    
    Prentice-Hall Canada  (English)   ISBN 0130152803     and 
     Prentice-Hall Japan  (Japanese) ISBN4-8101-8558-3 C3055 P2880E

Exponential and Logarithmic Functions

The Natural Logarithm as a Definite Integral

We have already the  means to find the integral of x^n for any integer n,
except n=-1. For this we use the standard mathematician's device and invent
a function to be the solution, when no known function will serve.

Plot[Integrate[1/t,{t,1,x}],{x,0.1,10},
                               AxesLabel->{"x","Log[x] "}];

Series[Log[1+x], {x,0,10}]

The Natural Exponential Function

Clearly, or by using D, Log has a positive derivative for x>0. hence has an inverse, 
which we call exp and discuss below.

Plot[Exp[x] ,{x,-2 ,3 },AxesLabel->{"x","E[x]"}];

Series[Exp[x], {x,0,10}]

ListPlot[Table[(1+(1/n))^n ,{n,1,100}],
                     AxesLabel->{"n","(1+(1/n))^n"}];

Plot[2.71828,{x,0,100}];

Show[%,%%];

Applications

Your calculus book will give you numerous applications of the Log and exp
functions. Here is an application from probability. Probability theorists often 
model random processes by the Poisson Distribution: 
the probability of n events when the mean number is m is given by
p(n) = exp(-m) (m^n)/n!
We tabulate and plot this for the case m=2.

Table[E^-2 2^n/n! ,{n,0,10 }]

ListPlot[%,AxesLabel->{"n","Poisson Distribution"}];

For example, if you use a random number generator to provide coordinate 
pairs of points on a square grid, the probability that individual subsquares 
contain specified numbers of points is well modelled by such a distribution; 
the expected or mean number per subsquare is just the ratio of the total number 
of points to the number of subsquares.

Here is an application of the exponential function to generate an S-shaped
curve often used to model growth, called a Richards function:

Clear[f]; f[n_,t_]:=(1+100 E^(-t/2))^(-1/n)

Plot[{f[1,t],f[2,t],f[3,t],f[4,t],f[5,t],f[6,t]},{t,0,20}];

Investigate the differential equation that f must satisfy in t for fixed k,m,n. 
Try taking the logarithm of f before differentiating, and hence eliminate the explicit 
appearance of t.   Is  f  always increasing?

In general relativity, planetary orbits are approximated by geodesics (Greek for divides the 
Earth, because that is what great circles do on a sphere) which are curves of extremal length. 
The equations for the appropriate geodesics are rather involved but we know that they have 
approximate solutions that look like slowly rotating ellipses. The direction of the rotation of 
the ellipse is the same as that of the planet following the orbit; hence the reference to the 
advance of the perihelion. The approximate solution that comes from the theory is given in 
polar form by the radius function:

r[e_,k_,a_]:= 1/(1+e Cos[a-k a]);

For purposes of illustration we choose some values for k and e and assume that
 the ratio of major to minor axis of our planet is 0.5. Then we proceed as follows,

e=0.6; k=0.02

ParametricPlot[{r[e,k,a] Cos[a],0.5 r[e,k,a] Sin[a]}, 
        {a,0, 2 Pi}, AspectRatio->Automatic];

This plots one complete orbit, but to see the advance of the perihelion we need to see 
several orbits in succession:

ParametricPlot[{r[e,k,a] Cos[a],0.5 r[e,k,a] Sin[a]}, 
        {a,0, 12 Pi}, AspectRatio->Automatic];