MATH 1170: Calculus for Biologists I (Fall 2010) Lab Meets: October 19, 2010 Report due date: October 26, 2010 Section 002: Tuesday 9:40-10:30am Section 003: Tuesday 10:45-11:35am Lab location - LCB 115 Lab instructor - Erica Graham, graham@math.utah.edu Lab webpage - www.math.utah.edu/~graham/Math1170.html Lab 07 General Lab Instructions In-class Exploration Review: In last week's lab, we started to explore what the graphs of functions and their derivatives indicate about each other. Background: The current lab takes this concept a little farther, using slightly more involved functions. restart; We'll start off by defining two functions, n(x) and d(x). n:=x->4*x^3-28*x^2+63*x-45; d:=x->4*x^2-24*x+36; (2.1) We can calculate the derivatives of the polynomials n(x) and d(x) by hand, and save them as their own expressions, dn/dx and dd/dx, respectively. dndx:=12*x^2-56*x+63; dddx:=8*x-24; (2.2) Now suppose, we created the rational function p(x)=n(x)/d(x) and wanted to take the derivative of it. First, we'll define p(x) as a function of x. p:=x->n(x)/d(x); We can then compute the (simplified) derivative using the quotient rule. simplify((dndx*d(x)-dddx*n(x))/(d(x)^2)); (2.3) An easier way to compute the derivative p'(x) is to use the ultra-useful diff( ) command. There are two required arguments to diff( ). The first is the function we're interested in; the second is the variable with respect to which we wish to take the derivative. So, in words, diff(h(y),y) is equivalent to take the derivative of h(y) with respect to y, which is equivalent to dh/dy and h'(y). Let's verify that this gives us the same expression we just found by making use of simplify( ). To exhibit confidence in this newly introduced method for computing derivatives, we'll save the result as the function dpdx(x) using the unapply( ) command we saw last week. dpdx:=unapply(simplify(diff(p(x),x)),x); (2.4) The natural next step for us is to determine what our critical points are. Recall that these will include all points at which the derivative is either zero or undefined. Last week, we only had a polynomial to deal with, so we didn't have to worry about an undefined derivative. This time, we have a rational function of polynomials as our derivative, so we'll need to apply an extra step to identify where such a circumstance might occur. To find the zero-derivative-causing critical points, we can use the solve command. solve(dpdx(x)=0,x); (2.5) Since we have a quotient, we need to figure out where the denominator of dpdx(x) =0 in order to find the where the derivative is undefined. To deternine this, we use the denom( ) command, which will identify the denominator of the function of interest. Let's first see what Maple gives us as the denominator of dpdx(x). denom(dpdx(x)); (2.6) Now, we'll solve for the x-values that cause this denominator to be zero using % , which accesses the immediately preceding output. We can also simultaneously solve for the roots of dpdx(x) and save everything to a single list c. c:=solve(%=0,x),solve(dpdx(x)=0,x); Note the extra 3 we have at the beginning of our list. This is from the double root in the denominator of p'(x). So, even though there are 4 points listed, we have only 3 unique critical points. (2.7) As we did last week, we can create a vertical line plot to see how the derivative identifies the increasing/decreasing behavior of p(x). We'll extend the vertical lines from -2 to 6 at each of the last 3 critical points listed above. crit_pts:=[seq([[c[i],-2],[c[i],6]],i=2..4)]; (2.8) First, we'll save a plot for both dpdx(x) and p(x), for x=0..6 and y-values -2..6. p1:=plot([p(x),dpdx(x)],x=0..6,-2..6,color=["DodgerBlue", "Black"],thickness=2,linestyle=[1,4],legend=["p(x)","p'(x)"]) ; (2.9) Now, let's save a plot command for our vertical lines. p2:=plot(crit_pts,x=0..6,color="Black",linestyle=2); (2.10) Now we'll use plots[display] to stick both of our plots on the same set of axes. plots[display]([p1,p2]); 6 5 4 3 2 1 0 1 2 p(x) 3 x 4 5 6 p'(x) Again, even with vertical asymptotes, we can see how the derivative separates the x-axis into increasing and decreasing regions of the original function. Notice that with our rational function, the sign of the derivative on either side of the asymptote doesn't change. This will not always be the case, as you'll see in the homework. Lab 07 Homework Problems Please copy this entire section into a new worksheet, and save it as something you'll remember. Your Full Name: Your (registered) Lab Section: Useful Tip #1: Don't be afraid to practice the art of troubleshooting! Does your answer make sense to you? If not, explore why. If you're still unsure, ask me. Useful Tip #2: Read through the assignment to get a clear idea of what's being asked of you. Be sure to follow the directions within each question. Useful Tip #3: Use your work from previous labs to remind yourself of commands that you may have forgotten yet need. Useful Tip #4: When in doubt, restart. (1) Define the rational function h(x) =(2*x^3-11*x^2+20*x-11)/(4*x^2-16*x+16). ## Define h(x) here. (2)(a) Plot h(x) for x values from 0 to 6 and for y-axis values between -2 and 6. ## Use this space for your plot command. (b) Given the graph you plotted above, where might the critical points of h(x) be? (Hint: There are 2 of them.) (c) What sign should the derivative have within each of the regions between the critical points? (3) The following problems will help you verify your answers to the previous ones by using Maple. (a) Use unapply( ) and diff( ) to define the function dhdx(x) as the derivative of h(x) with respect to x. ## Feel free to use this space. (b) Find the critical point at which dhdx(x)=0 using Maple. You should receive three values, only one of which is a real number. Use this in part (d), and ignore the other two. Notice how Maple uses I to denote the complex number i. ## Feel free to use this space. (c) Determine the critical point(s) at which dhdx(x) is undefined. (Think carefully about what that means.) You may get several copies of the same value here. Only use one of these in the next part. ## Feel free to use this space. (d) Create a list of vertical lines called crit_pts that corresponds to your critical points for h(x). To construct this list, we will actually write out each point we wish to use, since we only have 2 critical points to worry about. The y-values will extend from -2 to 6, and the x-values will be your answers from parts (b) and (c). Replace any XXs appropriately. crit_pts:=[[[XX,-2],[XX,6]],[[XX,-2],[XX,6]]]; (4)(a) Save a plot p1 of h(x) and dhdx(x) on the same set of axes for x-values between 0 and 6 and y-axis values from -2 to 6. Required: [1] Specify a different line style for each function. [2] Use a thickness of 2 for both functions. [3] Include an appropriate legend. Note: Each of the required components should be specified/included within your code! ## Feel free to use this space for p1. (b) Save a plot of crit_pts to p2, for x-values between 0 and 6 and for y-axis values from -2 to 6. Required: [1] Specify one line style to use for all of your lines that is different from both line styles used in p1. [2] Specify one color to use for all of your lines. Note: Each of the required components should be specified/included within your code! ## Feel free to use this space for p2. (c) Use plots[display] to put p1 and p2 on the same set of axes. ## Feel free to use this space to plot. (d) What do you notice about the subregions in your plot? Specifically, describe whether the derivative is positive or negative and whether h(x) is increasing or decreasing in each subregion. (5)(a) Remind yourself of the x-value at which the derivative is undefined. How does the original function h(x) behave (increasing/decreasing) on either side of this value? How is this behavior different from that of the function p(x) we explored in class on either side of x = 3? (b) Given your answers from part (a), why does it make sense to consider the points at which the derivative is undefined as critical points? (6) Take a few minutes and lines to remind yourself of any old commands as well as any new ones we used today. Required: list and describe them.