Calculus/Derivatives

From testwiki
Jump to navigation Jump to search

Derivative of a function f at a number a

Notation

We denote the derivative of a function f at a number a as f(a).

Definition

The derivative of a function f at a number a a is given by the following limit (if it exists):
Template:Center topf(a)=limh0f(a+h)f(a)hTemplate:Center bottom
An analagous equation can be defined by letting x=(a+h). Then h=(xa), which shows that when x approaches a, h approaches 0:
Template:Center topf(a)=limxaf(x)f(a)xaTemplate:Center bottom

Interpretations

As the slope of a tangent line

Given a function y=f(x), the derivative f(a) can be understood as the slope of the tangent line to f(x) at x=a:
Template:Center topTemplate:Center bottom

Example

Find the equation of the tangent line to y=x2 at x=1.

Solution

To find the slope of the tangent, we let y=f(x) and use our first definition: Template:Center topf(a)=limh0f(a+h)f(a)hlimh0(a+h)2(a)2hlimh0a2+2ah+h2a2hlimh0h(2a+h)hlimh0(2a+h)Template:Center bottom
It can be seen that as h approaches 0, we are left with f(a)=2a. If we plug in 1 for a:
Template:Center topf(1)=2(1)2Template:Center bottom
So our preliminary equation for the tangent line is y=2x+b. By plugging in our tangent point (1,1) to find b, we can arrive at our final equation:
Template:Center top1=2(1)+b1=bTemplate:Center bottom
So our final equation is y=2x1.

As a rate of change

The derivative of a function f(x) at a number a can be understood as the instantaneous rate of change of f(x) when x=a.

The derivative as a function

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

Notation

Likewise to the derivative of f at a, the derivative of the function f(x) is denoted f(x).

Definition

The derivative of the function f is defined by the following limit:
Template:Center topf(x)=limh0f(x+h)f(x)hTemplate:Center bottom Also, Template:Center topf(x)=limhxf(x)f(h)xhTemplate:Center bottom or Template:Center topf(x)=limh0f(x+h)f(xh)2hTemplate:Center bottom

d(x^n)/dx

Template:RoundBoxTop Consider the sequences:

y=x2; y+Δy=(x+h)2=x2+2xh+h2

y=x3; y+Δy=(x+h)3=x3+3x2h+3xh2+h3

y=x4; y+Δy=(x+h)4=x4+4x3h+6x2h2+4xh3+h4

y=x5; y+Δy=(x+h)5=x5+5x4h+10x3h2+10x2h3+5xh4+h5

y=x6; y+Δy=(x+h)6=x6+6x5h + many terms containing h2

y=xn; y+Δy=(x+Δx)n=xn+nxn1Δx + many terms containing (Δx)2

Δy=nxn1Δx + many terms containing (Δx)2

Therefore:

ΔyΔx=nxn1 + many terms with each and every term containing Δx

dydx=limΔx0ΔyΔx

d(xn)dx=nxn1 read as "derivative with respect to x of x to the power n."

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

Template:RoundBoxBottom

Examples

Template:RoundBoxTop

d(x4)dx=4x(41)=4x3

d(7x5)dx=7d(x5)dx=7(5x4)=35x4

d(p3)dx=d(p3)dpTemplate:Mathdpdx=3p2Template:Mathdpdx

d(2t27T3+x7)dx=4tTemplate:Mathdtdx7(3T2)Template:MathdTdx+7x6

d(x13)dx=13x131=13x23 Template:RoundBoxBottom

Without Using Calculus

Derivative of cubic function

Template:RoundBoxTop

File:0604cubic00.png
Graph of cubic function illustrating use of associated quadratic.
When x==7.5, there is exactly 1 value of x that gives f(x)=f(7.5).
When x==3, there are 3 values of x that give f(x)=f(3).
When x==p, there are exactly 2 values of x that give f(x)=f(p).
Point (p,f(p)) is a stationary point.

In the diagram there is a stationary point at x=p. When x=p, there are exactly 2 values of x that produce f(x)=f(p).

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


See Cubic function as product of linear function and quadratic.

The associated quadratic when x=p:

A=a

B=Ap+b=ap+b

C=Bp+c=app+bp+c.


Divide g(x)=ax2+(ap+b)x+(ap2+bp+c) by (xp).

This division gives a quotient of ax+(2ap+b) and remainder of h(p)=3ap2+2bp+c.

Factor (xp) divides g(x) exactly. Therefore, remainder h(p)=0, the desired condition.

When x=p, h(x)=3ax2+2bx+c, the derivative of f(x). Template:RoundBoxBottom

Derivative of quartic function

Template:RoundBoxTop The quartic function: y=f(x)=ax4+bx3+cx2+dx+e  (1)

In (1) substitute (p+q) for x  (2a).

In (1) substitute (pq) for x  (3a).

(2a)+(3a): +2apppp+12appqq+2aqqqq+2bppp+6bpqq+2cpp+2cqq+2dp+2e  (4)

(2a)(3a): +8apppq+8apqqq+6bppq+2bqqq+4cpq+2dq  (5)

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

+apppp+6appQ+aQQ+bppp+3bpQ+cpp+cQ+dp+e  (4a)

+4appp+4apQ+3bpp+bQ+2cp+d  (5a)

Combine (4a) and (5a) to eliminate p and produce a function in Q: Template:RoundBoxTop C11Q11+C10Q10+C9Q9+  +C2Q2+C1Q+C0 where:

C11=(65536aaaaaaaaaabb)

C10=(131072aaaaaaaaaabd229376aaaaaaaaabbc+94208aaaaaaaabbbb)

C2=(8192aaaaaabdeeee+20480aaaaaacddeee288aabbbccccddd+32aabbccccccdd)

C1=(4096aaaaaaddeeee4096aaaaabcdeeee+64aabbcccccdde20aabbccccdddd)

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)

Template:RoundBoxBottom Coefficient of interest is C0 which is in fact the value RsSr. See Equal Roots of Quartic Function.


If C0==0, q=Q=0 is a solution and f(x) contains at least 2 roots of format p+0,p0. In other words 2 equal roots where x=p.

If Q==0, (4a) and (5a) become:

ap4+bp3+cp2+dp+e  (4b)

4ap3+3bp2+2cp+d  (5b)

(4b) is equivalent to f(x) and (5b) is derivative of (4b). Template:RoundBoxBottom

Product Rule

Let y=uTemplate:Mathv where u=U(x); v=V(x)

y+Δy=(u+Δu)Template:Math(v+Δv)=uTemplate:Mathv+uTemplate:MathΔv+vTemplate:MathΔu+ΔuTemplate:MathΔv

Δy=uTemplate:MathΔv+vTemplate:MathΔu+ΔuTemplate:MathΔv

ΔyΔx=uTemplate:MathΔvΔx+vTemplate:MathΔuΔx+(Δu)(Δv)Δx

dydx=uTemplate:Mathdvdx+vTemplate:Mathdudx

Examples

Template:RoundBoxTop Let y=xmn. Calculate dydx

yn=xm

Differentiate both sides.

nyn1dydx=mxm1

dydx=mxm1nyn1 =mxm1n(xmn)n1 =mxm1nxmmn =mnxm1m+mn =mnxmn1

This shows that d(xn)dx as above is valid when n is a positive fraction. Template:RoundBoxBottom

Template:RoundBoxTop Let y=xn=1xn. Calculate dydx.

yxn=1

Differentiate both sides.

ynxn1+xndydx=0

dydx=ynxn1xn=nxn1xnxn=nxn1x2n=nxn1

This shows that d(xn)dx as above is valid for negative n. Template:RoundBoxBottom

Template:RoundBoxTop Let y=xmn. Calculate dydx.

yn=xm

Differentiate both sides.

nyn1dydx=mxm1

dydx=mxm1nyn1=mxm1n(xmn)n1 =mxm1nxm+mn =mnxm1+mmn =mnxmn1

This shows that d(xn)dx as above is valid when n is a negative fraction. Template:RoundBoxBottom

Quotient rule

Used where y=U(x)V(x)

y=uv

yv=u

yv+vy=u

vy=uyv=uuvv

y=uvuvv2=vuv2uvv2=vuuvv2

Derivatives of trigonometric functions

sine(x)

Template:RoundBoxTop y=sin(x)

y+Δy=sin(x+Δx)=sin(x)cos(Δx)+cos(x)sin(Δx)

Δy=sin(x)cos(Δx)+cos(x)sin(Δx)sin(x)

ΔyΔx=sin(x)Template:Mathcos(Δx)1Δx+cos(x)Template:Mathsin(Δx)Δx

The value cos(Δx)1Δx:

>>> # 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]
>>>

limΔx0cos(Δx)1Δx=limΔx0sin(Δx)1=0 by L'Hôpital's rule.

The value sin(Δx)Δx:

>>> # 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]
>>>

limΔx0sin(Δx)Δx=limΔx0cos(Δx)1=1 by L'Hôpital's rule.

dydx=sin(x)Template:Math0+cos(x)Template:Math1=cos(x)

Proof of 2 limits

Template:RoundBoxTop

File:0603D(sin(theta)).png
Figure 1: limθ0sin(θ)θ:

Area of sector AOB  area of triangle COB.
Area of triangle COB  area of sector COD.

limθ0sin(θ)θ:


In the diagram OA=OB=1. OC=OD=cos(θ). CB=sin(θ).

Let S be the area of a sector of a circle. Then Sπr2=θ2π and S=θr22.

Area of sector COD=θcos2(θ)2.

Area of triangle OCB=sin(θ)cos(θ)2.

Area of sector AOB=θ122=θ2.

Therefore θ2  sin(θ)cos(θ)2  θcos2(θ)2.

θ  sin(θ)cos(θ)  θcos2(θ).

θθcos(θ)  sin(θ)cos(θ)θcos(θ)  θcos2(θ)θcos(θ)

1cos(θ)  sin(θ)θ  cos(θ)

limθ01cos(θ)  limθ0sin(θ)θ  limθ0cos(θ)

1  limθ0sin(θ)θ  1

Therefore limθ0sin(θ)θ=1. Template:RoundBoxBottom

Template:RoundBoxTop limθ0cos(θ)1θ:


cos(θ)1θ =(1)1cos(θ)θ =(1)1cos(θ)θ1+cos(θ)1+cos(θ) =(1)sin(θ)θsin(θ)1+cos(θ)

limθ0cos(θ)1θ =limθ0(1)sin(θ)θsin(θ)1+cos(θ) =(1)limθ0sin(θ)θlimθ0sin(θ)1+cos(θ) =(1)101+1=0. Template:RoundBoxBottom Template:RoundBoxBottom

cosine(x)

y=cos(x)=1sin2(x)

y2=1sin(x)Template:Mathsin(x)

Differentiate both sides:

2yTemplate:Mathdydx=(2sin(x)cos(x))

dydx=sin(x)cos(x)cos(x)=sin(x).

tan(x)

y=tan(x)=sin(x)cos(x)

ycos(x)=sin(x)

Differentiate both sides:

y(sin(x))+cos(x)Template:Mathdydx=cos(x)

cos(x)Template:Mathdydx=cos(x)+ysin(x)

dydx=cos(x)+tan(x)sin(x)cos(x)=1+tan2(x)=sec2(x)

Derivatives of inverse trigonometric functions

arcsine(x)

Template:RoundBoxTop

File:20200207arcsin(x).png
Figure 2: Graph of y=arcsin(x) and associated curves.

y=arcsin(x);x<=1

x=sin(y)

dxdy=cos(y)

dydx=1cos(y)=11sin2(y)=11x2


In the figure to the right you can see that the curves y=arcsin(x), x=sin(y) are the same curve. However curve y=arcsin(x) is limited to π2>=y>=π2.

The derivative dydx=11x2 shows that the slope of y=arcsin(x) is 1 when x=0 and infinite when x=±1. Template:RoundBoxBottom

arccosine(x)

Template:RoundBoxTop

File:20200209arccos(x).png
Figure 3: Graph of y=arccos(x) and associated curves.

y=arccos(x);x<=1

x=cos(y)

dxdy=sin(y)

dydx=1sin(y)=11cos2(y)=11x2

In the figure to the right you can see that the curves y=arccos(x), x=cos(y) are the same curve. However curve y=arccos(x) is limited to π>=y>=0.

The derivative dydx=11x2 shows that the slope of y=arccos(x) is 1 when x=0 and infinite when x=±1. Template:RoundBoxBottom

arctan(x)

Template:RoundBoxTop

File:20200209arctan(x).png
Figure 4: Graph of y=arctan(x) and associated curves.

y=arctan(x)

x=tan(y)

dxdy=sec2(y)

dydx=1sec2(y)=cos2(y)=11+x2

In the figure to the right you can see that the curves y=arctan(x), x=tan(y) are the same curve. However curve y=arctan(x) is limited to π2>y>π2.

The derivative dydx=11+x2 shows that the slope of y=arctan(x) is 1 when x=0 and 0 when x=± Template:RoundBoxBottom

Derivatives of logarithmic functions

a^x or ax

Template:RoundBoxTop y=ax

y+Δy=ax+Δx=axaΔx

Δy=axaΔxax=ax(aΔx1)

ΔyΔx=axaΔx1Δx

Consider the value aΔx1Δx specifically limΔx0aΔx1Δx. L'Hôpital's rule cannot be used here because d(ax)dx is what we are trying to find.

a12=a

(a12)12=a

a123=a

a12n=a taken n times.

We will look at the expression aΔx1Δx for different values of a with Δx=1270=8.5e22 (approx) in which case the expression becomes (a1/2701)*(270) where a1/270 is a70 or a taken 70 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 8=23; 32=25; 128=27. The values v2, v8, v32, v128 are behaving like logarithms. In fact limΔx0aΔx1Δx is the natural logarithm of a written as ln(a).

Template:RoundBoxTop

File:20200206ln(a).png
Figure 5: Graphs of ax1x for a = 2, 8, 32, 128 .

Figure 5 contains graphs of ax1x for a=2, 8, 32, 128 with graph of ex1x included for reference.

All values of x are valid for all curves except where x=0.

Template:RoundBoxBottom

The correct value of ln(2) 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. Template:RoundBoxTop This method for calculation of ln(a) supposes that function sqrt() is available.

Programming language python interprets expression a**b as ab. Therefore, in python, ln(2) 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)
>>>

Template:RoundBoxBottom When y=ax,dydx=axln(a).

The base of natural logarithms is the value of a that gives limΔx0aΔx1Δx=1.

This value of a, usually called e,=2.718281828459045235360287471352662497757247093699959574.....

>>> # 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 a=e,d(ex)dx=exTemplate:Mathln(e)=exTemplate:Math1=ex. Template:RoundBoxBottom

ln(x)

y=ln(x)

x=ey

dxdy=ey

dydx=1ey=1x

Examples

Template:RoundBoxTop y=ln(ax)

dydx=ddxln(ax)=ddx(ln(a)+ln(x))=ddxln(a)+ddxln(x)=1x Template:RoundBoxBottom Template:RoundBoxTop y=ln(xa)

dydx=ddxln(xa)=ddx(aln(x))=addxln(x)=ax Template:RoundBoxBottom Template:RoundBoxTop y=xmn Calculate dydx

yn=xm

nln(y)=mln(x)

n1ydydx=m1x

dydx=m1xyn =mnxmnx =mnxmn1

Careful manipulation of logarithms converts exponents into simple constants. Template:RoundBoxBottom

Chain rule

Used where y=G(H(I(x)))

Examples

Template:RoundBoxTop y=cos(2x)

Let y=cos(u) where u=2x.

dydx=dydududx=sin(u)2=2sin(2x)

Template:RoundBoxBottom Template:RoundBoxTop y=sin2(ln(5x))

Let y=u2 where u=sin(v); v=ln(w); w=5x.

dydx=dydududvdvdwdwdx=2ucos(v)1w5=2sin(v)cos(ln(w))15x5=2sin(ln(w))cos(ln(5x))1x=2sin(ln(5x))cos(ln(5x))1x

Template:RoundBoxBottom

Applications of the Derivative

Shape of curves

The first derivative of f(x)=y or f(x). As shown above, f(x) at any point x1 gives the slope of f(x) at point x1.

f(x1) is the slope of f(x) when x=x1.

Template:RoundBoxTop

File:0422xx x 2.png
Figure 1: Diagram illustrating relationship between f(x)=x2x2and f(x)=2x1.
When x=0.5, both f(x) and slope of f(x)=0.
When x=0, both f(x) and slope of f(x)=1.
When x=1, both f(x) and slope of f(x)=1.
Point (0.5,2.25) is absolute minimum.

In the example to the right, y=f(x)=x2x2 and y=f(x)=2x1.

Of special interest is the point at which f(x) or slope of f(x)=0.

When f(x)=0, x=0.5 and f(x)=0.520.52=2.25.

The point (0.5,2.25) is called a critical point or stationary point of f(x). Because y has exactly one solution for y=0, f(x) has exactly one critical point.

The value of y at point (0.5,2.25) is less than y at both (0,2), (1,2). Therefore the critical point (0.5,2.25) is a minimum of f(x).

In this curve y=x2x2, the point (0.5,2.25) is both local minimum and absolute minimum. Template:RoundBoxBottom

Template:RoundBoxTop

File:0423 2x^3+3x^2-12x-8.png
Figure 1: Diagram illustrating relationship between f(x)=2x3+3x212x88 and f(x)=6x2+6x128.
When x=2 or x=1, both f(x) and slope of f(x)=0.
When x=3, both f(x) and slope of f(x)=3.
When x=1, both f(x) and slope of f(x)=1.5.
When x=2, both f(x) and slope of f(x)=3.
Point (2,1.5) is local maximum.
Point (1,178) is local minimum.

In the example to the right, y=f(x)=2x3+3x212x88 and y=f(x)=6x2+6x128.


Of special interest are the points at which f(x) or slope of f(x)=0.

When f(x)=0, x=2 and f(x)=1.5 or

When f(x)=0, x=1 and f(x)=178.

The points (2,1.5), (1,178) are critical or stationary points of f(x). Because y has exactly two real solutions for y=0, f(x) has exactly two critical points.


Slope of f(x) to the left of (2,1.5) is positive and adjacent slope of f(x) to the right of (2,1.5) is negative. Therefore point (2,1.5) is local maximum. Point (2,1.5) is not absolute maximum.


Adjacent slope of f(x) to the left of (1,178) is negative and slope of f(x) to the right of (1,178) is positive. Therefore point (1,178) is local minimum. Point (1,178) is not absolute minimum. Template:RoundBoxBottom

Maxima and Minima

Electric water heater

Template:RoundBoxTop

File:0304 1150WaterHeater.png
Figure 1(a): Graph of V=f(r) and dVdr for S=100
with y axis compressed.
For maximum V, r=S3π=3.257 and
V=108.578

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 h and let h=Kr where r is the radius and K is a constant.

Surface of cylinder =S=πr2+2πrh=πr2+2πr(Kr)=πr2+2πr2K

Volume of cylinder =V=πr2h=πr2(Kr)=πr3K

K=Sπr22πr2

V=πr3Sπr22πr2=r(Sπr2)2=rSπr32

dVdr=S3πr22

For maximum volume, dVdr=0

Therefore S3πr2=0

S=3πr2; πr2(1+2K)=3πr2; 1+2K=3; K=1.

The height of the cylinder equals the radius. Template:RoundBoxBottom

Square and triangle

Template:RoundBoxTop

File:0224 0145SandT0.png
Figure 1(b): Graph of parabola A=f(s) with y axis compressed.

A square of side h has perimeter Ps=4h and area As=h2.

An equilateral triangle of side s has perimeter Pt=3s and area At=34s2.

Ps+Pt=50.

Total area A=As+At and A must be minimum. What is the value of s?

4h+3s=50

h=503s4

As=h2=(503s4)2 =2500300s+9s216

A=As+At =2500300s+9s216+34s2 =116(2500300s+9s2+43s2)

For minimum A, dAds=0.

300+2(9+43)s=0

(9+43)s=150

s=1509+43 =9.417 Template:RoundBoxBottom

County Road

Template:RoundBoxTop Template:RoundBoxTop

File:0304 1916CountyRoad.png
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 C=(x,30).

Then distance from Town A to point C=x2+302=x2+900.

Distance from Town B to point C=(40x)2+202 =160080x+x2+400 =200080x+x2. Template:RoundBoxBottom Template:RoundBoxTop

File:0305 1504CostOfCtyRoad.png
Figure 1(d): Graphs showing cost of county road (f(x)) and f(x).
Curve showing (f(x)) is actually f(x)10.
Cost is minimum where x=10.523

Cost =5x2+900+2200080x+x2 in units of $100k.

For minimum cost f(x)=0.

5122xx2+900+21280+2x200080x+x2=0

5xx2+900+80+2x200080x+x2=0

5x200080x+x2+(80+2x)x2+900=0 Template:RoundBoxBottom

x=10.52322823517 Template:RoundBoxBottom

Cardboard box

Template:RoundBoxTop Template:RoundBoxTop

File:0307 1747box.png
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 4 ft and width 3 ft 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? Template:RoundBoxBottom

Template:RoundBoxTop

File:0309 1757box.png
Figure 1(f): Curves associated with design of cardboard box.
dVdh=0 and V is maximum when h=7136

2h+l=3

2w+2h=4; w+h=2

V=lwh=(32h)(2h)h=2h37h2+6h

For maximum volume dVdh=6h214h+6=0.

3h27h+3=0

h=7136=6.788 inches. Template:RoundBoxBottom Template:RoundBoxBottom

Solving ellipse at origin

Template:RoundBoxTop

File:0316ellipse01.png
Figure 1: Graph of ellipse showing semi-chord through center.
When length of t is maximum, length of major axis =2t.
When length of t is minimum, length of minor axis =2t.

An ellipse with center at origin has equation: Ax2+Bxy+Cy2+F=0  (1)

Given values A,B,C,F calculate:

  • length of major axis
  • length of minor axis.

In Figure 1 t is any line from origin to ellipse and θ is angle between X axis and t.

Aim of this section is to calculate θ so that length of t is maximum, in which case length of major axis = 2t. Template:RoundBoxTop Let c=cos(θ) and s=sin(θ).

Then x=tcos(θ)=tc, and y=tsin(θ)=ts.

Substitute these values in (1):

Attcc+Bttcs+Cttss+F=0  (2)

Calculate t=dtdθ

A(tt(2cs)+cc2tt)+B(tt(ccss)+cs2tt)+C(tt(2sc)+ss2tt)=0

Att(2cs)+Acc2tt+Btt(ccss)+Bcs2tt+Ctt(2sc)+Css2tt=0

2Attcs+Acc2tt+BttccBttss+Bcs2tt+2Cttsc+2Csstt=0

+Acc2tt+2Bcstt+2Csstt2Attcs+BttccBttss+2Cttsc=0

+t(Acc2t+2Bcst+2Csst)=+2AttcsBttcc+Bttss2Cttsc

t=+2AttcsBttcc+Bttss2Cttsc(Acc2t+2Bcst+2Csst)

For maximum or minimum t:

2AttcsBttcc+Bttss2Cttsc=0

2AcsBcc+Bss2Csc=0

2Acs2Csc=BccBss

Square both sides, substitute 1ss for cc and result is:

aS2+bS+c=0  (3) where:

S=sin2(θ)

a=(+4AA8AC+4BB+4CC)

b=a

c=BB Template:RoundBoxBottom

An example

Template:RoundBoxTop Let equation of ellipse be: 55x224xy+48y22496=0

# 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 (3) are .36 or .64.

Therefore sin(θ)=±0.6 or sin(θ)=±0.8.

From (2) above: t=FAcc+Bcs+Css Template:RoundBoxTop

# 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)

Template:RoundBoxBottom Template:RoundBoxTop

(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)))

Template:RoundBoxBottom Minimum value of t=6.244997998398398. Length of minor axis =2*6.244997998398398

Maximum value of t=7.999999999999999. Length of major axis =8*2

Template:RoundBoxTop

Template:RoundBoxBottom Template:RoundBoxBottom Template:RoundBoxBottom

Rates of Change

The car jack

Template:RoundBoxTop Template:RoundBoxTop

File:0216 0705Carjack1.png
Figure 2: Photo of car jack illustrating horizontal (BC) and vertical (CA) rates of change.

In triangle ABC to the right:

  • length AB=10 inches,
  • length BC=x inches and is horizontal,
  • length CA=y inches and is vertical,
  • ABC=θ.

Point B is moving towards point C at the rate of 5 inches/minute. Template:RoundBoxBottom

Vertical motion

Template:RoundBoxTop

File:0216 0901CarJack3.png
Figure 3: Curves and values associated with car jack.
When x=1, dydx=0.1
When θ=45, dydx=1
When x=9, dydx=2.06

At what rate is point A moving upwards:

(a) when x=9?

(b) when x=1?

(c) when θ=45?

We have to calculate dydt when dxdt is given.

dydt=dydxdxdt

x2+y2=102 (equation of circle)

y=100x2

y2=100x2

2ydydx=2x

dydx=2x2y=x100x2

For convenience we'll use the negative value of the square root and say that dydx=x100x2.

Relative to line BC:

When x=9, dydx=2.06, dydt=2.065=10.3 inches/minute.

When x=1, dydx=0.1, dydt=0.15=0.5 inches/minute.

When θ=45,x=10cos45=7.071 and dydt=15=5 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. Template:RoundBoxBottom

Change of area

Template:RoundBoxTop

File:0220 1007CarJack4.png
Figure 4: Graph of a and dadx.

Area of ΔABC is maximum when

b=h=50=10cos(45)

At what rate is the area of ΔABC changing when

(i) x=9?

(ii) x=1?

(iii) θ=45?

dadt=dadxdxdt where a is area of ΔABC and dxdt=5 inches / minute.

a=bh2=xy2=x100x22

Calculate dadx:

2a=x100x2

4a2=x2(100x2)=100x2x4

8adadx=200x4x3

dadx=200x4x38a=50xx32a=50xx3x100x2 =50x2100x2

When x=9, dadx=7.11 and area of ΔABC is increasing at rate of (57.11) square inches/minute.

When x=1, dadx=4.92 and area of ΔABC is decreasing at rate of (54.92) square inches/minute.

When θ=45, h=b=x=y=10cos(45)=1022=52,  dadx=0, a is a maximum of 25 square inches and dadt=0. Template:RoundBoxBottom Template:RoundBoxBottom

On the clock

Template:RoundBoxTop

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

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

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

Let a be distance between the two tips.

The task is to calculate dadt.

dadt=dadθdθdt where θ is angle subtended by side a at center of clock.

Template:RoundBoxTop Calculating dθdt:

Angular velocity of minute hand =2π1 radians/hour.

Angular velocity of hour hand =2π12=π6 radians/hour.

dθdt= angular velocity of minute hand relative to hour hand =2ππ6=11π6 radians/hour. Template:RoundBoxBottom

Template:RoundBoxTop Calculating dadθ:

a2=32+42234cosθ=2524cosθ.

2adadθ=24sinθ.

dadθ=24sinθ2a=24sin9025=2410=2.4. Template:RoundBoxBottom

dadt=2.411π6=4.4π inches/hour. Template:RoundBoxBottom

Radar Speed Trap

Template:RoundBoxTop

File:20200314radarSpeedTrap.png
Figure 6: Multi-lane highway oriented East-West.
AB=c=200 feet.
BC=a=50 feet.
AC=b.
dcdt=60 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 AC=b.

dbdt=dbdcdcdt where dcdt=60 mph.


The derivative dbdc:

    b2=c2a2; b=c2a22bdbdc=2cdbdc=2c2b=cc2a2


dbdt=200200250260=61.967 mph. Template:RoundBoxBottom

On the Water

Template:RoundBoxTop A ship is at sea 15 nautical miles East and 8 nautical miles South of a lighthouse, and the ship is steaming South-West at 10 nautical miles/hour or 10 knots.

At what rate is ship approaching lighthouse?

dadt=10 knots.

dcdt=dcdadadt knots. Template:RoundBoxTop

File:0411onTheWater.png
Figure 1: Diagram indicating position, course and speed of ship relative to lighthouse.
BCA=θ.

Calculating dcda:

c2=a2+b22abcosθ

2cdcda=2a2bcosθ

dcda=abcosθc=0.291161615782696

The sign indicates that, when a is increasing, c is decreasing. Template:RoundBoxBottom dcdt=dcda10 =2.91161615782696 knots towards the lighthouse. Template:RoundBoxBottom

Reciprocating engine

Template:RoundBoxTop Template:RoundBoxTop

File:0413reciprocatingEngine.png
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 a is connected to piston on y axis, and to crankshaft at end of c on x axis.

This section analyzes the motion of the piston as the crankshaft rotates through angle x and the piston moves up and down on the y axis. Template:RoundBoxBottom

Position of piston

Template:RoundBoxTop

File:0413positionOfPistonInCylinder.png
Figure 2: Diagram showing position of piston as a function of rotation of crankshaft in reciprocating engine.
Piston moves up and down between 8 and 18 inches.
18y8

a2=y2+c22yccos(x)

y22ccos(x)y+c2a2=0

y22(5)cos(x)y+(5)2(13)2=0

y210cos(x)y144=0

y=10cos(x)+(10cos(x))24(144)2

y=10cos(x)+100(cos(x))2+5762

y=5cos(x)+25(cos(x))2+144 Template:RoundBoxTop 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) )

Template:RoundBoxBottom Positions of interest: Template:RoundBoxTop

Template:RoundBoxBottom Template:RoundBoxBottom

Velocity of piston

Template:RoundBoxTop

File:0413velocityOfPistonInCylinder.png
Figure 3: Diagram showing velocity of piston as a function of position of piston in reciprocating engine.
Strictly speaking, velocity =dydt=dydxdxdt.
At constant RPM, dxdt is constant. Therefore dydx is used to illustrate velocity.

Calculation of dydx by implicit differentiation.

y210cos(x)y144=0

2yy10(cos(x)y+y(sin(x)))=0

2yy10cos(x)y+10sin(x)y=0

yy5cos(x)y=5sin(x)y

y(y5cos(x))=5sin(x)y

y=5sin(x)y5cos(x)y Template:RoundBoxBottom

Acceleration of piston

Template:RoundBoxTop

File:0413accelerationOfPistonInCylinder.png
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 yy5cos(x)y+5sin(x)y=0

By implicit differentation:

yy+yy5(cos(x)y+y(sin(x)))+5(sin(x)y+ycos(x))=0

yy+yy5cos(x)y+5ysin(x)+5sin(x)y+5ycos(x)=0

yy5cos(x)y=(yy+5ysin(x)+5sin(x)y+5ycos(x))

y(y5cos(x))=(yy+10sin(x)y+5ycos(x))

y=yy+10sin(x)y+5ycos(x)5cos(x)y

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

File:0413velocityOfPistonInCylinder(closeup).png
Figure 4b: Diagram showing "irregularities" in the curve of velocity while velocity is increasing.
y 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. Template:RoundBoxBottom Template:RoundBoxBottom

Minimum and maximum velocity

Template:RoundBoxTop

File:0414maxVelocity.png
Figure 5: Diagram showing positions of maximum velocity of piston in reciprocating engine.
In the first quadrant, from x=0 to x=90, the piston moves through 6 inches.
In the second quadrant, from x=90 to x=180, the piston moves through 4 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 x=0 and x=π.


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:

x=arctan(135)=68.96

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:

x=arccos(2.513)=78.9


However, velocity is maximum when acceleration is 0, which occurs when x=±71.26.

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

vmax=yinchesradian100radianssecond

abs(vmax)=5.36(100) inches/second or approx. 30.5 mph. Template:RoundBoxBottom

Minimum and maximum acceleration

Template:RoundBoxTop

File:0625MaxAcc1.png
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 x is approx. ±71.3.


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 x=0.

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


Let the engine continue to rotate at 100 radians/second.

accmax=yinchesradian2100radianssecond100radianssecond

abs(accmax)=6.92*100*100 inches/second 2 or approx. 180 times the acceleration due to terrestrial gravity.

This maximum value of acceleration is maximum negative when x=0.


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

Perhaps this helps to explain why a big marine diesel engine rotating at low RPM can achieve efficiency of 55%. Template:RoundBoxBottom Template:RoundBoxBottom

Simple laws of motion

Template:RoundBoxTop Let a body move in accordance with the following function of t, f(t) where t means time:

pt=f(t)=at2+bt+c where pt is position at time t.

pt has the dimension of length. Therefore, each component of f(t) must have the dimension of length.

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

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

If t==0, p0=c and pt=f(t)=at2+bt+p0.

The derivatives enable us to assign specific values to a, b.

d(pt)dt=f(t)=vt=2at+b where vt is velocity at time t.

If t==0, v0=b and pt=f(t)=at2+v0t+p0.

d(vt)dt=f(t)=2a, a constant equal to the acceleration to which the body is subjected.

For convenience let us say that pt=12at2+v0t+p0 where a is the (constant) acceleration to which the body is subjected.

Then vt=122at+v0=at+v0 and d(vt)dt=a. Template:RoundBoxBottom

Template:Sfoot