Calculus/Derivatives

Derivative of a function f at a number a edit

Notation edit

We denote the derivative of a function   at a number   as  .

Definition edit

The derivative of a function   at a number   a is given by the following limit (if it exists):

 


An analagous equation can be defined by letting  . Then  , which shows that when   approaches  ,   approaches  :

 


Interpretations edit

As the slope of a tangent line edit

Given a function  , the derivative   can be understood as the slope of the tangent line to   at  :

Example edit

Find the equation of the tangent line to   at  .

Solution edit

To find the slope of the tangent, we let   and use our first definition:

 


It can be seen that as   approaches  , we are left with  . If we plug in   for  :

 


So our preliminary equation for the tangent line is  . By plugging in our tangent point   to find  , we can arrive at our final equation:

 


So our final equation is  .

As a rate of change edit

The derivative of a function   at a number   can be understood as the instantaneous rate of change of   when  .

The derivative as a function edit

So far we have only examined the derivative of a function   at a certain number  . If we move from the constant   to the variable  , we can calculate the derivative of the function as a whole, and come up with an equation that represents the derivative of the function   at any arbitrary   value. For clarification, the derivative of   at   is a number, whereas the derivative of   is a function.

Notation edit

Likewise to the derivative of   at  , the derivative of the function   is denoted  .

Definition edit

The derivative of the function   is defined by the following limit:

 

Also,

 

or

 

d(x^n)/dx edit

Consider the sequences:

 

 

 

 

  many terms containing  

  many terms containing  

  many terms containing  

Therefore:

  many terms with each and every term containing  

 

  read as "derivative with respect to   of   to the power  ."

Later it will be shown that this is valid for all real  , positive or negative, integer or fraction.

Examples edit

 

 

   

   

 

Without Using Calculus edit

Derivative of cubic function edit

 
Graph of cubic function illustrating use of associated quadratic.
When   there is exactly 1 value of   that gives  
When   there are 3 values of   that give  
When   there are exactly 2 values of   that give  
Point   is a stationary point.

In the diagram there is a stationary point at   When   there are exactly 2 values of   that produce  

Aim of this section is to derive the condition that produces exactly 2 values of  


See Cubic function as product of linear function and quadratic.

The associated quadratic when  

 

 

 


Divide   by  

This division gives a quotient of   and remainder of  

Factor   divides   exactly. Therefore, remainder   the desired condition.

When   the derivative of  

Derivative of quartic function edit

The quartic function:  

In   substitute   for  

In   substitute   for  

 

 

Reduce (4) and (5) and substitute Q for qq:

 

 

Combine (4a) and (5a) to eliminate p and produce a function in Q:

  where:

 

 

 

 

 

C0 = (- 2048aaaaacddeeee + 768aaaaaddddeee + 1536aaaabcdddeee - 576aaaabdddddee
      + 1024aaaacccddeee - 1536aaaaccddddee + 648aaaacdddddde - 81aaaadddddddd
      - 1152aaabbccddeee + 480aaabbcddddee - 18aaabbdddddde + 640aaabcccdddee
      - 384aaabccddddde + 54aaabcddddddd - 128aaacccccddee + 80aaaccccdddde
      - 12aaacccdddddd + 216aabbbbcddeee - 81aabbbbddddee - 144aabbbccdddee
      + 86aabbbcddddde - 12aabbbddddddd + 32aabbccccddee - 20aabbcccdddde
      + 3aabbccdddddd)

Coefficient of interest is   which is in fact the value   See Equal Roots of Quartic Function.


If   is a solution and   contains at least 2 roots of format   In other words 2 equal roots where  

If   and   become:

 

 

  is equivalent to   and   is derivative of  

Product Rule edit

Let    where  

      

    

   

   

Examples edit

Let   Calculate  

 

Differentiate both sides.

 

         

This shows that   as above is valid when   is a positive fraction.

Let  . Calculate  .

 

Differentiate both sides.

 

 

This shows that   as above is valid for negative  .

Let  . Calculate  .

 

Differentiate both sides.

 

       

This shows that   as above is valid when   is a negative fraction.

Quotient rule edit

Used where  

 

 

 

 

 

Derivatives of trigonometric functions edit

sine(x) edit

 

 

 

   

The value  :

>>> # python code
>>> [ (math.cos(Δx)-1)/Δx for Δx in (.1,.01,.001,.0001,.0000_1,.0000_01,.0000_001,.0000_0001,.0000_0000_1) ]
[-0.049958347219742905, -0.004999958333473664, -0.0004999999583255033, 
-4.999999969612645e-05, -5.000000413701855e-06, -5.000444502911705e-07, 
-4.9960036108132044e-08, 0.0, 0.0]
>>>

  by L'Hôpital's rule.

The value  :

>>> # python code
>>> [ math.sin(Δx)/Δx for Δx in (.1,.01,.001,.0001,.0000_1,.0000_01,.0000_001,.0000_0001,.0000_0000_1) ]
[0.9983341664682815, 0.9999833334166665, 0.9999998333333416, 
0.9999999983333334, 0.9999999999833332, 0.9999999999998334, 
0.9999999999999983, 1.0, 1.0]
>>>

  by L'Hôpital's rule.

   

Proof of 2 limits edit

 
Figure 1:  

Area of sector   area of triangle  
Area of triangle   area of sector  

 


In the diagram      

Let   be the area of a sector of a circle. Then   and  

Area of sector  

Area of triangle  

Area of sector  

Therefore  

 

 

 

 

 

Therefore  

 


       

       

cosine(x) edit

 

  

Differentiate both sides:

  

 

tan(x) edit

 

 

Differentiate both sides:

  

  

 

Derivatives of inverse trigonometric functions edit

arcsine(x) edit

 
Figure 2: Graph of   and associated curves.

 

 

 

 


In the figure to the right you can see that the curves   are the same curve. However curve   is limited to  

The derivative   shows that the slope of   is   when   and infinite when  

arccosine(x) edit

 
Figure 3: Graph of   and associated curves.

 

 

 

 

In the figure to the right you can see that the curves   are the same curve. However curve   is limited to  

The derivative   shows that the slope of   is   when   and infinite when  

arctan(x) edit

 
Figure 4: Graph of   and associated curves.

 

 

 

 

In the figure to the right you can see that the curves   are the same curve. However curve   is limited to  

The derivative   shows that the slope of   is   when   and   when  

Derivatives of logarithmic functions edit

a^x or   edit

 

 

 

 

Consider the value   specifically  . L'Hôpital's rule cannot be used here because   is what we are trying to find.

 

 

 

  taken   times.

We will look at the expression   for different values of   with   (approx) in which case the expression becomes   where   is   or   taken   times. This approach is used here because function sqrt() can be written so that it does not depend on logarithmic or exponential operations.

>>> # python code
>>> N=Decimal(2)
>>> v2 = ( [ n for n in (N,) for p in range (0,70) for n in (n.sqrt(),) ][-1] -1 )*(2**70) ; v2
Decimal('0.69314718055994530941743560122437474084363865015406919942144')
>>> 
>>> N=Decimal(8)
>>> v8 = ( [ n for n in (N,) for p in range (0,70) for n in (n.sqrt(),) ][-1] -1 )*(2**70) ; v8
Decimal('2.07944154167983592825352768227031325913255072732801782513664')
>>> 
>>> N=Decimal(32)
>>> v32 = ( [ n for n in (N,) for p in range (0,70) for n in (n.sqrt(),) ][-1] -1 )*(2**70) ; v32
Decimal('3.46573590279972654709124760144583715956091114572543812435968')
>>> 
>>> N=Decimal(128)
>>> v128 = ( [ n for n in (N,) for p in range (0,70) for n in (n.sqrt(),) ][-1] -1 )*(2**70) ; v128
Decimal('4.85203026391961716593059535875094644210510807293198187102208')
>>>

Compare the values v8, v32, v128 with v2:

>>> v8/v2; v32/v2; v128/v2
Decimal('3.00000000000000000000176135549769209744528640235368520610520')
Decimal('5.00000000000000000000587118499230699148996545343403093128046')
Decimal('7.00000000000000000001232948848384468209997247971055570994695')
>>>

We know that  . The values v2, v8, v32, v128 are behaving like logarithms. In fact   is the natural logarithm of   written as  

 
Figure 5: Graphs of   for a =   .

Figure 5 contains graphs of   for   with graph of   included for reference.

All values of   are valid for all curves except where  

The correct value of   is:

>>> Decimal(2).ln()
Decimal('0.693147180559945309417232121458176568075500134360255254120680')
>>>

Our calculation produced:

Decimal('0.69314718055994530941743560122437474084363865015406919942144')

accurate to 21 places of decimals, not bad for one line of simple python code using high-school math.

This method for calculation of   supposes that function sqrt() is available.

Programming language python interprets expression a**b as   Therefore, in python,   can be calculated in accordance with the basic definition above:

# python code
>>> getcontext().prec
101 # Precision of 101.
>>> dx = Decimal('1E-50')
>>> (2**dx - 1)/dx
Decimal('0.69314718055994530941723212145817656807550013436026') # ln(2)
>>> (2**(-dx) - 1)/(-dx)
Decimal('0.693147180559945309417232121458176568075500134360253') # ln(2)
>>>

When  

The base of natural logarithms is the value of   that gives  

This value of  , usually called  

>>> # python code
>>> N=e=Decimal(1).exp();N
Decimal('2.71828182845904523536028747135266249775724709369995957496697')
>>> ( [ n for n in (N,) for p in range (0,70) for n in (n.sqrt(),) ][-1] -1 )*(2**70)
Decimal('1.0000_0000_0000_0000_0000_0423_51647362715016770651530003719651328')
>>> # ln(e) = 1. Our calculation of ln(e) is accurate to 21 places of decimals.

When    

ln(x) edit

 

 

 

 

Examples edit

 

 

 

 

  Calculate  

 

 

 

     

Careful manipulation of logarithms converts exponents into simple constants.

Chain rule edit

Used where  

Examples edit

 

Let   where  .

 

 

Let   where  .

 

Applications of the Derivative edit

Shape of curves edit

The first derivative of   or   As shown above,   at any point   gives the slope of   at point  

  is the slope of   when  

 
Figure 1: Diagram illustrating relationship between  and  
When   both   and slope of  
When   both   and slope of  
When   both   and slope of  
Point   is absolute minimum.

In the example to the right,   and  

Of special interest is the point at which   or slope of  

When   and  

The point   is called a critical point or stationary point of   Because   has exactly one solution for   has exactly one critical point.

The value of   at point   is less than   at both   Therefore the critical point   is a minimum of  

In this curve   the point   is both local minimum and absolute minimum.

 
Figure 1: Diagram illustrating relationship between   and  
When   or   both   and slope of  
When   both   and slope of  
When   both   and slope of  
When   both   and slope of  
Point   is local maximum.
Point   is local minimum.

In the example to the right,   and  


Of special interest are the points at which   or slope of  

When   and   or

When   and  

The points   are critical or stationary points of   Because   has exactly two real solutions for   has exactly two critical points.


Slope of   to the left of   is positive and adjacent slope of   to the right of   is negative. Therefore point   is local maximum. Point   is not absolute maximum.


Adjacent slope of   to the left of   is negative and slope of   to the right of   is positive. Therefore point   is local minimum. Point   is not absolute minimum.

Maxima and Minima edit

Electric water heater edit

 
Figure 1(a): Graph of   and   for  
with   axis compressed.
For maximum   and
 

A cylindrical water heater is standing on its base on a hard rubber pad that is a perfect thermal insulator. The vertical curved surface and the top are exposed to the free air. The design of the cylinder requires that the volume of the cylinder should be maximum for a given surface area exposed to the free air. What is the shape of the cylinder?

Let the height of the cylinder be   and let   where   is the radius and   is a constant.

Surface of cylinder  

Volume of cylinder  

 

 

 

For maximum volume,  

Therefore  

 

The height of the cylinder equals the radius.

Square and triangle edit

 
Figure 1(b): Graph of parabola   with   axis compressed.

A square of side   has perimeter   and area  

An equilateral triangle of side   has perimeter   and area  

 

Total area   and   must be minimum. What is the value of  ?

 

 

   

     

For minimum  

 

 

   

County Road edit

 
Figure 1(c): Plan of county road between Town A and Town B to be constructed so that cost is minimum.

Town B is 40 miles East and 50 miles North of Town A. The county is going to construct a road from Town A to Town B. Adjacent to Town A the cost to build a road is $500k/mile. Adjacent to Town B the cost to build a road is $200k/mile. The dividing line runs East-West 30 miles North of Town A. Calculate the position of point C so that the cost of the road from Town A to Town B is minimum.

Let point  

Then distance from Town A to point  

Distance from Town B to point      

 
Figure 1(d): Graphs showing cost of county road   and  
Curve showing   is actually  .
Cost is minimum where  

Cost   in units of $100k.

For minimum cost  

 

 

 

 

Cardboard box edit

 
Figure 1(e): Sheet of cardboard to be cut and folded to make box of maximum possible volume.
Cut on purple lines, fold on red lines.
Design of box includes top.

A piece of cardboard of length   and width   will be used to make a box with a top. Some waste will be cut out of the piece of cardboard and the remaining cardboard will be folded to make a box so that the volume of the box is maximum.

What is the height of the box?

 
Figure 1(f): Curves associated with design of cardboard box.
  and   is maximum when  

 

 

 

For maximum volume  

 

  inches.

Solving ellipse at origin edit

 
Figure 1: Graph of ellipse showing semi-chord through center.
When length of   is maximum, length of major axis  
When length of   is minimum, length of minor axis  

An ellipse with center at origin has equation:  

Given values   calculate:

  • length of major axis
  • length of minor axis.

In Figure 1   is any line from origin to ellipse and   is angle between   axis and  

Aim of this section is to calculate   so that length of   is maximum, in which case length of major axis =  

Let   and  

Then   and  

Substitute these values in  

 

Calculate  

 

 

 

 

 

 

For maximum or minimum  

 

 

 

Square both sides, substitute   for   and result is:

  where:

 

 

 

 

An example edit

Let equation of ellipse be:  

# python code
>>> A,B,C = 55,-24,48
>>> a = (+ 4*A*A - 8*A*C + 4*B*B + 4*C*C);a
2500
>>> b = -a;b
-2500
>>> c = B*B;c
576
>>> 
>>> a,b,c = [v/4 for v in (a,b,c)] ; a,b,c
(625.0, -625.0, 144.0)
>>> S = .36
>>> a*S*S + b*S + c
0.0
>>> S = .64
>>> a*S*S + b*S + c
0.0
>>>

The solutions of quadratic equation   are   or  .

Therefore   or  .

From   above:  

# python code
A,B,C,F = 55,-24,48, -2496

t1 = (0.6, 0.8)
dict1 = dict()

for v1 in (t1, t1[::-1]) :
    c1,s1 = v1
    for c in (c1,-c1) :
        for s in (s1,-s1) :
            t = (-F/( A*c*c + B*c*s + C*s*s ))**.5
            if t in dict1 : dict1[t] += ((c,s),)
            else : dict1[t] = ((c,s),)

L1 = [ (v, dict1[v]) for v in sorted([ v for v in dict1 ]) ]

for v in L1 : print (v)

(6.244997998398398, ((0.8, -0.6), (-0.8, 0.6)))
(6.34287855135306,  ((0.6, -0.8), (-0.6, 0.8)))
(7.806247497997998, ((0.8, 0.6), (-0.8, -0.6)))
(7.999999999999999, ((0.6, 0.8), (-0.6, -0.8)))

Minimum value of   Length of minor axis  

Maximum value of   Length of major axis  

Gallery edit

Rates of Change edit

The car jack edit

 
Figure 2: Photo of car jack illustrating horizontal   and vertical   rates of change.

In triangle   to the right:

  • length   inches,
  • length   inches and is horizontal,
  • length   inches and is vertical,
  •  

Point   is moving towards point   at the rate of   inches minute.

Vertical motion edit
 
Figure 3: Curves and values associated with car jack.
When  
When  
When  

At what rate is point   moving upwards:

(a) when  ?

(b) when  ?

(c) when  ?

We have to calculate   when   is given.

 

  (equation of circle)

 

 

 

 

For convenience we'll use the negative value of the square root and say that  

Relative to line  

When   inches minute.

When   inches minute.

When   and   inches minute.

This example highlights the mechanical advantage of this simple but effective tool. When the top of the jack is low, it moves quickly. As the jack takes more and more weight, the top of the jack moves more slowly.

Change of area edit
 
Figure 4: Graph of   and  .

Area of   is maximum when

 

At what rate is the area of   changing when

(i)  ?

(ii)  ?

(iii)  ?

  where   is area of   and   inches   minute.

 

Calculate  

 

 

 

   

When   and area of   is increasing at rate of   square inches/minute.

When   and area of   is decreasing at rate of   square inches/minute.

When     is a maximum of   square inches and  

On the clock edit

 
Figure 5: Image of analog clock showing minute and hour hands at   o'clock.

An old fashion analog clock with American style face (12 hours) keeps accurate time. The length of the minute hand is   inches and the length of the hour hand is   inches.

At what rate is the tip of the minute hand approaching the tip of the hour hand at 3 o'clock?

Let   be distance between the two tips.

The task is to calculate  

  where   is angle subtended by side   at center of clock.

Calculating  

Angular velocity of minute hand   radians/hour.

Angular velocity of hour hand   radians/hour.

  angular velocity of minute hand relative to hour hand   radians/hour.

Calculating  

 

 

 

  inches/hour.

Radar Speed Trap edit

 
Figure 6: Multi-lane highway oriented East-West.
  feet.
  feet.
 .
  mph.

A multi-lane highway is oriented East-West. A vehicle is moving in the inside lane from West to East. A law-enforcement officer with a radar gun is in position 50 feet South of the center of the inside lane. When the vehicle is 200 feet from the radar gun, it shows the vehicle's speed to be 60 mph. What is the actual speed of the vehicle?

Let length  

  where   mph.


The derivative  

 


  mph.

On the Water edit

A ship is at sea   nautical miles East and   nautical miles South of a lighthouse, and the ship is steaming South-West at   nautical miles/hour or   knots.

At what rate is ship approaching lighthouse?

  knots.

  knots.

 
Figure 1: Diagram indicating position, course and speed of ship relative to lighthouse.
 

Calculating  

 

 

 

The   sign indicates that, when   is increasing,   is decreasing.

    knots towards the lighthouse.

Reciprocating engine edit

 
Figure 1: Diagram illustrating mathematical relationship between piston, connecting rod and crankshaft in reciprocating engine.

The diagram illustrates the piston, connecting rod and crankshaft of an internal combustion reciprocating engine.

The connecting rod   is connected to piston on   axis, and to crankshaft at end of   on   axis.

This section analyzes the motion of the piston as the crankshaft rotates through angle   and the piston moves up and down on the   axis.

Position of piston edit
 
Figure 2: Diagram showing position of piston as a function of rotation of crankshaft in reciprocating engine.
Piston moves up and down between   and   inches.
 

 

 

 

 

 

 

 

Code supplied to grapher (without white space) is:

(5)(cos(x)) + ( ((25)((cos(x))^2) + 144 )^(0.5) )

When expressed in this way, it's easy to convert the code to python code:

(5)*(cos(x)) + ( ((25)*((cos(x))**2) + 144 )**(0.5) )

Positions of interest:

Velocity of piston edit
 
Figure 3: Diagram showing velocity of piston as a function of position of piston in reciprocating engine.
Strictly speaking, velocity  
At constant RPM,   is constant. Therefore   is used to illustrate velocity.

Calculation of   by implicit differentiation.

 

 

 

 

 

 

Acceleration of piston edit
 
Figure 4a: Diagram showing acceleration of piston in reciprocating engine.
Negative acceleration has a greater absolute value than the positive, but it does not last as long.

Acceleration introduces the second derivative. While velocity was the first derivative of position with respect to time, acceleration is the first derivative of velocity or the second derivative of position.

From velocity above  

By implicit differentation:

 

 

 

 

 

Substitute for   and   as defined above, and you see the code input to grapher at top of diagram to right.

 
Figure 4b: Diagram showing "irregularities" in the curve of velocity while velocity is increasing.
  axis compressed to illustrate shape of curves.

"Kinks" in the curve:

It is not obvious by looking at the curve of velocity that there are slight irregularities in the curve when velocity is increasing.

However, the irregularities are obvious in the curve of acceleration.

During one revolution of the crankshaft there is less time allocated for negative acceleration than for positive acceleration. Therefore, the maximum absolute value of negative acceleration is greater than the maximum value of positive acceleration.

Minimum and maximum velocity edit
 
Figure 5: Diagram showing positions of maximum velocity of piston in reciprocating engine.
In the first quadrant, from   to   the piston moves through   inches.
In the second quadrant, from   to   the piston moves through   inches.
Therefore, in the first quadrant, acceleration must be greater than in the second quadrant.

Velocity is rate of change of position. See also Figure 3 above.


Minimum velocity:

Velocity is zero when slope of curve of position is zero. This occurs at top dead center and at bottom dead center, ie, when   and  


Maximum velocity:

Intuition suggests that the position of maximum velocity might be the point at which the connecting rod is tangent to the circle of the crankshaft. In other words:

 

or, that the position of maximum velocity might be the point at which the piston is half-way between top dead center and bottom dead center. In other words:

 


However, velocity is maximum when acceleration is   which occurs when  

Suppose that the engine is rotating at   radians/second or approx.   RPM.

 

abs  inches/second or approx.   mph.

Minimum and maximum acceleration edit
 
Figure 6: Diagram showing positions of minimum and maximum acceleration of piston in reciprocating engine.

Acceleration is rate of change of velocity. See also Figures 4a and 4b above.


Minimum acceleration:

Acceleration is zero when slope of curve of velocity is zero. This occurs at maximum velocity or when   is approx.  


Maximum acceleration:

Acceleration is maximum when slope of curve of velocity is maximum.

Maximum negative acceleration occurs when slope of curve of velocity is maximum negative. This happens at top dead center when  

Maximum positive acceleration occurs when slope of curve of velocity is maximum positive. This happens before and after bottom dead center when   is approx.  


Let the engine continue to rotate at   radians/second.

 

abs  inches/second  or approx.   times the acceleration due to terrestrial gravity.

This maximum value of acceleration is maximum negative when  


According to Newtonian physics  , force = mass*acceleration, and  , work = force*distance. In this engine energy expended in just accelerating piston to maximum velocity is proportional to rpm .

Perhaps this helps to explain why a big marine diesel engine rotating at low RPM can achieve efficiency of  

Simple laws of motion edit

Let a body move in accordance with the following function of   where   means time:

  where   is position at time  

  has the dimension of length. Therefore, each component of   must have the dimension of length.

For   to have the dimension of length,   must have the dimensions of   or velocity.

For   to have the dimension of length,   must have the dimensions of   or acceleration.

If   and  

The derivatives enable us to assign specific values to  

  where   is velocity at time  

If   and  

  a constant equal to the acceleration to which the body is subjected.

For convenience let us say that   where   is the (constant) acceleration to which the body is subjected.

Then   and  


Go to the School of Mathematics