Mthemtics Tutoril I: Fundmentls of Clculus Kristofer Bouchrd September 21, 2006 1 Why Clculus? You ve probbly tken course in clculus before nd forgotten most of wht ws tught. Good. These notes were put together with the ssumption tht you ve seen most (ll) of this mteril before, but tht you probbly don t know why you lerned when you did. If these notes insult your bilities, feel free to burn them. After tking the course lst yer nd seeing wht mteril ws covered, how it ws presented, nd wht topics my clssmtes were most chllenged with, I thought tht review of some bsic mthemticl concepts would fcilitte smoother cquisition of the importnt stuff: the neuroscience. Through out, I hve omitted forml proofs, choosing to give definitions nd building grphicl intuitions insted. This is coupled with simple exmples of functions tht clerly illustrte the points, or functions tht re just to importnt not to see over nd over gin. Wht is further, to be ble to use the tools of mthemtics formlly, you need to know how to mnipulte the vrious concepts, nd so I ve lso included few of the rules governing few such mnipultions. So, why clculus? The short nswer is becuse the concepts of clculus, long with those of probbility theory, mke up the most fundmentl mthemticl tools you will encounter during NS201. For exmple, in the Electronics Tutoril yesterdy, Aron presented the differentil eqution describing the temporl evolution of membrne potentil in response to inject current: I m = V m dv m + C m R m dt (1) Along with its solution: V m (t) = I m R m (1 e t/τ ) (2) But the steps of how to get from (1) to (2) were omitted. For exmple, where does the e t/τ come from? One of the gols of tody is to give you the tools to solve these types of problems yourself. Here is n outline of the lecture: i) Review of Exponentils nd Logrithms ii) Derivtives nd Differentition iii) Integrls nd Integrtion iiii) Solving 1st Order Liner Differentil Eqution 2 Review of Exponentils nd Logrithms 2.1 Definitions x y = y i=1 x i = z e y = z log x (z) = y ln(z) = y e ln(z) = z The bse e occurs often in mthemtics nd science. Forms such s e t = z often describe the growth of n observed process through time, while e t = z models temporl decy. Its not clled the nturl logrithm for nothing! 1
2.2 Grphs 2.3 Rules for Exponentition x m x n = x m+n ln(x) + ln(y) = ln(xy) x n = 1/x n x 1 n = n x 3 Derivtives nd Differentition 3.1 Algebric Definition The derivtive of continuous function f(x) with respect to the vrible x, denoted df, is defined s: df = lim f(x + h) f(x) h h This describes how f(x) chnges s the inputs, x, is chnged by n infinitesimlly smll mount, x + h. This is usully physiclly interpreted s the instntneous rte of chnge of the f(x). For exmple, if N(t) is function tht describes the number of N + ions tht flow through chnnel s function of time, then dn(t) dt is the temporl rte t which the ions re flowing. NOTE: From now on, we will denote df s f (x), nd consequently, higher order derivtives, i.e. tking derivtive of derivtives, (e.g. d2 f ), s f (n) (x). Tht is: df 2 = f (x), d2 f = f (x),... 2 3.2 Grphicl Definition So fr we hve been tlking bout indefinite derivtives of functions, tht is, tking the derivtive of the entire function. However we cn evlute the derivtive t prticulr point, thus giving us the instntneous rte of chnge t one point of the input, tht is f (c) = y. This leds very nturlly to the grphicl interprettion of the derivtive s the slope of the tngent line t point. (3) 2
Here we lso see tht the tngent, i.e. the line tht intersects curve t only one point nd is in the sme direction s the curve t tht point, is the limit of secnts, line tht intersects curve in two points, s the distnce between the two points gets infinitesimlly smll. This is the geometric counterprt of the lgebric definition given bove. Compre the grphs with the definition in (3) if this is not obvious. The tngent t point is the best liner pproximtion of the function t tht point. 3.3 Men Vlue Theorem of Differentition Now suppose tht f(x) is continuous on the intervl [,b], (tht is to sy, there re not mny gps in f between the points x = nd x = b) nd lso differentible on (,b). Then it cn be proven tht there exists number c (,b) (c is between nd b) such tht f f(b) f() (c) = (4) b or, equivlently f (c)(b ) = f(b) f() (5) This mens tht we re gurnteed to be ble to find point on curve t which the derivtive t tht point is equl to the men of derivtive of the entire segment. Grphiclly, The men vlue theorem is one of the most importnt theorems in clculus. It sys tht if we tke two mesurements of function nd look t the verge rte of chnge between these two points, then we cn be sure tht there is point t which the function took on tht vlue. Think bout wht this mens in terms of cquiring voltge dt from neuron. We cn only smple the continuous voltge function of the cell t discrete points in time, defined by our smpling rte. Essentilly, the men vlue theorem llows us to mke inferences bout the rte of chnge between these two time points. Otherwise, we would just be mking shit up!! 3
3.4 Rules of Differentition Two of the most used properties of the derivtive re: Differentition is liner opertion: O(x + by) = O(x) + bo(y) d[f(x) + g(x)] = f (x) + g (x), f (cx) = cf (x) (6) This sys tht the derivtive of sum is the sum of the derivtives, nd tht scling the input by constnt is the sme s scling the derivtive. Chin Rule: d(f(g(x)) = f (g(x))g (x)orequivlently dy = dy du du (7) When deling with nested functions (i.e. functions tht depend on other functions), the chin rule sys tht the derivtive of the entire nest is product of the nested functions. 3.5 Grphing Derivtives Given the grph of prticulr function it is reltively esy to plot its derivtive. We will work through the exmple of plotting dsin(x) given the grph of sin(x). First note tht where f(x) hs mxim nd minim, f (x) = 0. If c 1 is mxim nd c 2 is minim, this mens tht we cn plce point t (c 1,0) nd (c 2,0) nd know tht f (x) psses through these points. Note tht this is result of Fermt s Theorem which hs mny importnt pplictions in optimiztion theory nd computtionl lerning. Second, we would like to know where the mx nd min of the f (x) re locted nd wht the vlue is. This cn be done by looking for the point where the plot of f(x) chnges most rpidly. If the slope is positive, then f (x) hs mxim t this point, nd conversely for minim. Now, ll we need to do is connect the points nd we re done. We see tht the derivtive of sin(x) is our good old friend cos(x). 4
It s tht esy. This my be useful to keep in mind when you red the Hodkin & Huxley ppers. 3.6 Derivtives of Importnt Functions nd Forms n = nxn 1 d x = x de ln() x = ex dsin(x) = cos(x) dcos(x) = sin(x) 4 Integrls nd Integrtion 4.1 Riemnn Definition The definite integrl of continuous function f(x) with respect to x over the intervl [,b], denoted f(x) cn be defined s (in the Riemnn formultion): lim n i=1 n h i x = f(x) (8) Here, h i is the height of rectngle (or some other plner object) from the x-xis nd x is the width of the rectngle. The left hd side of (8) is the sum of mny res, thus giving rise to n interprettion of the definite integrl s the re under the curve between [,b]. Note, however, tht more generl interprettion of the definite integrl is mesure of totlity of f(x). These more generl interprettions come from more powerful formultion of the integrl then the Riemnnin one which, though quit useful, is of limited utility, minly becuse the limits used in its construction re often not possible to tke with more exotic functions. 5
4.2 Grphicl Definition Grphiclly, the Riemnn integrl cn be thought of s pproximting the re under curve nd bove the x-xis with very mny plner shpes. The more rectngles (or trpezoids or whtever), the better the pproximtion. 4.3 Rules of Integrtion Like the derivtive, the integrl is liner opertor (O(x + by) = O(x) + bo(y)) cf(x) + dg(x) = c f(x) + d g(x) (9) Agin, the fct tht integrtion is liner opertion mkes nlytic mnipultions of equtions involving integrls esy to del with. Another useful property is liner seprbility: Consider the following: f(x)) = c f(x) + c f(x) (10) Liner seprbility llows us to define Totl re = A1+A2 nd Signed re = A1-A2 Depending on the function nd ppliction, either my be pproprite. 6
4.4 Men Vlue Theorem of Integrtion As for differentition, we hve men vlue theorem for integrtion. If f(x) is continuous on n intervl [,b], then there exists c (,b) such tht: f(c) = 1 f(x), / (11) b This sttes tht, s intuition would tell us, continuous function will tke on its verge t some point. It lso gives us glimpse t how to define the probbilistic men of continuous function; it is the re divided by the length of the intervl. 4.5 Indefinite Integrls nd Anti-derivtives At the begining of these notes, we tlked bout solving differentil eqution. I m = V m dv m + C m R m dt (12) This my be rewritten in more cnonicl form s: τ dv m dt = V inf V m (13) Where we hve mde the substitution: V inf = I m R m nd τ = R m C m, in ddition to little lgebr. To solve get this into the form of (2): V m (t) = I m R m (1 e t/τ ) (14) we need to undo the derivtive. This motivtes the definition of the indefinite integrl, i.e. one in which the bounds re not specified, s: f(x) = F (x) + c (15) where F (x) = f(x). Thus, we sy tht n indefinite integrl is n ntiderivtive. Note the constnt of integrtion c, which rise becuse the dc = 0, so we cn only specify n nti derivtive up to n dditive constnt. 4.6 Exmples of Indefinite Integrls I ve lso put the corresponding derivtive on the side. x n = xn+1 n+1 + c n = nxn 1 e x = e x + c de x = ex sin(x) = cos(x) + c cos(x) = sin(x) + c 1 x = ln(x) + c dln(x) d cos(x) dsin(x) = 1 x = ( sin(x)) = sin(x) = cos(x) So tht we cn use indefinite integrls to undo derivtives with out bounds, but wht if our eqution is bounded. 4.7 The Fundmentl Theorem of Clculus We will finish up our review of integrtion with sttement of the most importnt theorem in clculus. Prt I. Let f(x) be continuous function over [, b]. Let F be the function defined for x in [, b] by then x f(t) dt = F (x) (16) F (x) = f(x) (17) 7
for every x in [, b]. This implies tht: d x f(t) dt = f(x) (18) Prt one of the fundmentl theorem of clculus tells us tht integrtion nd differentition re, in fct, inverse opertions of ech other. Thus, if we wnt to undo derivtive, we merely tke its integrl. This will llow us to solve our differentil eqution. Prt II. Let f(x) be continuous function over [, b]. Let F function such tht then we hve Which implies: f(x) = F (x) (19) f(x), = F (b) F () = F (x) (20) F (x) = F (b) F () (21) Prt two gives us n effecient wy of computing definite integrls s the difference of ntiderivtives, with out hving to tke limits of Riemnn sums. No buddy likes tking the limit of Riemnn sums nywy. 5 Solving 1st Order Liner Differentil Eqution We will often be fced with differentil eqution of the form: τ dv m dt = V inf V m (t) (22) This sys tht the rte of chnge of V m in time is proportionl to the stedy stte vlue (V inf ), less the current vlue. The constnt of proportionlity is τ, which scles the rte of chnge. It is importnt to keep in mind tht we re integrting from time =0 to time = t. This is wht is know s liner first order differentil eqution with constnt coefficients. Thts lot of words, but lets see wht some of the men. Liner: liner eqution is one tht only hs terms involving sums of constnts nd products of constnts with the first power of the vrible. i.e. y = mx + b is liner, while y = x 2 + mx + b is not. First Order: the derivtive in the eqution is the first one, f (x). It would be 2 nd order if it hd f (x) in it. Differentil eqution: n eqution involving the derivtive of vrible. Often it is the derivtive with respect to time, but not necessrily. These equtions describe dynmicl systems, i.e. systems tht evolve in time. We begin our nlysis of 22 by mking the following substitution: z(t) = V m (t) V inf. This yields: τ dz dt = z (23) Now, we do wht is clled seprtion of vribles, by bringing ll the z terms on one side of the equlity nd ll the other terms to the other side: dz z = dt (24) τ Using the fundmentl theorem of clculus to undo dz nd dt: z(t) z(0) dz t z = dt 0 τ (25) We cn evlute the right hnd side using the fct tht 1 x = ln(x) + c: z(t) z(0) dz z = ln(z(t)) ln(z(0) = ln( z(t) z(0) (26) 8
In the lst step we used vrition of ln(x) + ln(y) = ln(xy) The left side trivilly evlutes to: (mke sure you see why) Combining 26 nd 27, we hve: Using the fct tht e ln(z) = z, we hve: t 0 dt τ = t τ ln( z(t) z(0) = t τ (27) (28) Substituting z(t) = V m (t) V inf nd solving for V m (t) gives us: z(t) ln( t e z(0) = e τ ==> z(t) z(0) = e t τ (29) V m (t) = V inf + (V (0) V inf )e t/τ ) (30) Now, we use our initil condition tht V(0) = 0 nd we hve our result (fter re-substituting): V m (t) = I m R m (1 e t/τ ) (31) 9