Chap 23 Exercises

WebR Status

🟡 Loading...

Loading webR...

Exercise 1 For each of the following, say whether the function is a composition f(g(x)) or a product f(x)g(x), or neither.

  1. What sort of combination is h1(x)ln(x)ex?
product       composition       neither      

question id: lamb-rise-sofa-1

  1. What sort of combination is h2(x)sin(x)cos(x)?
product       composition       neither      

question id: lamb-rise-sofa-2

  1. What sort of combination is h3(x)sin(ln(x))?
product       composition       neither      

question id: lamb-rise-sofa-3

  1. What sort of combination is h4(x)eln(x)?
product       composition       neither      

question id: lamb-rise-sofa-4

  1. What sort of combination is h5(x)sin(x)dnorm(x)?
product       composition       neither      

question id: lamb-rise-sofa-5

  1. What sort of combination is h6(x)ex2?
product       composition       neither      

question id: lamb-rise-sofa-6

  1. What sort of combination is h7(x)pnorm(x2)?
product       composition       neither      

question id: lamb-rise-sofa-7

  1. What sort of combination is h8(x)pnorm(x)dnorm(x)?
product       composition       neither      

question id: lamb-rise-sofa-8

  1. What sort of combination is h9(x)1/sin(x)?
product       composition       neither      

question id: lamb-rise-sofa-9

Exercise 2 In function compositions of the form f(g(x)), the function f() is called the exterior function and g() is called the interior function.

  1. In cos(ln(x)) which is the interior function?
ln()       cos()       sin()       None of the above       It is not a function composition      

question id: bdb932-1

  1. In 1/sin(x) which is the exterior function?
recip()       cos()       sin()       None of the above       It is not a function composition      

question id: bdb932-2

  1. In sin(2πP(tt0)) which is the exterior function?
tt0       2πP       2πPt       2πP(tt0)       sin()       None of the above       It is not a function composition      

question id: bdb932-3

  1. In sin(2π(tt0)/P) which is the interior function?
tt0       2π/P       2πt/Pt       2π(tt0)/P       sin()       None of the above       It is not a function composition.      

question id: bdb932-4

Exercise 3 Recall the differentiation rules for three of the pattern-book functions as presented in [Faulty cross reference: sec-symbolic-differentiation]:

Function name Formula Formula for derivative power-law exponent p
Identity x 1 1
Square x2 2x 2
Reciprocal 1/x 1/x2 -1

All three of these pattern-book functions are members of the power-law family: xp. They differ only in the value of p.

There is a differentiation rule for the power-law family generally. The next question offers several formulas for this rule, only one of which is correct. You can figure out which one by trying the pattern-book functions in the table above and seeing which formula gives the correct answer for the derivative.

Which of these formulas gives the correct differentiation rule for the power-law family xp?

pxp1

(p1)xp+1

xp1

(p1)xp1

question id: doe-pay-kitchen

Exercise 4 Although we created an R function named slopeFun() for the purposes of demonstration, it is better to use the R/mosaic operator D() which calculates the derivative, sometimes using symbolic methods and sometimes using a finite-difference method.

As an example of the use of D(), here is some more R code that defines a function f() and finds xf(), calling it d_f(). Then each function is plotted on the same domain.

Active R chunk 1

For each of the following functions, write a brief comparison of the function to it is differenced version. You can combine phrases such as “same shape”, “different shape. larger in amplitude”, “smaller in amplitude”, “same period”, “shorter period”, “longer period”, or whatever seems appropriate. For instance, for the original example in the sandbox, a reasonable comparison might be, “f() is concave down but Diff(f) is concave up.”

A. For the function f(x)3x, compare f() to xf.

B. For the function f(x)x2, compare f() to xf.

C. For the function f(x)ex, compare f() to xf.

D. For the function f(x)e0.3x, compare f() to xf.

E. For the function f(x)sin(x), compare f() to xf.

F. For the function f(x)sin(2πx), compare f() to xf).

G. For the function f(x)sin(2π20x), compare f() to xf).

H. The graphic produced by uses two separate frames, one for f(x) and the other for xf(x). Explain why in general it’s necessary to plot f(x) and xf(x) with different vertical axes. (Hint: Suppose x is denominated in meters or any other dimensionful quantity.)

Exercise 5 MOSAIC Calculus Sec 23.1 explains that in differentiating a linear combination of two functions, or a product of two functions, or one function composed with another, your first task is to identify the two functions f() and g() involved. Second, compute the derivative of each of those functions on its own: xf(x) and xg(x).

Carry out these two tasks for each of the combined functions shown in the table. (The first row has been done for you as an example.)

Combination f() g() xf() xg()
exln(x) ln(x) ex recip (that is 1/x) ex
sin(ex)
x+x2
1/sin(x)
pnorm(x)2
pnorm(x)
pnorm(x2)
pnorm(sin(x))

Exercise 6 Confirm using algebraic manipulation the differentiation rule for a product of three functions:

[uvw]=uvw + uvw + uvw Here, u is shorthand for u(x), and u is shorthand for xu(x), and similarly for v and w.

Hint: [uvw]=u[vw]. So a product of three functions can be seen as a product uh where hvw.

Exercise 7 In you constructed models D(t) of the availability of a drug in the bloodstream for three different pill-taking regimens: every six hours, every eight hours, and a double dose to start followed by a single dose every eight hours. The model for from a single, isolated pill is a zero before the pill is taken, then exponential decay from the level of the pill dose after the pill is taken. Like this:

The parameter k has been set to represent a drug with a half-life of three hours.

The model for the entire regiment is a linear combination of time-shifted single pills, e.g.

From graphs of the functions themselves it is easy to check whether the availability ever falls below the therapeutic threshold (which we stipulated is 0.25). For instance, the eight-hour regiment with a dose of A=1 does fall below the threshold during the first day. So a larger dose is needed than A=1.

A primary objective in choosing a drug regime is to ensure that the availability stays above the therapeutic level. A secondary objective is to keep the elimination rate small so that the drug can be handled by patients with poorly functioning livers.

The derivative tregimen8(t) tells the instantaneous rate at which the drug is being administered to and eliminated from the patient’s body. This is the reason for using the name elimination() for the function created in .

Active R chunk 2

For each of the three regimens—6-hour, 8-hour, 8-hour-double-first-dose—construct tregimen(t). Ignoring the glitches due to discontinuity at the times the pills are consumed, which of the three regimens has the lowest average rate of drug elimination?

Exercise 8 The function F(t) shown in is a linear combination of three time-shifted sigmoids.

Figure 1

As you know, the derivative of a sigmoid pnorm(t) is a gaussian with the same center and standard deviation.

  1. How many gaussians will be in tF(t).
2       3       6       none      

question id: psp4-1

shows several functions. One of them is tF(t).

Figure 2
  1. Which function is the actual derivative of F(t)? (Hint: The vertical axis is important as is the value of dnorm(0).)
A       B       C       D      

question id: psp4-2

  1. Of the functions (1), (2), (3), and (4) below, which function is the second derivative of F(t)? (Hints: The vertical axis is important as is the value of dnorm(0).)
(1)       (2)       (3)       (4)      

question id: pig-see-pantry-3

Figure 3

Exercise 9 Recall from MOSAIC Calculus Sec 6.4 that a function is monotonically increasing on a given domain when the function’s slope is positive everywhere in that domain. A monotonically decreasing function, similarly, has a negative slope everywhere in the domain. When the slope is zero, or positive in some places and negative in others, the function is neither monotonically increasing or decreasing.

Each of the following graphs shows the derivative of some function f(x). (Note: the graph does not show f(x) but rather the function xf(x)) For each graph, say whether the function f() is monotonically increasing, monotonically decreasing, or neither. (Note that the horizontal scale is the same in every graph, but the vertical scale can be different from one scale to another.)

  1. Function A is …

monotonically increasing

monotonically decreasing

constant

non-monotonic

Can’t tell from the info provided

question id: pine-lead-car-1

  1. Function B is …

monotonically increasing

monotonically decreasing

constant

non-monotonic

Can’t tell from the info provided

question id: pine-lead-car-2

  1. Function C is …

monotonically increasing

monotonically decreasing

constant

non-monotonic

Can’t tell from the info provided

question id: pine-lead-car-3

  1. Function D is …

monotonically increasing

monotonically decreasing

constant

non-monotonic

Can’t tell from the info provided

question id: pine-lead-car-4

Function E is …

monotonically increasing

monotonically decreasing

constant

non-monotonic

Can’t tell from the info provided

question id: pine-lead-car-5

  1. Function F is …

monotonically increasing

monotonically decreasing

constant

non-monotonic

Can’t tell from the info provided

question id: pine-lead-car-6

Activities

Exercise 10  

The chapter gives the simple rule, xln(x)=1/x. Let’s derive it.

Recall that ln(x) is defined as the inverse function to ex. That is,

ln(e(x))=x and eln(x)=x (for x>0).

Let’s use the first form and differentiate with respect to x. We’ll call yln(y) by the name dln(y) and use the chain rule:

x(ln(ex))=dln(ex) ex

But remember that ln(ex)=x, so x(ln(ex))=xx=1

In other words dln(ex) ex=1, or, equivalently, dln(ex)=1/ex.

This says that the derivative function dln() is such that whatever the input, the output is the reciprocal of the input. We have written the input ex here, but we might as well have written it y. That is

dln(y)=yln(y)=1/y

The name of the input argument is arbitrary, so you might prefer to see the above written as xln(x)=1/x.

Exercise 11  

Knowing that xln(x)=1/x and the chain rule, we are in a position to demonstrate the power-law rule xxp=pxp1. The key is to use the identity eln(x)=x.

xxp=x(eln(x))p The rules of exponents allow us to recognize (eln(x))p=epln(x) Thus, xp can be seen as a composition of the exponential function onto the logarithm function.

Applying the chain rule to this composition gives xepln(x)=epln(x)x[pln(x)]=epln(x)px . Of course, we already know that epln(x)=xp, so we have xxp=xppx=pxp1 .

Exercise 12 Consider this function, defined piecewise:

h(x){0for x<0x2otherwise .

  1. Write the R command to create this function. (Hint: Remember ifelse from [Faulty cross reference: sec-piecewise-intro].)

  2. Using , plot h(x) over the domain 1x1, then sketch a copy of the graph on your paper.

Active R chunk 3
  1. Create the function xh(x) by differentiating separately each piece of the piecewise function h(). Write down xh(x) using mathematical notation similar to the definition of h(x) given above.

  2. Sketch a graph of xh(x) over the domain 1x1. You’re welcome to use a , but you may be able to figure out the shape of the graph yourself.

  3. The shape of the function you sketched in (4) has a name, given in the text in Section @ref(continuity). What is that name?

Now you will do much the same as in items (3), (4), and (5), but instead of the first derivative xh(x), create, sketch, and name the second derivative xxh(x).

  1. Create and write down xxh(x) in mathematical notation.

  2. Sketch xxh(x)

  3. Classify the smoothness of h(x) using the following table:

Smoothness Criterion
C0 xh(x) is discontinuous
C1 xh(x) is continuous
C2 xxh(x) is continuous
C3 xxxh(x) is continuous
and so on.
C All orders of derivative of h(x) are continous.

Exercise 13 Recall from the Lorenz curve used to describe income inequality. The Lorenz curve shows the fraction of total income versus population fraction.

Figure 4: A Lorenz curve (blue) fitted to income data from the US in 2009. (See .)

Since the population is arranged from poorest to richest along the horizontal axis, Lorenz curves must be both monotonically increasing and concave up. That is, any Lorenz function L(P), where P is the population fraction, must satisfy these criteria:

  1. L(0)=0
  2. L(1)=1 that is, the aggregate fraction of income earned by the entire population is 100%.
  3. PL(P) > 0 that is, monotonically increasing
  4. PPL(P) > 0 that is, concave up.

Consider a function H(P)L1(L2(P)) which is the composition of two Lorenz curves.

  • A. Use the composition rule to show that H(P) is monotonically increasing. (Hint, calculate PH(P) and show that it must be positive.)
  • B. Using both the composition and product rules, calculate PPH(P) and show that H(P) must be concave up.

Exercise 14 The formula for the function dnorm(x) is dnorm(x)12πexp(x22) .

A. Use the chain rule to find xdnorm(x).

B. Confirm from your answer to (1) that there is another formula for xdnorm(x), namely xdnorm(x)=xdnorm(x) .

C. Use the product rule to find xxdnorm(x).

D. From your answer to (3), compute the 3rd derivative xxxdnorm(x):

E. Let’s generalize the pattern. Each of the previous derivatives has been a polynomial—let’s call it pn(x) for the nth derivative—times dnorm(x). Knowing pn(x), we can easily find pn+1(x): pn+1(x)=xpn(x)+xpn(x) We know p1(x)=x so p2(x)=x21. In turn, this tells us p3(x)=3xx3. Find:

  1. p4(x)
  2. p5(x)
  3. p6(x)

Exercise 15 The natural logarithm function, ln(x), is one of our basic modeling functions. As you know, there are other logarithmic functions. The one most often used is the logarithm-base-10, written log10(x) or log10(x). Ten is an integer, and a nice number to use in arithmetic. So in practice, it is sensible to use log10(). (Indeed, log10() is the digit() function, introduced in MOSAIC Calculus Chap 14.

The “natural” in the “natural logarithm” means something different.

The base of the natural logarithm is the number called Euler’s constant and written e. As a celebrity number, e is right up there with π and i. Just as π has a decimal expansion that is infinitely long (the familiar π=3.14159265358979...), Euler’s constant has an infinitely long decimal representation: e=2.71828182845905...

It is not obvious why e=2.71828182845905... should be called “natural” by mathematicians. The reasons are:

  1. ln(x) is the inverse of ex, which is special for being invariant under differentiation: xex=ex.
  2. The derivative xln(x) which has a particularly simple form, namely, 1/x.

Let’s look at the log-base-10 and its computer-savvy cousin log-base-2. The very definition of logarithms means that both 10 and 2 can be written 10=eln(10)   and   2=eln(2) This implies that the base-10 and base-2 exponential functions can be written in terms of Euler’s constant e:

10x=[eln(10)]x=eln(10)x   and   2x=[eln(2)]x=eln(2)x Calculating x10x or x2x is a matter of applying the chain rule. Use the chain rule to calculate

  1. x10x
  2. x2x

x[10x]=x[eln(10)x]=eln(10)x×ln(10) = 10x×2.3026 and x[2x]=x[eln(2)x]=eln(2)x×ln(2) = 2x×0.6931

Like ex, the derivatives of 10x and 2x are proportional to themselves. For ex the constant of proportionality is 1, a very natural number indeed.

No answers yet collected
×

R History Command Contents

Download R History File