Sin, Cos and All That James K Peterson Department of Biological Sciences and Department of Mathematical Sciences Clemson University September 9, 2014 Outline Sin, Cos and all that! A New Power Rule Derivatives of Complicated Things
This lecture will go over some basic material about sin and cos functions We want to take their derivatives and so forth You should have been exposed to some trigonometry in high school, but even if your past experience with it was yucky and brief, you ll know enough to get started So we will assume you know about sin and cos and their usual properties After all, you have seen this before! What we want to do it something new with them find their derivatives So if you are rusty about these two functions, crack open you re old high school book and refresh your mind We need to find the derivatives of the sin and cos functions We will do this indirectly Ok good, you re back Look at this figure Height is sinx) A x Inner Sector O Width is cosx) B The circle here has radius 1 and the angle x determines three areas: the area of the inner sector, 1 2 cos2 x) x, the area of triangle OAB, 1 2 sinx) and the area of the outer sector, 1 2 x We see the areas are related by 1 2 cos2 x) x < 1 2 sinx) < 1 2 x
From it, we can figure out three important relationships from high school times, you should know a number of cool things about circles The one we need is the area of what is called a sector Draw a circle of radius r in the plane Measure an angle x counterclockwise from the horizontal axis Then look at the pie shaped wedge formed in the circle that is bounded above by the radial line, below by the horizontal axis and to the side by a piece of the circle It is easy to see this in the figure Looking at the picture, note there is a first sector or radius cosx) and a larger sector of radius 1 It turns out the area of a sector is 1/2r 2 θ where θ is the angle that forms the sector From the picture, the area of the first sector is clearly less than the area of the second one So we have 1/2) cos 2 x) x < 1/2) x Now if you look at the picture again, you ll see a triangle caught between these two sectors This is the triangle you get with two sides having the radial length of 1 The third side is the straight line right below the arc of the circle cut out by the angle x The area of this triangle is 1/2) sinx) because the height of the triangle is sinx) This area is smack dab in the middle of the two sector areas So we have 1/2) cos 2 x) x < 1/2) sinx) < 1/2) x These relationships work for all x and canceling all the 1/2) s, we get cos 2 x) x < sinx) < x Now as long as x is positive, we can divide to get cos 2 x) < sinx)/x < 1
Almost done From our high school knowledge about cos, we know it is a very smooth function and has no jumps So it is continuous everywhere and so lim x 0 cosx) = 1 since cos0) = 1 If that is true, then the limit of the square is 1 2 or still 1 So lim x 0 sinx)/x is trapped between the limit of the cos 2 term and the limit of the constant term 1 So we have to conclude lim sinx)/x = 1 x 0 + We can do the same thing for x 0, so we know lim x 0 sinx)/x = 1 Hah you say Big deal you say But what you don t know is the you have just found the derivative of sin at 0! Note sinh) sin0) sinh) sinx)) 0) = lim = lim h 0 h h 0 h because we know sin0) = 0 Now if lim x 0 sinx)/x = 1, it doesn t matter if we switch letters! We also know lim h 0 sinh)/h = 1 Using this, we see sinh) sinx)) 0) = lim = 1 = cos0) h 0 h as cos0) = 1! Review, Review)
This result is the key Consider the more general result sinx + h) sinx) sinx)) = lim h 0 h Now dredge up another bad high school memory: the dreaded sin identities We know and so sinu + v) = sinu) cosv) + cosu) sinv) sinx + h) = sinx) cosh) + cosx) sinh) Using this we have sinx + h) sinx) sinx)) = lim h 0 h Now regroup a bit to get sinx) cosh) + cosx) sinh) sinx) = lim h 0 h sinx) 1 + cosh)) + cosx) sinh) = lim h 0 h 1 + cosh)) sinx)) = lim sinx) h 0 h + cosx) sinh) h
We are about done Let s rewrite 1 cosh))/h by multiplying top and bottom by 1 + cosh) This gives sinx) 1 + cosh)) h = sinx) 1 + cosh)) h = sinx) 1 cos2 h)) h 1 + cosh)) 1 + cosh)) 1 1 + cosh)) Now 1 cos 2 h) = sin 2 h), so we have sinx) 1 + cosh)) h = sinx) sin2 h) h = sinx) sinh) h 1 1 + cosh)) sinh) 1 + cosh) Now sinh)/h goes to 1 and sinh)/1 + cosh)) goes to 0/1 = 0 as h goes to zero So the first term goes to sinx) 1 0 = 0 Since cos0) = 1 and cos is continuous, the first limit is sinx) 0) We also know the second limit is cosx) 1) So we conclude sinx)) = cosx) And all of this because of a little diagram drawn in Quadrant I for a circle of radius 1 plus some high school trigonometry What about cos s derivative? The easy way to remember that sin and cos are shifted versions of each other We know cosx) = sinx + π/2) So by the chain rule cosx)) = sinx + π/2)) = cosx + π/2) 1)
Now remember another high school trigonometry thing cosu + v) = cosu) cosv) sinu) sinv) and so cosx + π/2) = cosx) cosπ/2) sinx) sinπ/2) We also know sinπ/2) = 1 and cosπ/2) = 0 So we find Let s summarize: cosx)) = sinx) sinx)) = cosx) cosx)) = sinx) And, of course, we can use the chain rule too!! As you can see, in this class, the fun never stops that s a reference by the way to an old Styx song) Simple chain rule! Find sin4t)) Solution This is easy: sin4t)) = cos4t) 4 = 4 cos4t)
Chain rule! Differentiate sin 3 t) Solution The derivative is sin 3 t) ) = 3 sin 2 t) sin) t) ) = 3 sin 2 t) cost) Find sin 3 x 2 + 4)) Solution sin 3 x 2 + 4)) = 3 sin 2 x 2 + 4) cosx 2 + 4) 2x)
Chain and product rule Find Solution sin2x) cos3x)) sin2x) cos3x)) = 2 cos2x) cos3x) 3 sin2x) sin3x) Quotient rule! Find tanx)) Solution We usually don t simplify our answers, but we will this time as we are getting a new formula! ) sinx) tanx)) = cosx) = cosx) cosx) sinx) sinx)) cos 2 x) = cos2 x) + sin 2 x) cos 2 x)
Continued Solution Next, recall cos 2 x) + sin 2 x) = 1 always and so 1 tanx)) = cos 2 x) Now if you remember, 1/cos 2 x) is called sec 2 x) So we have a new formula: tanx)) = sec 2 x) Homework 16 161 Find sin 4 2x + 5)) 162 Find cos4t)) 163 Find sin8t)) 164 Find sinx 3 ) cos5x)) 165 Find cos4t) sin9t))
Homework 16 166 Find tan6t)) sin4t) 167 Find cos3t)) 1 168 Find 2+tan 4t)) 2 Now we can do more chain rules!!! Now that we have more functions to work with, let s use the chain rule in the special case of a power of a function We state this as a theorem giving our long standing tradition of trying hard to get you to see things more abstractly Theorem Power Rule For Functions If f is differentiable at the real number x, then for any integer p, f p is also differentiable at the number x with f p x)) = p f p 1 x) ) f x)
Differentiate 1 + sin 3 2t)) 4 Solution The derivative uses lots of chain rules 1 + sin 3 2t)) 4) = 4 1 + sin 3 2t)) 3 3 sin 2 2t) cos2t) 2 ) Find 1 + 2x + 9x 2 ) 10 Solution 1 + 2x + 9x 2 ) 10 ) = 10 1 + 2x + 9x 2 ) 9 2 + 18 x)
Homework 17 ) 171 Find 2 + 2 sin3t)) 3 ) 172 Find 2x + 5x 2 + 9x 3 ) 6 ) 173 Find 1 + sin3t)) 4 ) 174 Find cos2t) + sin5t)) 3 ) 175 Find x 2 + 4) 11 Homework 17 ) 176 Find 1 + cos6t) 9 3 ) sin2t) 177 Find sin3t)+cos4t))
We will often need to find the derivatives of more interesting things than simple polynomials Finding rate of change is our mantra now! Let s look at a small example of how an excitable neuron transforms signals that come into it into output signals called action potentials For now, think of an excitable neuron as a processing node which accepts inputs x and transforms them using a processing function we will call σx) into an output y As we know, neural circuits are built out of thousands of these processing nodes and we can draw them as a graph which shows how the nodes interact Look at the simple example in next figure Figure: A simple neural circuit: 1-2-1
In the picture you ll note there are four edges connecting the neurons We ll label them like this: E 1 2, E 1 3, E 2 4 and E 3 4 When an excitable neuron generates an action potential, the action potential is like a signal The rest voltage of the cell is about 70 millivolts and if the action potential is generated, the voltage of the cell rises rapidly to about 80 millivolts or so and then falls back to rest The shape of the action potential is like a scripted response to the conditions the neuron sees as the input signal In many ways, the neuron response is like a digital on and off signal, so many people have modeled the response as a curve that rises smoothly from 0 the off ) to 1 the on ) Such a curve looks like the one shown in the figure below Figure: A Simple Neural Processing Function
The standard neural processing function has a high derivative value at 0 and small values on either side You can see this behavior in the figure below We can model this kind of function using many approaches: for example, σx) = x2 works and we can also build σ using 1+x 2 exponential functions which we will get to later Now the action potential from a neuron is fed into the input side of other neurons and the strength of that interaction is modeled by the edge numbers E i j for our various i and j s To find the input into a neuron, we take the edges going in and multiply them by the output of the node the edge is coming from If we let Y 1, Y 2, Y 3 and Y 4 be the outputs of our four neurons, then if x is the input fed into neuron one, this is what happens in our small neural model Y 1 = σx) Y 2 = σe 1 2 Y 1) Y 3 = σe 1 3 Y 1) Y 4 = σe 2 4 Y 2 + E 3 4 Y 3)
Note that Y 4 depends on the initial input x in a complicated way Here is the recursive chain of calculations First, plug in for Y 2 and Y 3 to get Y 4 in terms of Y 1 ) Y 4 = σ E 2 4 σe 1 2 Y 1) + E 3 4 σe 1 3 Y 1) Now plug in for Y 1 to see finally how Y 4 depends on x ) Y 4x) = σ E 2 4 σ E 1 2 σx) + E 3 4 σ E 1 3 σx)) ) For the randomly chosen edge values E 1 2 = 011622, E 1 3 = 142157, E 2 4 = 117856 and E 3 4 = 068387, we can calculate the Y 4 output for this model for all x values from 3 to 3 and plot them Now negative values correspond to inhibition and positive values are excitation our simple model generates outputs between 095 for strong inhibition and 065 for strong excitation Probably not realistic! But remember the edge weights were just chosen randomly and we didn t try to pick them using realistic biologically based values We can indeed do better But you should see a bit of how interesting biology can be illuminated by mathematics that comes from this class! See the next figure
Figure: Y4 output for our neural model Note that this is essentially a σσσ))) series of function compositions! So the idea of a composition of functions is not just some horrible complication mathematics courses throw at you It is really used in biological systems Note, while we know very well how to calculate the derivative of this monster, Y 4 x) using the chain rule, it requires serious effort and the answer we get is quite messy Fortunately, over the years, we have found ways to get the information we need from models like this without finding the derivatives by hand! Also, just think, real neural subsystems have hundreds or thousands or more neurons interacting with a vast number of edge connections Lots of sigmoid compositions going on! Let s do a bit more here We know we can approximate the derivative using a slope term Here that is Y 4x) = Y 4p) + Y 4p)x p) + Ex p)
since Eh)/h) is small near x too, we can say near x Y 4p + h) Y 4p) h Y 4p) We can use this idea to calculate the approximate value of the derivative of Y 4 and plot it As you can see from the figure below, the derivative is not that large, but it is always negative Remember, derivatives are rates of change and looking at the graph of Y 4 we see it is always going down, so the derivative should always be negative Figure: Y4 s Approximate Derivative Using h = 01