Pythonism

code and the oracular

Beginning Calculus – Differentiation

with 17 comments

Have you ever wondered how to find out the volume of an egg ? The volume of a cube is easy enough… a^3 where a is the side length, but calculations involving curves rather than straight lines seem to be a bit harder.

The branch of maths that deals with finding stuff about curves out is called calculus, and we’ll start to look at it here.

you may know that the equation of a straight line can be given as:

y=mx+c

where c is the y-intercept and m is the gradient. The gradient is defined as the rise over the run… the change in y over the change in x, so for a line like

y=3x+2

the gradient will be 3. The line rises 3 units for every 1 unit along, and since the value of the gradient is positive the line moves towards the upper right.

Now we must expand our ideas and consider how to find the gradient of a curved line…

Well, a curve seems to be defined by the fact that its gradient varies. at a given point


the gradient is one value and as we move along the gradient changes. In that respect a curve does not have one single value for its gradient but a whole series of values. Move a tiny distance to the right along the line and the gradient increases.

In fact there must be an infinite number of these gradient values for every one of the infinite number of points on the line. This suggests in other words that the gradient of the graph we’ve shown y=x^2 should rightly be given by a function that varies, not by a fixed value.

How do we find out this useful yet mysterious function that will tell us the gradient of a curve like y=x^2 ?

There is indeed a way to take the equation of a curved line, and alter it so that the resulting equation gives us a function that defines the gradient. The operation we perform on the function is called differentiation.

Once we’ve differentiated the right hand side of the equation of a line y=f(x), we get a function y=f'(x) that tells us how to work out the gradient of y=f(x).

This is where it gets subtler, because we have encountered a problem. To find the grad of y=3x+2 we have two choices, look at the algebraic equation and deduce that for a line y=mx+c, m is the gradient. Or we could look at the graph and calculate the rise over the run for the line we view. Between any two points on the line let’s measure the vertical change and the horizontal change. if we choose the points (1,5) and (2,8) then thr gradient is 8-5/2-1 = 3. if we choose (12,38) and (27,83) the gradient is 83-38/27-12 = 3. Ok no suprise.

But where do we start with a line like that of y=x^2 ? What is the gradient of this curve at the point (1,1) ? It’s easy to take a pair of points on the line, (1,1) and , say (3,9), but the rise over the run between these two points seems to be nothing to do with the gradient at (1,1), our straight line doesn’t match the curve. A simple triangle won’t do it. 9-1/3-1 = 4. well there is visibly a single point between (1,1) and (3,9) where the gradient is 4 but its not the point we are looking for.

But what if we made the two points nearer to each other ? well indeed, between (1,1) and (2,4) the line completing the triangle has slope 4-1/2-1 =3.That’s closer but the straight line is still steeper, it doesnt match the tangent line at (1,1)

ahh but we have received a suggestion from the gods of number here… what if we take a point even nearer (1,1), like (1.5,2.25) ? the slope will be nearer to the value we want… what about (1.1,1.21) even closer still.

Imagine continuing this process as far as it can go, we want a point very close, but just to the right of (1,1). Say the point is at (1+a,(1+a)^2)) where a is very small. Then the rise over the run between (1,1) and our point will very very nearly match the gradient at (1,1). What will that gradient be ?

rise/run = y2-y1/x2-x1

= (x+a)^2-x^2/(x+a)-x.

= x^2 + 2ax + a^2 – x^2/a

= 2ax + a^2 / a

= 2x + a

but a is so small its almost nothing, so we can ignore it.

this process leaves us with our mystery function, which is:

dy/dx = 2x

so for x=1, the gradient dy/dx is 2*1=2

let’s congratulate ourselves…we have just differentiated our first function. In other words we have obtained from one function, another function that gives the gradient at any point on the line.

Welcome to calculus !

Advertisements

Written by Luke Dunn

October 5, 2008 at 10:18 pm

17 Responses

Subscribe to comments with RSS.

  1. Thank you,

    Very helpful in getting an old guy started.

    Richard Spear

    May 13, 2009 at 7:21 am

  2. Thanks Dude got my Bro Started on calculus cause i couldnt remember how i learnt it 😛

    Josh

    August 20, 2009 at 9:57 am

  3. Awesome intro. … helped out big time.
    I’ve always known how to perform calculations regarding differentiation,but never rally knew what it meant.

    thanx alot

    Shikhi

    February 5, 2010 at 5:04 pm

  4. I can’t get from the first to the second equation

    (x+a)^2-x^2/(x+a)-a.

    = x^2 + 2ax + a^2 – x^2/a

    since when does ‘(x+a)-a’ leave ‘a’ in the denominator? Why shouldn’t it leave ‘x’ in the denominator?

    Ron

    June 18, 2010 at 5:51 pm

  5. Ok so they’re not equations. All I’m saying is that (x+a)-a does not equal “a”.

    Ron

    June 18, 2010 at 5:56 pm

  6. (x+a)-a in line 2 should read (x+a)-x.

    Ron

    July 1, 2010 at 3:51 am

    • correct – thank you for your eagle eyes !

      Trip Technician

      July 9, 2010 at 12:22 pm

  7. Thx boss. Very helpful for comprehension.

    Hasan

    September 25, 2010 at 1:25 pm

  8. everything fine. but i didn’t understand the ‘y=mx+c’

    Anon

    April 22, 2011 at 11:22 am

    • Anon,

      y=mx+c is the equation of a line. A sloped straight line will intercept the y-axis at a point. That point is the c term. The mx term is determined by dividing the rise of the line (the y directional length) divided by the run of the line (the x directional length). Think of a set of stairs. Each step has a height (y) and a width (x). That’s essentially what this function is measuring.

      So in the example above, y=mx+c

      The gradient (m) is the rise over the run. The rise is 6 and the run is 2, so in terms of steps, each step would be 6 in height and 2 in depth. 6/2 is divided, and is equal to 3.

      From the graph of the line, we see that the line intercepts the y-axis (c) at 2.

      Plugging in the values for m and c in to y=mx+c, we obtain:

      y=3x+2

      PhysCSEE

      April 29, 2011 at 2:05 pm

  9. Thanks a lot for this simple explanation and we need more and more

    SHERIF

    April 23, 2011 at 4:18 pm

  10. 10Q for UR MAIN POINTS!! PLEASE,try to add more information about calculus &its application in our real life!!

    DIRIBA ELIAS HORDOFA

    August 14, 2012 at 5:41 pm

    • thanks Diriba, yes that’s a good idea and I will try and get round to it !

      Trip Technician

      August 14, 2012 at 6:53 pm

  11. Time to start again. Thanks

    Ernest

    November 14, 2012 at 1:21 am

    • Every time we go back to “beginner’s mind” we deepen ourselves. It is a test of the true expert that they are not above re-examining the basics!

      Trip Technician

      November 14, 2012 at 6:48 am

  12. thanks a lot!

    Rekieg Mestark

    October 17, 2016 at 8:44 am


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: