Lab 6 Derivatives and Mutant Bacteria

Similar documents
Continuity and Differentiability Worksheet

REVIEW LAB ANSWER KEY

1 Limits and Continuity

Preface. Here are a couple of warnings to my students who may be here to get a copy of what happened on a day that you missed.

. Compute the following limits.

SECTION 1.10: DIFFERENCE QUOTIENTS LEARNING OBJECTIVES

Exam 1 Review Solutions

Time (hours) Morphine sulfate (mg)

Section 2: The Derivative Definition of the Derivative

1. State whether the function is an exponential growth or exponential decay, and describe its end behaviour using limits.

Differential Calculus (The basics) Prepared by Mr. C. Hull

Main Points: 1. Limit of Difference Quotients. Prep 2.7: Derivatives and Rates of Change. Names of collaborators:

1 The concept of limits (p.217 p.229, p.242 p.249, p.255 p.256) 1.1 Limits Consider the function determined by the formula 3. x since at this point

Section 3: The Derivative Definition of the Derivative

Average Rate of Change

Material for Difference Quotient

Key Concepts. Important Techniques. 1. Average rate of change slope of a secant line. You will need two points ( a, the formula: to find value

f a h f a h h lim lim

How to Find the Derivative of a Function: Calculus 1

2.8 The Derivative as a Function

2.11 That s So Derivative

Math 102 TEST CHAPTERS 3 & 4 Solutions & Comments Fall 2006

Section 3.1: Derivatives of Polynomials and Exponential Functions

Section 2.1 The Definition of the Derivative. We are interested in finding the slope of the tangent line at a specific point.

Pre-Calculus Review Preemptive Strike

Chapter 1 Functions and Graphs. Section 1.5 = = = 4. Check Point Exercises The slope of the line y = 3x+ 1 is 3.

2.3 Product and Quotient Rules

1 1. Rationalize the denominator and fully simplify the radical expression 3 3. Solution: = 1 = 3 3 = 2

Calculus I Homework: The Derivative as a Function Page 1

Mathematics 5 Worksheet 11 Geometry, Tangency, and the Derivative

Section 15.6 Directional Derivatives and the Gradient Vector

MVT and Rolle s Theorem

The derivative function

5. (a) Find the slope of the tangent line to the parabola y = x + 2x

Practice Problem Solutions: Exam 1

Excursions in Computing Science: Week v Milli-micro-nano-..math Part II

5.1 We will begin this section with the definition of a rational expression. We

Numerical Differentiation

Introduction to Derivatives

Lesson 6: The Derivative

Precalculus Test 2 Practice Questions Page 1. Note: You can expect other types of questions on the test than the ones presented here!

MAT 145. Type of Calculator Used TI-89 Titanium 100 points Score 100 possible points

1. Which one of the following expressions is not equal to all the others? 1 C. 1 D. 25x. 2. Simplify this expression as much as possible.

Function Composition and Chain Rules

NUMERICAL DIFFERENTIATION. James T. Smith San Francisco State University. In calculus classes, you compute derivatives algebraically: for example,

2.3 Algebraic approach to limits

Name: Sept 21, 2017 Page 1 of 1

3.1 Extreme Values of a Function

Chapter 2 Limits and Continuity

Exponentials and Logarithms Review Part 2: Exponentials

Exponential and logarithmic functions (pp ) () Supplement October 14, / 1. a and b positive real numbers and x and y real numbers.

Math 1241 Calculus Test 1

Polynomial Functions. Linear Functions. Precalculus: Linear and Quadratic Functions

Exercises for numerical differentiation. Øyvind Ryan

2.1 THE DEFINITION OF DERIVATIVE

Cubic Functions: Local Analysis

THE IDEA OF DIFFERENTIABILITY FOR FUNCTIONS OF SEVERAL VARIABLES Math 225

Name: Answer Key No calculators. Show your work! 1. (21 points) All answers should either be,, a (finite) real number, or DNE ( does not exist ).

Derivatives of Exponentials

MAT 1339-S14 Class 2

Recall from our discussion of continuity in lecture a function is continuous at a point x = a if and only if

Continuity. Example 1

ACCESS TO SCIENCE, ENGINEERING AND AGRICULTURE: MATHEMATICS 1 MATH00030 SEMESTER /2019

1. Questions (a) through (e) refer to the graph of the function f given below. (A) 0 (B) 1 (C) 2 (D) 4 (E) does not exist

MTH-112 Quiz 1 Name: # :

Lecture XVII. Abstract We introduce the concept of directional derivative of a scalar function and discuss its relation with the gradient operator.

LIMITS AND DERIVATIVES CONDITIONS FOR THE EXISTENCE OF A LIMIT

Bob Brown Math 251 Calculus 1 Chapter 3, Section 1 Completed 1 CCBC Dundalk

MTH 119 Pre Calculus I Essex County College Division of Mathematics Sample Review Questions 1 Created April 17, 2007

3.4 Algebraic Limits. Ex 1) lim. Ex 2)

3.4 Worksheet: Proof of the Chain Rule NAME

Finding and Using Derivative The shortcuts

1 Solutions to the in class part

Math 124. Section 2.6: Limits at infinity & Horizontal Asymptotes. 1 x. lim

Higher Derivatives. Differentiable Functions

(a) At what number x = a does f have a removable discontinuity? What value f(a) should be assigned to f at x = a in order to make f continuous at a?

LIMITATIONS OF EULER S METHOD FOR NUMERICAL INTEGRATION

7.1 Using Antiderivatives to find Area

The Derivative The rate of change

Teaching Differentiation: A Rare Case for the Problem of the Slope of the Tangent Line

ALGEBRA AND TRIGONOMETRY REVIEW by Dr TEBOU, FIU. A. Fundamental identities Throughout this section, a and b denotes arbitrary real numbers.

Section 2.7 Derivatives and Rates of Change Part II Section 2.8 The Derivative as a Function. at the point a, to be. = at time t = a is

MATH CALCULUS I 2.1: Derivatives and Rates of Change

1watt=1W=1kg m 2 /s 3

158 Calculus and Structures

1. Consider the trigonometric function f(t) whose graph is shown below. Write down a possible formula for f(t).

Derivatives. By: OpenStaxCollege

Chapter 2. Limits and Continuity 16( ) 16( 9) = = 001. Section 2.1 Rates of Change and Limits (pp ) Quick Review 2.1

Differential Calculus: Differentiation (First Principles, Rules) and Sketching Graphs (Grade 12) *

Combining functions: algebraic methods

Click here to see an animation of the derivative

Mathematics 123.3: Solutions to Lab Assignment #5

A = h w (1) Error Analysis Physics 141

Chapter 1D - Rational Expressions

Solutions Manual for Precalculus An Investigation of Functions

Exam 1 Solutions. x(x 2) (x + 1)(x 2) = x

1 2 x Solution. The function f x is only defined when x 0, so we will assume that x 0 for the remainder of the solution. f x. f x h f x.

Printed Name: Section #: Instructor:

JANE PROFESSOR WW Prob Lib1 Summer 2000

Math 312 Lecture Notes Modeling

Transcription:

Lab 6 Derivatives and Mutant Bacteria Date: September 27, 20 Assignment Due Date: October 4, 20 Goal: In tis lab you will furter explore te concept of a derivative using R. You will use your knowledge of ow to define and plot functions in R. You will consider slopes between two points on different curves and see ow tey relate to derivatives. You will learn ow to create two plots in te same figure and ten plot functions along wit teir derivatives. Finally, you will relate tis back to biology by looking at a model of mutant bacteria growt and its derivative. Plotting Functions and Average Slopes We begin tis lab by plotting a simple linear function. Open a new script and type te necessary code to plot tis function from x = -5 to 5 wit x incremented in steps of.0. Use type = l to plot tis as a line. Be sure to use a function definition wen plotting. Ceck wit someone around you to make sure you ave done tis correctly. You may refer to previous labs if you need elp wit commands. Hopefully at tis point, owever, you are becoming very familiar wit tese basic commands. Wat is te slope of tis line? Pretend you do not know about slope-intercept form and you want to use R to calculate te slope of tis line. We know ow to calculate te slope between any two points. Recall te formula for te slope of a line. Te slope formula as been written in two forms above wic are equivalent. In te first case we are finding te slope between two points, a and b. In te second case we are also finding te slope between two points, t+ and t. Terefore, in te second case te difference between te input values of te two points is simply. We will use te second form to calculate our slope. In your code you must define t and. Talk wit tose around you about wat t,, and t+ represent. Let s first define tese parameters as follows. t = = 2 In order to elp you understand wic points we are looking at we will use R to plot tem on te grap you ave already plotted wit te following code. points(c(t,t+),c(f(t),f(t+)),type= o,col= red ) Next add code to your script to define slope and print it to te screen. Work wit tose around you to make sure you ave tis correct.

Rerun your code for tree different values of. Wat do you notice about te red line on your plot and about te slope as you cange? Does te slope cange? Wy or wy not? Now cange te function to. (Just comment out te linear function above so you can use it again in te next section.) You can use te same code you just wrote to now compute slopes between points on tis parabola. Again see wat appens for different values of t and. Instantaneous Slope vs. Average Slope Wen we talk about derivatives we want to calculate te slope at a point. However, we only know ow to calculate te slope at two points. Let s see wat appens as we move tese points closer and closer togeter by canging te value of. In simple terms, tis is wat is meant by taking a limit as. We are letting te two points get closer and closer until our two points essentially become te same point and we can calculate te derivative at tat point. Cange your function back to to begin wit and ten you will again use te quadratic function. Let s write a code tat calculates te slope between two points for different values of. One way to do tis is by calculating te slope inside a loop as follows. for (i in 0:0){ = /(0^i); print() #put your code to calculate te slope ere. You can still define t outside te loop. print(slope) } Fill out te tables below for eac function., t = 2 Wat do you tink te instantaneous slope is for tis function at t=2?

, t = 0 Wat do you tink te instantaneous slope is for tis function at t=0?, t = 2 Wat do you tink te instantaneous slope is for tis function at t=2?, t = 0 Wat do you tink te instantaneous slope is for tis function at t=0?

As we ave discussed in te past, R is not a symbolic algebra program. We ave to give it a value for and we cannot let = 0 since tat would give us division by zero. Terefore, wen we are calculating instantaneous slopes tey will always be approximate. We cannot actually take a limit in R but we can let be very, very tiny so we get an answer tat is very close to te instantaneous slope of te function at te specified value of t. Plotting Derivatives We ave now looked at instantaneous slopes of specific points but wat if we want to know te instantaneous slopes at all te points along a curve. We will now write code to plot tem side by side. As we ave talked about, if you use plot() more tan once in your code it will erase te first plot and put te second in its place. Tere is a way to avoid tis by putting multiple plots in te same figure. Add tis line of code to te top of your script. par(mfrow=c(,2)) Tis allows you to ave two plots side by side in te figure. Ok we will now plot te function along wit its derivative. You ave already written code to plot te function. Add main= f(x) into your plot command to give it a title. We no longer need te line we wrote to put a red line on top of te two points we were plotting. Comment it out. Now we will plot te derivative. In order to do tis we need to calculate te instantaneous slope for many points on te curve. Let s define t as te same input vector we used to plot our function. t = x We now need to pick an. We will pick one tat is very small so it approximates our instantaneous slope well. = /(0^0) Now use te code you ave already used to define te slope earlier in te lab. Since t is now a vector, your output will be a vector too. Tis output vector defines te derivative function as it tells us te instantaneous rate of cange for eac point in te vector t(or x since tey are te same). As we ave discussed, tese values are only approximate since we can t take limits in R. Terefore, we must round our answer for tese slopes to get a nice curve. We do tis by using round() as follows. I ave called my slope vector m below. If you ave called it someting else tan put tat variable name in te place of m. m = round(m,digits=5) Tis rounds te slope vector m to 5 digits. Now let s plot it. plot(x,m,type= l,main= Derivative of f(x) )

Te derivative of te function sould be a orizontal line at -3. Wy? Te derivative of te function sould be a linear function tat crosses te x axis. Wat does it mean wen te value of te derivative is negative? Wat does it mean wen te derivative is positive? Mutant Bacteria and Derivatives In section 0 you saw an example of a discrete time dynamical system in wic tere were two types of bacteria: wild type and mutant. Tis section goes troug a derivation of a discrete time system for p, te fraction of mutants in te total population. One solution for tis system is given as follows, were. Recall tat s is te reproduction rate of mutants, r is te reproduction rate of te normal bacteria, and p0 is te initial fraction of mutants in te total population. Plot te function P(t) along wit its derivative as we did before for simple linear and quadratic functions. Don t forget to round your vector tat describes te derivative. Set p0 =, s = 2, and r =.5. Don t forget to label your graps as we did before. Tink about wy te derivative looks te way it does for te given function. You will be using tis script to plot P(t) and its derivative in your assignment so save it!