MA21 - Mathematica Lab 1
Relationships between functions and their first and second derivatives.

It is often very helpful to understand the relationship between a function and
its derivatives. For example, we will soon be concerned with finding minimum 
values of functions, and the easiest way (frequently) to determine such things 
involves computing derivatives and looking for their zeros. Consider the simple 
function f(x) = x^2 + 2 and its linear derivative f'(x) = fprime(x) = 2x.

f[x_]:= x^2 + 2

fprime[x_]:= 2x

Plot[{f[x],fprime[x]},{x,-3,3}]

You might notice that fprime has a zero (root) at the same x-value where the
original function f has a local minimum (absolute minimum in this case). This
relationship, (i.e. if a differentiable function f has a local min then its 
derivative has a zero at the same x-value), is true in general. It is also true
that if a differentiable function has a local max, its derivative will have a 
root at the same x-value. However, if you know that the derivative of a function
g has a zero at x=a, that does not tell you for sure whether g has a local min, 
local max, or neither, at x=a (you need another piece of information).

To see this, look at the function g(x) = x^3 + 1, its quadratic derivative 
g'(x) = gprime(x) = 3x^2, and its linear second derivative 
g''(x) = gdubprime(x) = 6x.

g[x_]:= x^3 + 1

gprime[x_]:= 3x^2

gdubprime[x_]:= 6x

Plot[{g[x],gprime[x],gdubprime[x]},{x,-2,2}]

The cubic function g (blue) plotted with its first (magenta) and second (tan) derivatives

Notice that g' has a root at x=0, but g has neither a local min nor local max.
Instead, g has a point of inflection at x=0 (a point where the function
changes curvature, in this case, from concave down to concave up). What piece
of information do you think you need (in addition to the derivative having a
root), to determine whether a function has a local min, local max, or inflection
point? HINT: think about the second derivatives of f and g above... how are they
different at x=0? You don't need to answer here, but you'll need to think about 
this kind of thing to complete the lab.

Next, here is a somewhat whackier polynomial function along with its first and
second derivatives. All of the relationships you will need to discover today 
can be observed somewhere in these first three examples (the functions f, g, 
and p, along with their derivatives).

p[x_]:= x^2*(3x^3 - 15x^2 - 20x + 120)

q[x_]:= p'[x]

Note the nifty trick Mathematica will do (compute the derivative automatically).
For this lab, you may only use this to experiment and check your work.

r[x_]:= q'[x]

FYI: r could also be defined by r[x_]:= p''[x]

Plot[{p[x],q[x],r[x]},{x,-3,5}]

The polynomial function p (blue) plotted with its first (magenta) and second (tan) derivatives

Directions:

Now, using the following word bank, you must fill in the blanks below to 
express relationships between a function and its first and second derivatives. 
For each relationship you observe, you must define a function (different from 
our examples) and its relevant derivatives, (first or second or both), that 
demonstrate the relationship. Note: you may use Mathematica's automatic 
definition of derivatives only to experiment and/or check your work; you must 
actually compute and define the derivative functions explicitly.  Plot the 
function (and relevant derivatives) and identify the point (x-value) or interval 
where the relationship is demonstrated.

Word Bank (use each word exactly once): 

root, zero, local maximum, local minimum, increasing, decreasing, 
positive, negative, point of inflection, concave up, concave down

Relationships:
Note: we assume that the functions to which we refer in the following
relationships are at least "twice differentiable", i.e., their first and
second derivatives exist as functions.

1.) Whenever a differentiable function f1 is increasing, its first 
derivative f1' is __________________.

f1[x_]:=

f1prime[x_]:=

f1dubprime[x_]:=

We observe this relationship for x = ___ (or for x in the interval _________).

2.) If a differentiable function f2 has a local max at x=a, then its first
derivative f2' has a ______________ at x=a and its second derivative f2'' 
is ________________ at x=a.

f2[x_]:=

f2prime[x_]:=

f2dubprime[x_]:=

We observe this relationship for x = ___ (or for x in the interval _________).

3.) Whenever a differentiable function f3 is __________________, its second
derivative is positive.

f3[x_]:=

f3prime[x_]:=

f3dubprime[x_]:=

We observe this relationship for x = ___ (or for x in the interval _________).

4.) If a differentiable function f4 has a _________________ at x=a, then its
second derivative must have a root at x=a.

f4[x_]:=

f4prime[x_]:=

f4dubprime[x_]:=

We observe this relationship for x = ___ (or for x in the interval _________).

5.) If a differentiable function f5 has a _________________ at x=a, then
it is _________________ on an open interval around x=a, and its first
derivative has a _________________ at x=a.

f5[x_]:=

f5prime[x_]:=

f5dubprime[x_]:=

We observe this relationship for x = ___ (or for x in the interval _________).

6.) If f6'' is ___________________ on an open interval that contains the point 
x=a, and f6''(a)=0, then the first derivative f6' has a ________________ at a.

f6[x_]:=

f6prime[x_]:=

f6dubprime[x_]:=

We observe this relationship for x = ___ (or for x in the interval _________).

7.) If the derivative of a differentiable function f7 is _________________ on 
an open interval, then its second derivative must be negative on that interval.

f7[x_]:=

f7prime[x_]:=

f7dubprime[x_]:=

We observe this relationship for x = ___ (or for x in the interval _________).