Presentation on theme: "Slopes and Areas Frequently we will want to know the slope of a curve at some point. Or an area under a curve. We calculate slope as the change in height."— Presentation transcript:
1 Slopes and AreasFrequently we will want to know the slope of a curve at some point.Or an area under a curve.We calculate slope as the change in height of a curve during some small change in horizontal position: i.e. rise over runWe calculate area under a curve as the sum of areas of many rectangles under the curve.
2 Review: AxesWhen two things vary, it helps to draw a picture with two perpendicular axes to show what they do. Here are some examples:yxxtWe say “ y is a function of x” or “x is a function of t”x varies with ty varies with xHere we say “ y is a function of x” Here we say “x is a function of t” .
3 Positions We identify places with numbers on the axes Each tick mark on the axes is one away from its neighbor. The axes are number lines that are perpendicular to each other.Positive x to the right of the origin (x=0, y=0), positive y above the origin.The axes are number lines that are perpendicular to each other.Positive x to the right of the origin (x=0, y=0), positive y above the origin.
4 Straight LinesSometimes we can write an equation for how one variable varies with the other. For example a straight line can be described asy = ax + b Here, y is a position on theline along the y-axis, x is a position on the line along the x- axis, a is the slope, and b is the place where the line hits the y-axisNotice here that as x increases, y decreases
5 Straight Line Slopey = ax + b The slope, a, is just the rise Dy divided by the run Dx. We can do this anywhere on the line.Proceed in the positive x direction for some number of units, and count the number of units up or down the y changesNotice here that as x (the run) increases, y (the rise) decreases. This line has a negative slope.So the slope of the line here is Dy =DxRemember: Rise over Runand up and right are positive
6 y- intercepty = ax + b is our equation for a line b is the place where the line hits the y-axis The intercept b is y = +3 when x = 0 for this lineEach point on the line has position (x,y). The line has a negative slope -3/2 and the y value where x=0 (the intercept) is +3
7 We want an equation for this line y = ax + b is the general equation for a lineWe want an equation for this lineEquation of our example lineSo the equation of the line here is y = -3 x + 32Each point on the line has position (x,y). The line has a negative slope -3/2 and the y value where x=0 (the intercept) is +3We plugged in the slope and y intercept
8 An example: a flow gauge on a small creek Suppose we plot as the vertical axis the flow rate in m3/ hour and the horizontal axis as the time in hoursThen the line tells us that a flash flood caused the creek to flow at 3 m3/hour initially, but flow decreased at a rate (slope) of - 3/2 m3 per hour after that, so it stopped after two hours.BTW, the area under the line tells us the total volume of water the flowed past the gauge during the two hours.Area of a triangle = 1/2bhArea = 1/2 x 2hr x 3m3/hr = 3 m3Area of a triangle is half of a rectange A = 1/2 base x height = 1/2 x 2 x 3 = 3 m3This plot, flow vs. time, is a hydrograph. The area under the curve is the volume of runoff.
9 TrigPerpendicular axes and lines are very handy. Recall we said we use them for vectors such as velocity. To break a vector r into components, we use trig. The rise is r . sin q, and the run is r cos q.Demo: The sine is the ordinate (rise) divided by the hypotenusesin q = rise / r so the rise = r sin qSimilarly the run = r cos qWhenever possible we work with unit vectors so r = 1, simplifying calculations.hypotenuseriseThis vector with size r and direction q, has been broken down into components. Along the y-axis, the rise is Dy = +r sin qAlong the x-axis, the run is Dx = +r cos qrunWhenever possible we work with unit vectors so r = 1, simplifying calculations.
10 Okay, sines and cosines, but what’s a Tangent? A Tangent Line is a line that is going in the direction of a point proceeding along the curve.A Tangent at a point is the slope of the curve there.A tangent of an angle is the sine divided by the cosine.Positive slopes shown in green, zero slopes are black, negative are red.
11 Tangents to curvesHere the vector r shows the velocity of a particle moving along the blue line f(x)At point P, the particle has speed the length of r and the direction shown makes an angle q to the x-axisslope = f(x + h) –f(x)(x + h) – xThis is rise over run as alwaysLets see that is r sin q = tan qr cos qBut the sine over the cosine is called the tangentThe slope is a tangent to the curve.P
12 Slope at some point on a curve We can learn the same things from any curve if we have an equation for it. We say y = some function f of x, written y = f(x). Lets look at the small interval between x and x+h. y is different for these two values of x.The slope is rise over run as alwaysslope = f(x + h) –f(x)(x + h) – xriseThis is inaccurate for a point on a curve, because the slope varies.runThe exact slope at some point on the curve is found by making the distance between x and x+h small, by making h really small. We call it the derivative.Derivative is the same equation as slope except that h gets very small. In the slope equation’s denominator the x and –x add to zeroderivative dy/dx = f(x + h) –f(x)lim h=> h
13 A simple derivative for Polynomials The exact slope “derivative” of f(x)f’(x) = f(x + h) – f(x) = f(x + h) – f(x)lim h=> (x + h) – x lim h=> his known for all of the types of functions we will use in Hydrology.For example, suppose y = xnwhere n is some constant and x is a variableThen y’(x) = dy/dx = nxn-1dy/dx “The change in y wrt x”dy/dx means “The small change in y with respect to a small change in x”
14 Some Examples for Polynomials We just saw for polynomials y = xn the dy/dx = nxn - 1Some Examples for Polynomials(1) Suppose y = x4 . What is dy/dx?dy/dx = 4x3(2) Suppose y = x-2What is dy/dx?dy/dx = -2x-3dy/dx = nxn-1
15 DifferentialsThose new symbols dy/dx mean the really accurate slope of the function y = f(x) at any point. We say they are algebraic, meaning dx and dy behave like any other variable you manipulated in high school algebra class.The small change in y at some point on the function (written dy) is a separate entity from dx.For example, if y = xndy/dx = nxn-I also means dy = nxn-I dx
16 Variable namesThere is nothing special about the letters we use except to remind us of the axes in our coordinate systemFor example, if y = undy = nun-I du is the same as the previous formula.y = unu
17 Constants Alone The derivative of a constant is zero. If y = 17, dy/dx = 0 because constants don’t change, and the constant line has zero slopeyY = 1717xFor any dx, dy = 0
18 X alone Suppose y = x What is dy/dx? Y = x means y = x1. Just follow the rule.Rule: if y = xn then dy/dx = nxn – 1So if y = x , dy/dx = 1x0 = 1Anything to the power zero is one.
19 A Constant times a Polynomial Suppose y = 4 x7 What is dy/dx?Rule: The derivative of a constant times a polynomial is just the constant times the derivative of the polynomial.So if y = 4 x7 , dy/dx = 4 . ( 7x6)
20 For polynomials y = xn dy/dx = nxn - 1 Multiple Terms in a sumThe derivative of a function with more than one term is the sum of the individual derivatives.If y = 3 + 2t + t2 then dy/dt = tNotice 2t = 2t1
21 The derivative of a product In words, the derivative of a product of two terms is the first term times the derivative of the second, plus the second term times the derivative of the first.
22 Exponents aman = am+n am/an = am-n (am)n = amn (ab)m = ambm Suppose m and n are rational numbersaman = am+n am/an = am-n(am)n = amn (ab)m = ambm(a/b)m = am/bm a-n = 1/anYou can remember all of these just by experimentingFor example 22 = 2x2 and 24= 2x2x2x2 so 22x24 = 2x2x2x2x2x2 = 26reminds you of rule 1Rule 6, a-n = 1/an , is especially useful
23 Logarithms Logarithms (Logs) are just exponents if by = x then y = logb xlog10 (100) = 2 because 102 = 100Natural logs (ln) use e = as a baseFor example ln(1) = loge(1) = 0because e0 = (2.718)0 = 1Anything to the zero power is one.
24 ee is a base, the base of the so-called natural logarithms just mentioned. e ~ 2.718It has a very interesting derivative (slope).Suppose u is some functionThen d(eu) = eu du“The derivative of eu is eu times the derivative of u”Example: If y = e2x what is dy/dx?here u = 2x, so du = 2Therefore dy/dx = e2x . 2
25 IntegralsThe area under a function between two values of, for example, the horizontal axis is called the integral. It is a sum of a series of very tall and thin rectangles, and is indicated by a script S, like this:
26 IntegralsTo get accuracy with areas we use extremely thin rectangles, much thinner than this.
27 Example 1 Integration is the inverse operation for differentiation If y=3x5 Then dy/dx = 15x4Then y = x4 dx = 3x5 + a constantWe have to add the constant as a reminder because, if a constant was present in the original function, it’s derivative would be zero and we wouldn’t see it.
28 Example2: a trickSometimes we must multiply by one to get a known integral form. For example, we know:Remember d(eu) = eu du. If we find an integral in this form, we know the answer is the original function before differentiation.Here multiplying by a/a = 1 puts the integral in the right form.Note the constant. We can evaluate a derivative easily. Integrals are not all known.
29 A useful methodWhen a function changes from having a negative slope to a positive slope, or vs. versa, the derivative goes briefly through zero.We can find those places by calculating the derivative and setting it to zero.
30 Getting useful numbers Suppose y = x2.(a) Find the minimumIf y = x2 then dy/dx = 2x1 = 2x. Set this equal to zero2x=0 so x=0y = x2 so if x = 0 then y = 0Therefore the curve has zero slope at (0,0)
31 Getting useful numbers Suppose y = x2.TODO: Find (a) the location of the minimum, and (b) the slope at x=3See previous page(b) dy/dx = 2x , so set x=3then the slope is 2x = = 6
32 Getting useful numbers Here is a graph of y = x2Notice the slope is zero at (0,0), the minimumThe slope at (x=3,y=9) is +6/1 = 6