linexp.mws

Linear and Exponential Functions.

1.  Linear Functions

>    f:= x-> 3*x+1;

f := proc (x) options operator, arrow; 3*x+1 end proc

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

[Maple Plot]

Note that the graph of f(x) is a straight line passing through the point (0,1).  This point is called the y-intercept of f(x).

To determine the slope, take any two values of x, say x1 and x2, and form the difference quotient.  The result will always be the same.

>    x1:=1.0; x2:=2.0;

x1 := 1.0

x2 := 2.0

>    (f(x2)-f(x1))/(x2-x1);

3.000000000

>    x1:=.5; x2:=-.25;

x1 := .5

x2 := -.25

>    (f(x2)-f(x1))/(x2-x1);

3.000000000

>    x1:=Pi; x2:=sin(1);

x1 := Pi

x2 := sin(1)

>    (f(x2)-f(x1))/(x2-x1);

(3*sin(1)-3*Pi)/(sin(1)-Pi)

>    evalf(%);

3.000000000

In fact, any function of the form f(x)=m*x+b or any function which can be placed in that form is a linear function, with slope m and y-intercept (0,b).

Now, given a table of function values, how can we determine if that function is linear?  Consider #29, p. 10.

>    g:=[[1,23],[2,24],[3,26],[4,29],[5,33],[6,38]];

g := [[1, 23], [2, 24], [3, 26], [4, 29], [5, 33], [6, 38]]

>    plot(g,style=point,symbol=circle);

[Maple Plot]

The plot does not look linear but let's check some difference quotients.

>    (g[3,2]-g[1,2])/(g[3,1]-g[1,1]);

3/2

>    (g[3,2]-g[4,2])/(g[3,1]-g[4,1]);

3

>    (g[5,2]-g[2,2])/(g[5,1]-g[2,1]);

3

>    (g[6,2]-g[2,2])/(g[6,1]-g[2,1]);

7/2

>    (g[6,2]-g[4,2])/(g[6,1]-g[4,1]);

9/2

While two of the difference quotients are the same, they all would have to be the same in order for the function to be truly linear.  Clearly, the list g does not come from a linear function.

>    h:=[[1,10],[2,20],[3,29],[4,37],[5,44],[6,50]];

h := [[1, 10], [2, 20], [3, 29], [4, 37], [5, 44], [6, 50]]

>    plot(h,style=point,symbol=circle);

[Maple Plot]

>    (h[3,2]-h[1,2])/(h[3,1]-h[1,1]);

19/2

>    (h[3,2]-h[4,2])/(h[3,1]-h[4,1]);

8

>    (h[5,2]-h[2,2])/(h[5,1]-h[2,1]);

8

>    (h[6,2]-h[2,2])/(h[6,1]-h[2,1]);

15/2

>    (h[6,2]-h[4,2])/(h[6,1]-h[4,1]);

13/2

Certainly h does not come from a linear function either.

>    k:=[[1,2.2],[2,2.5],[3,2.8],[4,3.1],[5,3.4],[6,3.7]];

k := [[1, 2.2], [2, 2.5], [3, 2.8], [4, 3.1], [5, 3.4], [6, 3.7]]

>    plot(k,style=point,symbol=circle);

[Maple Plot]

>    (k[3,2]-k[1,2])/(k[3,1]-k[1,1]);

.3000000000

>    (k[3,2]-k[4,2])/(k[3,1]-k[4,1]);

.3

>    (k[5,2]-k[2,2])/(k[5,1]-k[2,1]);

.3000000000

>    (k[6,2]-k[2,2])/(k[6,1]-k[2,1]);

.3000000000

>    (k[6,2]-k[4,2])/(k[6,1]-k[4,1]);

.3000000000

While we have not yet tested all possible pairs, it seems that k comes from a linear function with slope 0.3.

How can we figure out its y-intercept?

We know that k(t)=m*t+b, and that m=0.3.

We also know that if t=1, then k(1)=2.2.

This gives us the equation:  2.2 = (0.3)*1 + b.

>    fsolve(2.2=(0.3)*1+b,b);

1.900000000

>    k1:=t->(0.3)*t+(1.9);

k1 := proc (t) options operator, arrow; .3*t+1.9 end proc

>    plot([k,k1(t)],t=0..7, style=[point,line],symbol=[circle,point]);

[Maple Plot]

Now let's consider exponential functions.

>    f:=x->(1.5)^x;

f := proc (x) options operator, arrow; 1.5^x end proc

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

[Maple Plot]

For any  value of x, call it x0, the ratio  of f(x0+1) and f(x0) is a fixed number.  For a linear function the difference  between f(x0+1) and f(x0) is a fixed number (the slope).

>    x0:=2.0;

x0 := 2.0

>    f(x0+1)/f(x0);

1.500000000

>    x0:=-2.0;

x0 := -2.0

>    f(x0+1)/f(x0);

1.500000000

>    x0:=3.75;

x0 := 3.75

>    f(x0+1)/f(x0);

1.500000000

If I look now at the ratio of f(x0+a) and f(x0) for some other value of a than a=1, then the number is still constant but is a different constant.  Lets take first a=1/2.

>    x0:=2.0;

x0 := 2.0

>    f(x0+1/2)/f(x0);

1.224744871

>    x0:=-2.0;

x0 := -2.0

>    f(x0+1/2)/f(x0);

1.224744871

>    x0:=3.75;

x0 := 3.75

>    f(x0+1/2)/f(x0);

1.224744871

>    x0:=2.0;

x0 := 2.0

>    f(x0+2)/f(x0);

2.250000000

>    x0:=-2.0;

x0 := -2.0

>    f(x0+2)/f(x0);

2.250000000

>    x0:=3.75;

x0 := 3.75

>    f(x0+2)/f(x0);

2.250000000

Evidently there is some number T with 1<T<2 such that the growth factor between f(x0+T) and f(x0) is exactly 2, no matter what x0 we pick.  This is called the doubling time  of the function f(x).  Only exponential functions have constant doubling times.

Let's find T for our example.  It is easy to take x0=0.  Then f(x0)=f(0)=1, and f(x0+T)=f(T)=(1.5)^T.  So we need to solve (1.5)^T=2 for T.

>    fsolve((1.5)^T=2,T);

1.709511291

>    x0:=2.0;

x0 := 2.0

>    f(x0+1.709511291)/f(x0);

2.000000000

>    x0:=-2.0;

x0 := -2.0

>    f(x0+1.709511291)/f(x0);

2.000000000

>    x0:=3.75;

x0 := 3.75

>    f(x0+1.709511291)/f(x0);

2.000000000

>