Class 16

Between Class Sessions - Prep for Day 16

Please spend around 2 hours working between class sessions, focusing on the tasks below. Use any extra time to complete KnewtonAlta assignments and/or work on Project tasks.

Pick something from your prep today that you can share with your group in class. It might be something new that you learned. It might be questions you have that are still unanswered, or a question along with what helped you eventually answer it. It might be something tricky that you solved. It might be a review topic that helped you remember something. It might be a conversation you had with AI that was helpful. You will have a chance to share this with your peers during class. Come ready to articulate your thinking and questions.

Preparation

(1) Local Slope

Complete the four exercises below, and come ready to share with (or teach) your group what you did.

  • Exercise 1: Given \(f_1(x) = x^4 - 10x^2 + 3x\), we see \(f_1(3) = 0\). For each \(x\), find the corresponding \(y\) value and the slope of the line through \((3,0)\) and \((x,y)\). Record your work in the a table similar to the one below. While we cannot calculate the slope of \(f_1\) at \(x=3\), since we only have one point \((3,0)\), we can use the information in the table we have constructed to approximate the slope of \(f_1\) at \(x=3\). What value would you use as an approximation to the slope of \(f_1\) at \(x=3\)?
\(x\) \(y = f(x)\) slope of line through \((3,0)\) and \((x,y)\)
2 -18 slope of line through \((3,0)\) and \((2,-18)\) is \(\frac{-18-0}{2-3} = 18\)
2.5 -15.9375 slope of line through \((3,0)\) and \((2.5,-15.9375)\) is \(\frac{-15.9375-0}{2.5-3} = 31.875\)
2.9 -4.6719 46.719
2.99 -0.50561199 50.561199
2.999
3 0 undefined
3.001
3.01
3.1
3.5
4.
  • Exercise 2: Given \(f_2(x) = e^{2x} - 1\), we see \(f_2(0) = 0\). Complete the table below to approximate the slope of \(f_2\) at \(x=0\).
\(x\) \(y = f(x)\) slope of line through \((0,0)\) and \((x,y)\)
1.
0.5
0.01
0.001
0 0 undefined
-0.001
-0.01
-0.5
-1.

Given the information you have gathered, what value would you use as an approximation to the slope of \(f_2\) at \(x=0\)?

  • Exercise 3: Given \(f_3(x) = \sqrt[3]{x-1}\), we see \(f_3(2) = 1\). Complete the table below to approximate the slope of \(f_3\) at \(x=2\).
\(x\) \(y = f(x)\) slope of line through \((2,1)\) and \((x,y)\)
1.
1.5
1.99
1.999
2 1 undefined
2.001
2.01
2.5
3

Given the information you have gathered, what value would you use as an approximation to the slope of \(f_3\) at \(x=2\)?

  • Exercise 4: Given \(f_4(x) = 3\ln(x-2)\), we see \(f_4(2.75) = 3\ln(0.75)\). Complete the table below to approximate the slope of \(f_4\) at \(x=2.75\).
\(x\) \(y = f(x)\) slope of line through \((2.75,3\ln(0.75))\) and \((x,y)\)
2.5
2.7
2.74
2.749
2.75 \(3\ln(0.75)\) undefined
2.751
2.76
2.8
3

Given the information you have gathered, what value would you use as an approximation to the slope of \(f_4\) at \(x=2.75\)?

Organize your work in a way that you can quickly share your thinking with your group in class.

Regular Reminders

Skill Practice (KA Homework)

  • If you have not already done so, complete 3 – Probability Basics assignment in Knewton Alta and the Function Unit assignments.

Applied Practice (Project Work)

  • Work on Project 1

During Class

Brain Gains

  1. A line has the equation \(y-2 = 8(x+3)\). Give the slope of the line and a point on the line.
Solution

The line is currently in point-slope form \(y-y_1 = m(x-x_1)\). The slope is 8. A point on the line is \((-3,2)\).

  1. Give an equation of a line with slope 4 that passes through the point (2,5).
Solution

We use point slope form to obtain \(y-5=4(x-2)\).

  1. For the function \(f(x) = x^2\), what is the slope of the line that passes through the function at \(x=3\) and \(x=4\).
Solution

The slope is \(m = \frac{f(4)-f(3) }{4-3} = \frac{16-9}{1} = 7\). We can use R to compute this as follows.

f <- function(x){x^2}
x1 <- 3
x2 <- 4
slope <- (f(x2)-f(x1))/(x2-x1)
slope
  1. For the function \(f(x) = x^2\), what is the slope of the line that passes through the function at \(x=3\) and \(x=3.1\).
Solution

The slope is \(m = \frac{f(3.1)-f(3) }{3.1-3} = 6.1\). We can use R to compute this as follows.

f <- function(x){x^2}
x1 <- 3
x2 <- 3.1
slope <- (f(x2)-f(x1))/(x2-x1)
slope
  1. For the function \(f(x) = x^2\), what is the slope of the line that passes through the function at \(x=3\) and \(x=3.01\).
Solution

The slope is \(m = \frac{f(3.01)-f(3) }{3.01-3} = 6.01\). We can use R to compute this as follows.

f <- function(x){x^2}
x1 <- 3
x2 <- 3.01
slope <- (f(x2)-f(x1))/(x2-x1)
slope

We can compute all 3 of the above with a slight change to the code, and then display the results in a nice table. While we’re at it, let’s add a few more points closer to 3 to our table.

f <- function(x){x^2}
x1 <- 3
x2 <- c(4,3.1,3.01,3.001, 3.0001, 3.00001,3)
slope <- (f(x2)-f(x1))/(x2-x1)
data.frame(x1 = x1, x2 = x2, slope = slope)

Why do we get NaN at \(x=3\)?

  1. For the function \(f(x) = x^2\), guess a value for the slope of the line that is tangent to the function at \(x=3\) (we don’t have two points anymore).

Introduction to Linearization

We will plot each of the following functions and then zoom in at the specified location (or point).

  • \(f_1(x) = x^4 - 10x^2 + 3x\) at \(x=3\)
  • \(f_2(x) = e^{2x} - 1\) at \(x=0\)
  • \(f_3(x) = \sqrt[3]{x-1}\) at \(x=2\)
  • \(f_4(x) = 3\ln(x-2)\) at \(x=2.75\)
#Define the functions.
f1 <- function(x){x^4 -10*x^2 +3*x}
f2 <- function(x){exp(2*x)-1}
f3 <- function(x){sign(x-1)*(abs(x-1))^(1/3)}
f4 <- function(x){3*log(x-2)}

#Graph the functions.
x <- seq(-5,5,1e-3)

###figure 1###
y1 <- f1(x)
par(mfrow=c(2,2),mar=c(2,2,0.25,0.25))
plot(x,y1,type='l',xlim=c(-4,4))
points(3,f1(3),pch=16,col=2)
plot(x,y1,type='l',xlim=c(3-1,3+1),ylim=c(-50,50))
points(3,f1(3),pch=16,col=2)
plot(x,y1,type='l',xlim=c(2.75,3.25),ylim=c(-12.5,12.5))
points(3,f1(3),pch=16,col=2)
plot(x,y1,type='l',xlim=c(2.9,3.1),ylim=c(-5,5))
points(3,f1(3),pch=16,col=2)

###figure 2###
y2 <- f2(x)
par(mfrow=c(2,2),mar=c(2,2,0.25,0.25))
plot(x,y2,type='l',xlim=c(-5,5))
points(0,f2(0),pch=16,col=2)
plot(x,y2,type='l',xlim=c(-1,1),ylim=c(-5,5))
points(0,f2(0),pch=16,col=2)
plot(x,y2,type='l',xlim=c(-0.5,0.5),ylim=c(-2.5,2.5))
points(0,f2(0),pch=16,col=2)
plot(x,y2,type='l',xlim=c(-0.01,0.01),ylim=c(-.05,.05))
points(0,f2(0),pch=16,col=2)

###figure 3###
x3 <- seq(0,5,1e-3)
y3 <- f3(x3)
par(mfrow=c(2,2),mar=c(2,2,0.25,0.25))
plot(x3,y3,type='l',xlim=c(0,5), ylim=c(-2.5,2.5) )
points(2,f3(2),pch=16,col=2)
plot(x3,y3,type='l',xlim=c(1,3),ylim=c(0,2))
points(2,f3(2),pch=16,col=2)
plot(x3,y3,type='l',xlim=c(1.5,2.5),ylim=c(0.5,1.5))
points(2,f3(2),pch=16,col=2)
plot(x3,y3,type='l',xlim=c(1.99,2.01),ylim=c(0.99,1.01))
points(2,f3(2),pch=16,col=2)

###figure 4###
x4 <- seq(2,10,1e-3)
y4 <- f4(x4)
par(mfrow=c(2,2),mar=c(2,2,0.25,0.25))
plot(x4,y4,type='l',xlim=c(0,10), ylim = c(-5,5))
points(2.75,f4(2.75),pch=16,col=2)
plot(x4,y4,type='l',xlim=c(1.75,3.75),ylim=c(f4(2.75)-1,f4(2.75)+1))
points(2.75,f4(2.75),pch=16,col=2)
plot(x4,y4,type='l',xlim=c(2.5,3),ylim=c(f4(2.75)-0.25,f4(2.75)+0.25))
points(2.75,f4(2.75),pch=16,col=2)
plot(x4,y4,type='l',xlim=c(2.7,2.8),ylim=c(f4(2.75)-0.05,f4(2.75)+0.05))
points(2.75,f4(2.75),pch=16,col=2)
An alternate version of code above, using a function to systematically draw the plots.
#Define the functions.
f1 <- function(x){x^4 -10*x^2 +3*x}
f2 <- function(x){exp(2*x)-1}
f3 <- function(x){sign(x-1)*(abs(x-1))^(1/3)}
f4 <- function(x){3*log(x-2)}

#Create a function called zooming_in that will generate a plot and 3 zoomed in versions.
zooming_in <- function(f, xvalue, xwidth=10, ywidth=10, zoom = c(0.1, 0.01, 0.001)){
  yvalue <- f(xvalue)
  
  #Create sequence of values for plots
  x <- seq(xvalue - xwidth/2, xvalue + xwidth/2, xwidth/100)
  y <- f(x)
  
  #Generate original plot, and then zoom in 3 times by factors given by zoom
  par(mfrow=c(2,2),mar=c(2,2,0.25,0.25))
  plot(x,y,type='l',xlim=xvalue + c(-1,1)*xwidth/2, ylim = yvalue + c(-1,1)*ywidth/2)
  points(xvalue,yvalue,pch=16,col=2)
  plot(x,y,type='l',xlim=xvalue + c(-1,1)*xwidth/2*zoom[1],ylim=yvalue + c(-1,1)*ywidth/2*zoom[1])
  points(xvalue,yvalue,pch=16,col=2)
  plot(x,y,type='l',xlim=xvalue + c(-1,1)*xwidth/2*zoom[2],ylim=yvalue + c(-1,1)*ywidth/2*zoom[2])
  points(xvalue,yvalue,pch=16,col=2)
  plot(x,y,type='l',xlim=xvalue + c(-1,1)*xwidth/2*zoom[3],ylim=yvalue + c(-1,1)*ywidth/2*zoom[3])
  points(xvalue,yvalue,pch=16,col=2)
}

#Use zooming_in() to plot each of the 4 original functions.
zooming_in(f1,3,10,400)
zooming_in(f2,0)
zooming_in(f3,2)
zooming_in(f4,2.75)

We see that these nonlinear functions look linear when we zoom in. We would like to identify the lines that approximate these functions at the specified points. We already have a point, so all we need is to to figure out the slope of the line.

We can write the equation of a line if we know a point on the line and the slope of the line.

Formulas to Remember

Slope Formula
Given two points on a line, \((x_1, y_1)\) and \((x_2,y_2)\), we can calculate the slope as follows
\(m = \frac{y_1-y_2}{x_1-x_2}\) or \(m = \frac{y_2-y_1}{x_2-x_1}\).

Point-Slope Form of a Line
Given a point on a line, \((x_1, y_1)\), and the slope of the line, \(m\), we can write the equation of the line:
\(y-y_1 = m(x-x_1)\).
Point-slope form of a line is not a unique form for the equation of the line. There are infinitely many points on a line and for each point while the equation of the line is the same it may “look” different.

Slope-Intercept Form of a Line
Given the slope of a line, \(m\), and the y-intercept of the line, \((0,b)\), we can write the equation of the line:
\(y = mx + b\).
Slope-intercept form is a unique form for the equation of the line.

Group Meeting

Start by giving each person a moment to share what they chose to prepare for class. Help each other address any questions. When each person has had a chance to share, move on the other activities.

Writing the Linearization

  1. Compare your completed tables from your between class work.

Here is an example of how to use R to create the first table.

f1 <- function(x){x^4 -10*x^2 +3*x}
x_center <- 3
shifts <-c(-1, -0.5, -0.1, -0.01, -0.001, 0, 0.001, 0.01, 0.1, 0.5, 1)
x <- x_center + shifts
y <- f1(x)
slope <- (f1(x)-f1(x_center))/(x-x_center)
data.frame(x=x,y=y,slope=slope)

You will need a table such as the one above for each of the 4 functions.

  1. Use the information from your tables to answer the following questions. Write your answers on the chalk board.
  • \(f_1(x) = x^4 - 10x^2 + 3x\) at \(x=3\)
    • What is the value of \(f_1\) when \(x=3\)?
    • What is your collective guess for the slope at \(x=3\)?
      • This slope is call the local rate of change of \(f_1\) at the point \(x=3\) (or the slope of \(f_1\) at \(x=3\)).
    • Write the equation of the line with this slope through the point and slope identified above. Write your answer in the form \(y-y_1 = m(x-x_1)\).
  • \(f_2(x) = e^{2x} - 1\) at \(x=0\)
    • What is the value of \(f_2\) when \(x=0\)?
    • What is your collective guess for the slope at \(x=0\)?
      • This slope is call the local rate of change of \(f_2\) at the point \(x=0\) (or the slope of \(f_2\) at \(x=0\)).
    • Write the equation of the line with this slope through the point and slope identified above. Write your answer in the form \(y-y_1 = m(x-x_1)\).
  • \(f_3(x) = \sqrt[3]{x-1}\) at \(x=2\)
    • What is the value of \(f_3\) when \(x=2\)?
    • What is your collective guess for the slope at \(x=2\)?
      • This slope is call the local rate of change of \(f_3\) at the point \(x=2\) (or the slope of \(f_3\) at \(x=2\)).
    • Write the equation of the line with this slope through the point and slope identified above. Write your answer in the form \(y-y_1 = m(x-x_1)\).
  • \(f_4(x) = 3\ln(x-2)\) at \(x=2.75\)
    • What is the value of \(f_4\) when \(x=2.75\)?
    • What is your collective guess for the slope at \(x=2.75\)?
      • This slope is call the local rate of change of \(f_4\) at the point \(x=2.75\) (or the slope of \(f_4\) at \(x=2.75\)).
    • Write the equation of the line with this slope through the point and slope identified above. Write your answer in the form \(y-y_1 = m(x-x_1)\).

Some Vocabulary

  • The lines you wrote down are called the linearization of \(f_1\), \(f_2\), \(f_3\), and \(f_4\) at the specified point.
  • These lines are also called the local linear approximations of \(f_1\), \(f_2\), \(f_3\), \(f_4\) at the specified point.
  • These lines are also called the tangent lines of \(f_1\), \(f_2\), \(f_3\), and \(f_4\) at the specified point.
  1. Use the following code to plot the functions (in black) and linearizations (in green). You will have to enter values for m1, m2, m3, and m4 into the code below (the slopes you computed above) to get the code to work.
#Define the linearization.
t <- function(x,a,fa,df){
fa + df*(x - a)
}

#Visualize these linearizations.
x <- seq(-5,5,1e-3)

###figure 1###
m1 <- 
par(mfrow=c(1,2),mar=c(2,2,0.25,0.25))
plot(x,f1(x),type='l',xlim=c(-4,4))
points(3,f1(3),pch=16,col=2)
lines(x,t(x,3,f1(3),m1),col=3)
plot(x,f1(x),type='l',xlim=c(2.9,3.1),ylim=c(-50,50))
points(3,f1(3),pch=16,col=2)
lines(x,t(x,3,f1(3),m1),col=3)

###figure 2###
m2 <- 
par(mfrow=c(1,2),mar=c(2,2,0.25,0.25))
plot(x,f2(x),type='l',xlim=c(-5,5))
points(0,f2(0),pch=16,col=2)
lines(x,t(x,0,f2(0),m2),col=3)
plot(x,f2(x),type='l',xlim=c(-0.01,0.01),ylim=c(-0.25,0.25))
points(0,f2(0),pch=16,col=2)
lines(x,t(x,0,f2(0),m2),col=3)

###figure 3###
x3 <- seq(0,5,1e-3)
m3 <-
par(mfrow=c(1,2),mar=c(2,2,0.25,0.25))
plot(x3,f3(x3),type='l',xlim=c(-5,5))
points(2,f3(2),pch=16,col=2)
lines(x3,t(x3,2,f3(2),m3),col=3)
plot(x3,f3(x3),type='l',xlim=c(1.99,2.01),ylim=c(0.99,1.01))
points(2,f3(2),pch=16,col=2)
lines(x3,t(x3,2,f3(2),m3),col=3)

###figure 4###
x4 <- seq(2,10,1e-3)
m4 <- 
par(mfrow=c(1,2),mar=c(2,2,0.25,0.25))
plot(x4,f4(x4),type='l',xlim=c(0,10))
points(2.75,f4(2.75),pch=16,col=2)
lines(x4,t(x4,2.75,f4(2.75),m4),col=3)
plot(x4,f4(x4),type='l',xlim=c(2.7,2.8),ylim=c(-2,1))
points(2.75,f4(2.75),pch=16,col=2)
lines(x4,t(x4,2.75,f4(2.75),m4),col=3)

Special Cases

  • Plot each of the following functions and then zoom in at the specified location.
    • \(f_5(x) = |x+4|\) at \(x=-4\)
    • \(f_3(x) = \sqrt[3]{x-1}\) at \(x=1\)
###example 1###
x <- seq(-10,2,1e-3)
par(mfrow=c(2,2),mar=c(2,2,0.25,0.25))
plot(x,abs(x+4),type='l',xlim=c(-9,1),ylim=c(-3,5))
points(-4,0,pch=16,col=2)
plot(x,abs(x+4),type='l',xlim=c(-6,-2),ylim=c(-3,3))
points(-4,0,pch=16,col=2)
plot(x,abs(x+4),type='l',xlim=c(-4.5,-3.5),ylim=c(-1,1))
points(-4,0,pch=16,col=2)
plot(x,abs(x+4),type='l',xlim=c(-4.01,-3.99),ylim=c(-0.01,0.01))
points(-4,0,pch=16,col=2)

###example 2###
f3 <- function(x){sign(x-1)*(abs(x-1))^(1/3)}
x3 <- seq(-5,5,1e-4)
y3 <- f3(x3)

par(mfrow=c(2,2),mar=c(2,2,0.25,0.25))
plot(x3,y3,type='l',xlim=c(-5,5))
points(1,f3(1),pch=16,col=2)
plot(x3,y3,type='l',xlim=c(0,2),ylim=c(-1,1))
points(1,f3(1),pch=16,col=2)
plot(x3,y3,type='l',xlim=c(0.5,1.5),ylim=c(-0.75,0.75))
points(1,f3(1),pch=16,col=2)
plot(x3,y3,type='l',xlim=c(0.99,1.01),ylim=c(-0.01,0.01))
points(1,f3(1),pch=16,col=2)

What do you notice about the local linear approximation for these functions at these locations?

Discussion

What is a derivative?

  • A derivative of a function at a point \(x=a\) is the local rate of change of the function.
  • The derivative of a function at a point \(x=a\) is the slope of the local linear approximation of the function at \(x=a\) (or the slope of the tangent line of the function at \(x=a\) or the slope of the function \(f\) at \(x=a\)).
    • If we zoom in close enough at a point \(x=a\) most functions look linear, in one dimension like a line. This line is called the linear approximation of the function, \(f\), at the point \((a, f(a))\), \(y = f(a) + f'(a)(x-a)\). The slope of this linear approximation is the derivative of the \(f\) at \(x=a\).
  • If we consider all possible locations, the derivative of a function is another function.
    • Derivative Applet
    • The function \(f'\) (or \(\diff{f}{x}\)) is a general rule (a formula) for finding slope of \(f\) at each point \((x,f(x))\) where the derivative of \(f\) exists.
    • Some notation people use for the derivative function, or the derivative of \(f\), include: \(f'(x)\), \(\frac{df}{dx}\), \(D_xf\), and \(\frac{d}{dx}(f(x))\). We’ll use each of these notations throughout the semester.

An Algebra Approach

We obtained the rule above by examining a graph, making a table, and then summarizing our work. Consider \(f(x) = x^2\) and let’s explore an algebraic way to obtain the same result. We can compute the slope from \((x,f(x))\) to \((x+dx,f(x+dx))\) by computing \[\begin{align*} \frac{\text{change in y}}{\text{change in x}} &=\frac{f(x+dx)-f(x)}{(x+dx)-(x)}\\ &=\frac{f(x+dx)-f(x)}{dx}\\ &=\frac{(x+dx)^2-(x)^2}{dx}\\ &=\frac{(x^2+2xdx+dx^2)-x^2}{dx}\\ &=\frac{2xdx+dx^2}{dx}\\ &=2x+dx. \end{align*}\]

Our goal was to look locally at the function (or make the change in \(x\) really small), which means this slope, assuming \(dx\) is really small, is basically just \(2x\). This matches the derivative we obtained above through visual and graphical means.

We computed and simplified the quantity \(\frac{f(x+dx)-f(x)}{dx}\) above. This quantity is called the difference quotient of a function. By letting \(dx\) approach zero (a formal process we have not yet fully defined), we obtain the derivative of \(f\) at \(x\). It’s common to write this process using the notation \[f'(x) = \lim_{dx\to 0}\frac{f(x+dx)-f(x)}{dx}\]

In our class, we’ll learn rules to compute the derivatives exactly for power functions, exponential functions, and logarithmic functions. In addition we’ll learn how to compute derivatives of functions obtained from others through multiplication by a constant (or scalar multiplication), sums/differences, products, quotients, and function composition. The prep for tomorrow has you learn a few of these rules.

The Derivative is calculated using a Limit.

Calculus is built on the very powerful concept of a limit. Limits provide a way for us to deal with the concept of infinity, things that are very large or things that are very small in magnitude.
The tables we have constructed and used to approximate the derivative for each of our four example functions are one way to represent a limit.
We will not be computing limits algebraically in this class. We will, however, be relying on this powerful concept in all of our work with derivatives and integrals because limits are the foundation of calculus.

Definition of Derivative

Let \(f(x)\) be a function defined in an open interval containing \(a\). The derivative of the function \(f(x)\) at \(a\), denoted by \(f'(a)\), is defined by
\(f'(a) = \lim_{x \rightarrow a} \frac{f(x) - f(a)}{x-a} = \lim_{h \rightarrow 0} \frac{f(a+h) - f(a)}{h}\) provided this limit exists.

The derivative is a function.
Let \(f\) be a function. The derivative function, denoted by \(f'\), is the function whose domain consists of those values of \(x\) such that the following limit exists:
\(f'(x) = \lim_{h \rightarrow 0} \frac{f(x+h) - f(x)}{h}\).
These definitions match the definition in section 3.1 and 3.2 in the OpenStax Calculus vol. 1 text.

Note that the derivative of a function at a point does not always exist. Two of the examples we saw today have that issue. One had an abrupt change in direction, while the other had a vertical tangent line.


Source: Class.16 on byuimath.com