Notes for Calculus

Chapter 3 : Differentiation

Author: Kenneth, S.K. Cheng

Table of Contentss)

3.1 Introduction

When we face physical problems, they habitually involve the "rate of change" of one quantity with respect to another.

For example, in a first course on physics, you will encounter the rate of change of distance with respect to time, called velocity, the rate of change of velocity with respect to time, called acceleration, the rate of change of length (of a metal rod, say) with respect to temperature, called the coefficient of linear expansion, the rate of change of mass (of a wire of variable cross section, say) with respect to length, called the linear density. These are all special cases of the general mathematical concept of the rate of change or derivative of a function with respect to its argument.

To see just how the derivative should be defined, we now take a closer look at one of the physical quantities just enumerated:

Example 3.1.1 The velocity of a particle moving along a straight line is given by the function v(t)v(t), where tt is the time. The average velocity of the particle over the time interval [t,t+Δt][t, t + \Delta t] is given by the formula

v(t+Δt)v(t)Δt.\frac{v(t+\Delta t) - v(t)}{\Delta t}.

the instantaneous velocity of the particle at time tt is the limit of the average velocity as Δt\Delta t approaches zero. This limit is called the derivative of v(t)v(t) at tt and is denoted by v(t)v'(t).

3.2 Definition of the Derivative

Definition 3.2.1 Let ff be a function defined on an open interval II containing the point aa. The derivative of ff at aa, denoted by f(a)f'(a), is defined by the formula

f(a)=limΔx0f(a+Δx)f(a)Δx,f'(a) = \lim_{\Delta x \to 0} \frac{f(a + \Delta x) - f(a)}{\Delta x},

provided that this limit exists. The operation leads ff to its derivative is called differentiation. If ff fas a finite derivative at aa, then ff is said to be differentiable at aa. Generally, if ff is differentiable at every point of an interval II, then ff is said to be differentiable on II.

Remark: The quotient f(a+Δx)f(a)Δx\frac{f(a + \Delta x) - f(a)}{\Delta x} is called the difference quotient of ff at aa. It is introduced to measure the average rate of change of ff over the interval [a,a+Δx][a, a + \Delta x].

Remark: . The distinction between ff having a derivative at xx and being differentiable at xx is important. In the first case, f(x)f'(x) may be infinite, but not in the second case.

Example 3.2.1 The constant function f(x)=kf(x) = k is differentiable at every point of its domain, and its derivative is zero at every point. The reason is that

f(x)=limΔx0f(x+Δx)f(x)Δx=limΔx0kkΔx=0.f'(x) = \lim_{\Delta x \to 0} \frac{f(x + \Delta x) - f(x)}{\Delta x} = \lim_{\Delta x \to 0} \frac{k - k}{\Delta x} = 0.

Example 3.2.2 The function f(x)=xf(x) = x is also differentiable at every point of its domain, and its derivative is one at every point. The reason is that

f(x)=limΔx0f(x+Δx)f(x)Δx=limΔx0x+ΔxxΔx=limΔx0ΔxΔx=1.f'(x) = \lim_{\Delta x \to 0} \frac{f(x + \Delta x) - f(x)}{\Delta x} = \lim_{\Delta x \to 0} \frac{x + \Delta x - x}{\Delta x} = \lim_{\Delta x \to 0} \frac{\Delta x}{\Delta x} = 1.

Example 3.2.3 Let f(x)=xnf(x) = x^n where nn is a positive integer, then differentiating ff.

Solution: First we have,

f(x)=limΔx0f(x+Δx)f(x)Δx=limΔx0(x+Δx)nxnΔx.f'(x) = \lim_{\Delta x \to 0} \frac{f(x + \Delta x) - f(x)}{\Delta x} = \lim_{\Delta x \to 0} \frac{(x + \Delta x)^n - x^n}{\Delta x}.

Then one may think of using the Binomial Theorem, which results in the following

f(x)=limΔx0xn+nxn1Δx++ΔxnxnΔx=limΔx0nxn1++Δxn1=nxn1.f'(x) = \lim_{\Delta x \to 0} \frac{x^n + nx^{n-1}\Delta x + \cdots + \Delta x^n - x^n}{\Delta x} = \lim_{\Delta x \to 0} nx^{n-1} + \cdots + \Delta x^{n-1} = nx^{n-1}.

Since every term in the limit is zero except the first term, we have f(x)=nxn1f'(x) = nx^{n-1}.

Remark: This is the power rule for differentiation. It is a very useful rule for differentiating polynomials. But one may note that the power is only allowed to be a positive integer, for the cases that the power is a negative integer or a fraction, the power rule is not applicable.

Exercises for this section

  1. A particle moves along a straight line with equation of motion

s(t)=13t33t2+9t+1.s(t) = \frac{1}{3}t^3 - 3t^2 + 9t + 1.

Find the velocity and acceleration of the particle at time tt.

  1. Differentiate the following functions:
    1. f(x)=1xf(x) = \frac{1}{x}
    2. f(x)=x2f(x) = x^2
    3. f(x)=2x+1f(x) = \sqrt{2x+1}

3.3 More about Differentiation

We first think of the following examples:

Example 3.3.1: Differentiate the sinx\sin x and cosx\cos x.

Solution: We have

sin(x)=limΔx0sin(x+Δx)sinxΔx=limΔx0sinxcosΔx+cosxsinΔxsinxΔx=limΔx0sinxcosΔx1Δx+cosxsinΔxΔx=cosx.\begin{aligned} \sin'(x) &= \lim_{\Delta x \to 0} \frac{\sin(x + \Delta x) - \sin x}{\Delta x} \\&= \lim_{\Delta x \to 0} \frac{\sin x \cos \Delta x + \cos x \sin \Delta x - \sin x}{\Delta x} \\ &= \lim_{\Delta x \to 0} \sin x \frac{\cos \Delta x - 1}{\Delta x} + \cos x \frac{\sin \Delta x}{\Delta x} = \cos x. \end{aligned}

Similarly, we have

cos(x)=limΔx0cos(x+Δx)cosxΔx=limΔx0cosxcosΔxsinxsinΔxcosxΔx=limΔx0cosxcosΔx1ΔxsinxsinΔxΔx=sinx.\begin{aligned} \cos'(x) &= \lim_{\Delta x \to 0} \frac{\cos(x + \Delta x) - \cos x}{\Delta x} \\&= \lim_{\Delta x \to 0} \frac{\cos x \cos \Delta x - \sin x \sin \Delta x - \cos x}{\Delta x} \\ &= \lim_{\Delta x \to 0} \cos x \frac{\cos \Delta x - 1}{\Delta x} - \sin x \frac{\sin \Delta x}{\Delta x} = -\sin x. \end{aligned}

Example 3.3.2: Differentiate the function f(x)=exf(x) = e^x.

Solution: We have

f(x)=limΔx0f(x+Δx)f(x)Δx=limΔx0ex+ΔxexΔx=limΔx0exeΔx1Δx=ex.\begin{aligned} f'(x) &= \lim_{\Delta x \to 0} \frac{f(x + \Delta x) - f(x)}{\Delta x} \\&= \lim_{\Delta x \to 0} \frac{e^{x + \Delta x} - e^x}{\Delta x} \\ &= \lim_{\Delta x \to 0} e^x \frac{e^{\Delta x} - 1}{\Delta x} = e^x. \end{aligned}

Remark: The derivative of exe^x is exe^x. This is a very important result, as it shows that the exponential function is its own derivative.

Next, we would like to interpret the relationship between the derivative and continuity.

Theorem 3.3.1: If ff is differentiable at aa, then ff is continuous at aa.

Proof: Since ff is differentiable at aa, we have

f(a)=limΔx0f(a+Δx)f(a)Δx.f'(a) = \lim_{\Delta x \to 0} \frac{f(a + \Delta x) - f(a)}{\Delta x}.

Then we have

limΔx0f(a+Δx)f(a)=limΔx0f(a)Δx=0.\lim_{\Delta x \to 0} f(a + \Delta x) - f(a) = \lim_{\Delta x \to 0} f'(a) \Delta x = 0.

It follows that

limxaf(x)=f(a),\lim_{x \to a} f(x) = f(a),

which means that ff is continuous at aa.

But what about the converse of the theorem? That is, if ff is continuous at aa, is ff differentiable at aa? We would like to make it as your exercise.

Exercises for this section

  1. For what choice of a,ba,b is the function f(x)={x2if x<0,ax+bif x0,f(x) = \begin{cases} x^2 & \text{if } x < 0, \\ ax + b & \text{if } x \geq 0, \end{cases} differentiable at x=0x = 0?
  2. Find the derivatives of the following functions:
    1. f(x)=cos2x+sin2xf(x) = \cos 2x + \sin 2x
    2. f(x)=xsinxf(x) = x\sin x

3.4 Curves and Tangents

Roughly speaking, a curve is a geometric figure which can be drawn without lifting pen from paper. It can be a straight line, a circle, a parabola, or a more complicated figure. The tangent to a curve at a point is a straight line which touches the curve at that point. The slope of the tangent is the derivative of the curve at that point.

Example 3.4.1: The graph of f(x)=sinxxf(x) = \frac{\sin x}{x} is not a curve. The reason is that the function is not defined at x=0x = 0.

Example 3.4.2: The graph of f(x)=1xf(x) = \frac{1}{x} if x>0x > 0 is a curve, but the graph of f(x)=1xf(x) = \frac{1}{x} if x0x \neq 0 is not a curve. The reason is that the function is not continuous at x=0x = 0.

Now let P(x0,y0)P(x_0,y_0) be a fixed point and Q(x,y)Q(x,y) be a variable point on the curve y=f(x)y = f(x). Now the line passing through PP and QQ is called the secant to the curve at QQ. Then let θ\theta be the inclination of the secant to the xx-axis. Then the slope of the secant is tanθ=yy0xx0,\tan \theta = \frac{y - y_0}{x - x_0}, or

tanθ=ΔyΔx\tan \theta = \frac{\Delta y}{\Delta x}

in terms of the increment Δx=xx0\Delta x = x - x_0 and Δy=yy0\Delta y = y - y_0. The slope of the tangent is the limit of the slope of the secant as QQ approaches PP. That is, the slope of the tangent is

To illustrate, one may think of the following figure:

Now suppose the point QQ is moving along the curve y=f(x)y = f(x) and approaches the point PP. More exactly the distance between PP and QQ is

PQ=(Δx)2+(Δy)2.|PQ| = \sqrt{(\Delta x)^2 + (\Delta y)^2}.

approches zero. Then the secant line also varies, rotating about the point PP. If the curve y=f(x)y = f(x) is "well-bahaved" near the point PP, then the limit

m=limQPΔyΔx=limPQ0ΔyΔxm = \lim_{Q \to P} \frac{\Delta y}{\Delta x}= \lim_{|PQ| \to 0} \frac{\Delta y}{\Delta x}

exists (one may note that it might be infinite). The line TT through PP with slope mm is called the tangent to the curve at PP. It follows from theorem that TT is the line

y=m(xx0)+y0.y = m(x - x_0) + y_0.

if mm is finite, and the line x=x0x = x_0 if mm is infinite. Speaking qualitatively, the tangent at PP is the "limiting position" of the secant through PP and QQ as QQ approaches PP.

The following theorem gives the connection between tangents and derivatives.

Theorem 3.4.1: The curve y=f(x)y = f(x) has a tangent TT at the point P(x0,y0)P(x_0,y_0) if and only if the derivative f(x0)f'(x_0) exists. In this case, the slope of the tangent is f(x0)f'(x_0).

Proof: Let QQ be the point (x0+Δx,f(x0+Δx))(x_0+\Delta x, f(x_0+\Delta x)) on the curve. Since y=f(x)y = f(x) is a curve, the function is continuous at x0x_0 which implies that

limΔx0f(x0+Δx)=f(x0).\lim_{\Delta x \to 0} f(x_0 + \Delta x) = f(x_0).

or equivalently

limΔx0f(x0+Δx)f(x0)=limΔx0Δy=0.\lim_{\Delta x \to 0} f(x_0 + \Delta x) - f(x_0) = \lim_{\Delta x \to 0} \Delta y = 0.

Therefore the distance between PP and QQ is

PQ=(Δx)2+(Δy)2|PQ| = \sqrt{(\Delta x)^2 + (\Delta y)^2}

approaches zero as Δx\Delta x approaches zero. Therefore,

limPQ0ΔyΔx\lim_{|PQ| \to 0} \frac{\Delta y}{\Delta x}

exists. This limit is the slope of the tangent at PP. This completes the proof.

Now, time for some simple example.

Example 3.4.3: Find the equation of the tangent to the curve y=x2y = x^2 at the point P(x0,y0)P(x_0,y_0).

Solution: The derivative of y=x2y = x^2 is y=2xy' = 2x. Therefore the slope of the tangent at P(x0,y0)P(x_0,y_0) is 2x02x_0. The equation of the tangent is

yy0=2x0(xx0).y - y_0 = 2x_0(x - x_0).

or equivalently

y=2x0(xx0)+y0.y = 2x_0(x - x_0) + y_0.

Example 3.4.4: For what value of aa are the curves y=f1(x)=1ax2y=f_1(x) = 1-ax^2 and y=f2(x)=x2y=f_2(x) = x^2 orthogonal?

Solution: Solving the equation

1ax2=x2,1- ax^2 = x^2,

we find that the curves intersect at the point (±x0,x02)(\pm x_0, x^2_0), where

x0=11+a.x_0 = \frac{1}{\sqrt{1+a}}.

At these points, the slopes of the tangents to the curves are

m1=f1(±x0)=2a1+am_1 = f'_1(\pm x_0) = \mp \frac{2a}{\sqrt{1+a}}

and

m2=f2(±x0)=±21+am_2 = f'_2(\pm x_0) = \pm \frac{2}{\sqrt{1+a}}

Therefore, the tangents and hence the curves are orthogonal if and only if

m1m2=4a1+a=1,m_1 \cdot m_2 = - \frac{4a}{1+a} = -1,

which implies that a=13a = \frac{1}{3}.

Exercises for this section

  1. Find the tangent to the curves:
    1. y=13x3y = \frac{1}{3}x^3 at the point (1,13)(-1,-\frac{1}{3}).
    2. y=8x2+4y = \frac{8}{x^2+4} at the point (1,1)(1,1).
    3. y=sinxy = \sin x at the point (π,0)(\pi, 0).

3.5 Techniques of Differentiation

After we have discussed derivatives in a theoretical way, we now discuss some techniques of differentiation.

Theorem 3.5.1 (Derivative of sum or difference): If ff and gg are differentiable at xx, then f±gf \pm g is differentiable at xx and

(f±g)(x)=f(x)±g(x).(f \pm g)'(x) = f'(x) \pm g'(x).

One may note that the proof of this theorem is straightforward from the definition of the derivative. We leave it as an exercise.

Corollary 3.5.1: If f1,f2,,fnf_1, f_2, \cdots, f_n are differentiable at xx, then f1±f2±±fnf_1 \pm f_2 \pm \cdots \pm f_n is differentiable at xx and

(f1±f2±±fn)(x)=f1(x)±f2(x)±±fn(x).(f_1 \pm f_2 \pm \cdots \pm f_n)'(x) = f_1'(x) \pm f_2'(x) \pm \cdots \pm f_n'(x).

Theorem 3.5.2 (Derivative of a constant multiple): If ff is differentiable at xx and kk is a constant, then kfkf is differentiable at xx and

(kf)(x)=kf(x).(kf)'(x) = kf'(x).

Theorem 3.5.3 (Derivative of a product): If ff and gg are differentiable at xx, then fgfg is differentiable at xx and

(fg)(x)=f(x)g(x)+f(x)g(x).(fg)'(x) = f'(x)g(x) + f(x)g'(x).

Proof: By definition, we have

(fg)(x)=limΔx0f(x+Δx)g(x+Δx)f(x)g(x)Δx=limΔx0f(x+Δx)g(x+Δx)f(x)g(x+Δx)+f(x)g(x+Δx)f(x)g(x)Δx=limΔx0f(x+Δx)f(x)Δxg(x)+limΔx0f(x)g(x+Δx)g(x)Δx=f(x)g(x)+f(x)g(x).\begin{aligned} (fg)'(x) &= \lim_{\Delta x \to 0} \frac{f(x + \Delta x)g(x + \Delta x) - f(x)g(x)}{\Delta x} \\ &= \lim_{\Delta x \to 0} \frac{f(x + \Delta x)g(x + \Delta x) - f(x)g(x + \Delta x) + f(x)g(x + \Delta x) - f(x)g(x)}{\Delta x} \\ &= \lim_{\Delta x \to 0} \frac{f(x + \Delta x) - f(x)}{\Delta x}g(x) + \lim_{\Delta x \to 0}f(x)\frac{g(x + \Delta x) - g(x)}{\Delta x} \\ &= f'(x)g(x) + f(x)g'(x). \end{aligned}

It completes the proof.

Corollary 3.5.2: If f1,f2,,fnf_1, f_2, \cdots, f_n are differentiable at xx, then f1f2fnf_1f_2\cdots f_n is differentiable at xx and

(f1f2fn)(x)=f1(x)f2(x)fn(x)+f1(x)f2(x)fn(x)++f1(x)f2(x)fn(x).(f_1f_2\cdots f_n)'(x) = f_1'(x)f_2(x)\cdots f_n(x) + f_1(x)f_2'(x)\cdots f_n(x) + \cdots + f_1(x)f_2(x)\cdots f_n'(x).

Example 3.5.1: Differentiate the function f(x)=x2sinxf(x) = x^2 \sin x.

Solution: We have

f(x)=(x2)sinx+x2(sinx)=2xsinx+x2cosx.\begin{aligned} f'(x) &= (x^2)' \sin x + x^2(\sin x)' \\ &= 2x \sin x + x^2 \cos x. \end{aligned}

Theorem 3.5.4 (Derivative of a quotient): If ff and gg are differentiable at xx and g(x)0g(x) \neq 0, then fg\frac{f}{g} is differentiable at xx and

(fg)(x)=f(x)g(x)f(x)g(x)(g(x))2.\left(\frac{f}{g}\right)'(x) = \frac{f'(x)g(x) - f(x)g'(x)}{(g(x))^2}.

Proof: By definition, we have

(fg)(x)=limΔx0f(x+Δx)g(x+Δx)f(x)g(x)Δx=limΔx0f(x+Δx)g(x)f(x)g(x+Δx)g(x+Δx)g(x)Δx=limΔx0f(x+Δx)g(x)f(x)g(x)g(x+Δx)g(x)Δx+limΔx0f(x)g(x)f(x)g(x+Δx)g(x+Δx)g(x)Δx=limΔx0f(x+Δx)f(x)g(x+Δx)Δx+limΔx0g(x)g(x+Δx)g(x+Δx)Δx=f(x)g(x)f(x)g(x)(g(x))2.\begin{aligned} \left(\frac{f}{g}\right)'(x) &= \lim_{\Delta x \to 0} \frac{\frac{f(x + \Delta x)}{g(x + \Delta x)} - \frac{f(x)}{g(x)}}{\Delta x} \\ &= \lim_{\Delta x \to 0} \frac{f(x + \Delta x)g(x) - f(x)g(x + \Delta x)}{g(x + \Delta x)g(x)\Delta x} \\ &= \lim_{\Delta x \to 0} \frac{f(x + \Delta x)g(x) - f(x)g(x)}{g(x + \Delta x)g(x)\Delta x} + \lim_{\Delta x \to 0} \frac{f(x)g(x) - f(x)g(x + \Delta x)}{g(x + \Delta x)g(x)\Delta x} \\ &= \lim_{\Delta x \to 0} \frac{f(x + \Delta x) - f(x)}{g(x + \Delta x)\Delta x} + \lim_{\Delta x \to 0} \frac{g(x) - g(x + \Delta x)}{g(x + \Delta x)\Delta x} \\ &= \frac{f'(x)g(x) - f(x)g'(x)}{(g(x))^2}. \end{aligned}

Example 3.5.2: Differentiate the function f(x)=tanxf(x) = \tan x.

Solution: One may think of f(x)=tanx=sinxcosxf(x) = \tan x = \frac{\sin x}{\cos x}. Then we have

f(x)=cosxcosxsinx(sinx)cos2x=cos2x+sin2xcos2x=1cos2x=sec2x.f'(x) = \frac{\cos x \cos x - \sin x (-\sin x)}{\cos^2 x} = \frac{\cos^2 x + \sin^2 x}{\cos^2 x} = \frac{1}{\cos^2 x} = \sec^2 x.

The following theorem is very useful in the differentiation of composite functions. Composite function might be not familiar to you, briefly speaking, it is a function of a function. Suppose we have two functions f(x)=x2f(x) = x^2 and g(x)=sinxg(x) = \sin x, then the composite function is f(g(x))=sin2xf(g(x)) = \sin^2 x.

Theorem 3.5.5 (Derivative of a composite function): If ff is differentiable at g(x)g(x) and gg is differentiable at xx, then fgf \circ g is differentiable at xx and

(fg)(x)=f(g(x))g(x).(f \circ g)'(x) = f'(g(x))g'(x).

Proof: By definition, we have

(fg)(x)=limΔx0f(g(x+Δx))f(g(x))Δx=limΔx0f(g(x+Δx))f(g(x))g(x+Δx)g(x)g(x+Δx)g(x)Δx=limΔx0f(g(x+Δx))f(g(x))g(x+Δx)g(x)limΔx0g(x+Δx)g(x)Δx=f(g(x))g(x).\begin{aligned} (f \circ g)'(x) &= \lim_{\Delta x \to 0} \frac{f(g(x + \Delta x)) - f(g(x))}{\Delta x} \\ &= \lim_{\Delta x \to 0} \frac{f(g(x + \Delta x)) - f(g(x))}{g(x + \Delta x) - g(x)} \cdot \frac{g(x + \Delta x) - g(x)}{\Delta x} \\ &= \lim_{\Delta x \to 0} \frac{f(g(x + \Delta x)) - f(g(x))}{g(x + \Delta x) - g(x)} \cdot \lim_{\Delta x \to 0} \frac{g(x + \Delta x) - g(x)}{\Delta x} \\ &= f'(g(x))g'(x). \end{aligned}

Remark: One may call the theorem as the chain rule for differentiation. In some books they might give you the notation of the chain rule as

ddxf(g(x))=f(g(x))g(x).\frac{d}{dx} f(g(x)) = f'(g(x))g'(x).

or

dydx=dydududx.\frac{dy}{dx} = \frac{dy}{du} \cdot \frac{du}{dx}.

For a new beginner, it might be a little bit confusing for what is dudu and dydy. But one may think of dydy as the derivative of yy with respect to uu and dudu as the derivative of uu with respect to xx. Then the chain rule is just the product of the two derivatives.

However, students should not mistake the form dydx\frac{dy}{dx} as a fraction. It is not a fraction, but a notation for the derivative of yy with respect to xx. In your further study in mathematics (If you are really interested in), you will know that it is 1-form in differential geometry.

Example 3.5.3: Differentiate the function f(x)=sin(x2)f(x) = \sin(x^2).

Solution: We observe that f(x)=sin(x2)=sin(g(x))f(x) = \sin(x^2) = \sin(g(x)) where g(x)=x2g(x) = x^2. Then we have

f(x)=cos(x2)2x=2xcos(x2).f'(x) = \cos(x^2) \cdot 2x = 2x \cos(x^2).

Example 3.5.4: Differentiate the function f(x)=ex2f(x) = e^{x^2}.

Solution: We observe that f(x)=ex2=eg(x)f(x) = e^{x^2} = e^{g(x)} where g(x)=x2g(x) = x^2. Then we have

f(x)=ex22x=2xex2.f'(x) = e^{x^2} \cdot 2x = 2x e^{x^2}.

Exercises for this section

  1. Differentiate the following:
    1. (xa)(xb)(x-a)(x-b)
    2. 1x2\frac{1}{x^2}
    3. 12x2cosx\frac{1}{2}x^2\cos x
    4. 1x2+1\frac{1}{x^2+1}
    5. sin(sin(sinx))\sin(\sin(\sin x)) (Hint: An extension of the chain rule)
  2. Prove the idenity

    1+x+x2++xn=xn+11x11+x+x^2+\cdots+x^n = \frac{x^{n+1}-1}{x-1}

    where x1x \neq 1. Then differentiate both sides with respect to xx to deduce a formula for the following sum:

    1+2x+3x2++nxn1.1+2x+3x^2+\cdots+nx^{n-1}.

3.6 Differentials. Further Notation

Suppose ff is differentiable at xx. Then the differential of ff at xx is defined by

df(x)=f(x)dx.df(x) = f'(x)dx.

The differential df(x)df(x) is a linear function of dxdx. It is a very useful concept in the study of differential equations. For numerical purposes, we may approximate the increment Δy\Delta y of ff by the differential dydy of ff as

Δydy=f(x)dx.\Delta y \approx dy = f'(x)dx.

Let us consider the following example.

Example 3.6.1: Find the increment Δy\Delta y and the differential dydy of the function y=x2y = x^2 for x=20x = 20 and Δx=0.1\Delta x = 0.1. What is the percentage error in the approximation of Δy\Delta y by dydy?

Solution: We have

Δy=(20.1)2202=(20.1+20)(20.120)=40.10.1=4.01,dy=2200.1=4.\begin{aligned} \Delta y &= (20.1)^2 - 20^2 = (20.1 + 20)(20.1 - 20) = 40.1 \cdot 0.1 = 4.01, \\ dy &= 2 \cdot 20 \cdot 0.1 = 4. \end{aligned}

The percentage error is

4.0144.01×100%=0.25%.\frac{4.01 - 4}{4.01} \times 100\% = 0.25\%.

Remark: The differential dydy is a linear approximation to the increment Δy\Delta y. The percentage error in the approximation is small, which shows that the differential is a good approximation to the increment.

Example 3.6.2: Estimate the value of 16.1\sqrt{16.1}.

Solution: First, we know that f(x)=xf(x) = \sqrt{x} is differentiable at x=16x = 16. Then we have

Δf=x+Δxxdf=(x)Δx=12xΔx.\begin{aligned} \Delta f &= \sqrt{x + \Delta x} - \sqrt{x}\\ df &= (\sqrt{x})' \Delta x = \frac{1}{2\sqrt{x}} \Delta x. \end{aligned}

Then we have

x+Δxx+12xΔx.\sqrt{x+\Delta x} \approx \sqrt{x} + \frac{1}{2\sqrt{x}} \Delta x.

Substitute x=16x = 16 and Δx=0.1\Delta x = 0.1, we have

16.14+1240.1=4.0125.\sqrt{16.1} \approx 4 + \frac{1}{2 \cdot 4} \cdot 0.1 = 4.0125.

Remark: This section is important for a taste of the concept of numerical analysis. In the study of numerical analysis, one may encounter the concept of Taylor series which is a generalization of the concept of differentials.

3.7 Implicit Differentiation

Given an equation F(x,y)=0F(x,y) = 0, we may differentiate the equation with respect to xx to find the derivative of yy with respect to xx. This is called implicit differentiation.

Example 3.7.1: Find yy' if y6yx2=0y^6-y-x^2 = 0.

Solution: Differentiating the equation with respect to xx, we have

6y5dydxdydx2x=0.6y^5 \frac{dy}{dx} - \frac{dy}{dx} - 2x = 0.

Then we have

dydx=2x6y51.\frac{dy}{dx} = \frac{2x}{6y^5 - 1}.

The following is a more practical or real-world example.

Example 3.7.2: A spherical balloon is being inflated so that its radius is increasing at a rate of 0.10.1 cm/s. How fast is the volume of the balloon increasing when the radius is 1010 cm?

Solution: Let rr be the radius of the balloon and VV be the volume of the balloon. Then we have

V=43πr3.V = \frac{4}{3}\pi r^3.

Differentiating the equation with respect to tt, we have

dVdt=4πr2drdt.\frac{dV}{dt} = 4\pi r^2 \frac{dr}{dt}.

Substitute r=10r = 10 and drdt=0.1\frac{dr}{dt} = 0.1, we have

dVdt=4π1020.1=40π.\frac{dV}{dt} = 4\pi \cdot 10^2 \cdot 0.1 = 40\pi.

Therefore the volume of the balloon is increasing at a rate of 40π40\pi cm$^3$/s.

Exercises for this section

  1. Find yy' if
    1. y33y+2ax=0y^3-3y+2ax = 0.
    2. y22xy+b2=0y^2-2xy+b^2=0.
  2. Water is slowly poured at the rate of 3 cm$^3$/s into a conical container of height 10 cm and base radius 5 cm. How fast is the water level rising when the water is 4 cm deep?
  3. A ladder of length 10 m is leaning against a wall. If the foot of the ladder is being pulled away from the wall at the rate of 0.1 m/s, how fast is the top of the ladder sliding down the wall when the foot of the ladder is 6 m away from the wall?

3.8 Higher Derivatives

Let ff be a function defined in an interval II(closed, open or half open, finite or infinte), with endpoints aa and bb (a<ba<b). Then ff is said to be differentiable on II if the derivative f(x)f'(x) exists at every point xx in II which has been dicussed in the previous sections. If ff' is differentiable on II, then the derivative of ff' is called the second derivative of ff and is denoted by ff''. If ff'' is differentiable on II, then the derivative of ff'' is called the third derivative of ff and is denoted by ff'''. In general, the $n$th derivative of ff is denoted by f(n)f^{(n)}.

One may wonder why we have to introduce the concept of higher derivatives. The reason is that the higher derivatives of a function may give us some information about the function. For example, the second derivative of a function may give us the concavity of the function. The third derivative of a function may give us the rate of change of the concavity of the function. The fourth derivative of a function may give us the rate of change of the rate of change of the concavity of the function. And so on.

Example 3.8.1: Find the second derivative of the function f(x)=x3f(x) = x^3.

Solution: We have f(x)=3x2f'(x) = 3x^2. Then we have f(x)=6xf''(x) = 6x.

Example 3.8.2: Find the third derivative of the function f(x)=sinxf(x) = \sin x.

Solution: We have f(x)=cosxf'(x) = \cos x. Then we have f(x)=sinxf''(x) = -\sin x. Finally we have f(x)=cosxf'''(x) = -\cos x.

Example 3.8.3: Evaluate (f(x)g(x))(f(x)g(x))'''

Solution: We have

(f(x)g(x))=((f(x)g(x)))=(f(x)g(x)+f(x)g(x))=(f(x)g(x)+2f(x)g(x)+f(x)g(x))=f(x)g(x)+3f(x)g(x)+3f(x)g(x)+f(x)g(x).\begin{aligned} (f(x)g(x))''' &= ((f(x)g(x))')'' \\ &= (f'(x)g(x) + f(x)g'(x))'' \\ &= (f''(x)g(x) + 2f'(x)g'(x) + f(x)g''(x))' \\ &= f'''(x)g(x) + 3f''(x)g'(x) + 3f'(x)g''(x) + f(x)g'''(x). \end{aligned}

when written out full. The binomial coefficients are used in the expansion of the product of two binomials.

Remark: The Example 3.8.3 is not a coincidence. It is a general rule for the differentiation of the product of two functions. The rule is called the Leibniz rule.

Theorem 3.8.1 (Leibniz rule): If ff and gg are nn times differentiable at xx, then the $n$th derivative of the product f(x)g(x)f(x)g(x) is

(f(x)g(x))(n)=k=0n(nk)f(nk)(x)g(k)(x).(f(x)g(x))^{(n)} = \sum_{k=0}^n \binom{n}{k} f^{(n-k)}(x)g^{(k)}(x).

Proof: We may prove the theorem by induction. Obviously the theorem is true for n=1n = 1. Suppose the theorem is true for n=mn = m. Then we have

(f(x)g(x))(m+1)=[k=0m(mk)f(mk)(x)g(k)(x)]=k=0m(mk)f(m+1k)(x)g(k)(x)+k=0m(mk)f(mk)(x)g(k+1)(x)=k=0m(mk)f(m+1k)(x)g(k)(x)+k=1m+1(mk1)f(m+1k)(x)g(k)(x)=(m0)f(m+1)(x)g(x)+(mm)f(x)g(m+1)(x)+k=1m[(mk)+(mk1)]f(m+1k)(x)g(k)(x)=f(m+1)(x)g(x)+f(x)g(m+1)(x)+k=1m(m+1k)f(m+1k)(x)g(k)(x)=k=0m+1(m+1k)f(m+1k)(x)g(k)(x).\begin{aligned} (f(x)g(x))^{(m+1)} &= \left[ \sum_{k=0}^m \binom{m}{k} f^{(m-k)}(x)g^{(k)}(x) \right]'\\ &= \sum_{k=0}^m \binom{m}{k} f^{(m+1-k)}(x)g^{(k)}(x) + \sum_{k=0}^m \binom{m}{k} f^{(m-k)}(x)g^{(k+1)}(x)\\ &= \sum_{k=0}^m \binom{m}{k} f^{(m+1-k)}(x)g^{(k)}(x) + \sum_{k=1}^{m+1} \binom{m}{k-1} f^{(m+1-k)}(x)g^{(k)}(x)\\ &= \binom{m}{0} f^{(m+1)}(x)g(x) + \binom{m}{m} f(x)g^{(m+1)}(x) + \sum_{k=1}^m \left[ \binom{m}{k} + \binom{m}{k-1} \right] f^{(m+1-k)}(x)g^{(k)}(x)\\ &= f^{(m+1)}(x)g(x) + f(x)g^{(m+1)}(x) + \sum_{k=1}^m \binom{m+1}{k} f^{(m+1-k)}(x)g^{(k)}(x)\\ &= \sum_{k=0}^{m+1} \binom{m+1}{k} f^{(m+1-k)}(x)g^{(k)}(x). \end{aligned}

It completes the proof.

Example 3.8.4: Find the tenth derivative of the function f(x)=x4sinxf(x) = x^4\sin x.

Solution: By Leibniz rule, we have

(f(x)g(x))(10)=k=010(10k)f(10k)(x)g(k)(x)=(100)f(10)(x)g(x)+(101)f(9)(x)g(x)++(1010)f(x)g(10)(x)=x4sinx+40x3cosx+540x2sinx2280xcosx5040sinx.\begin{aligned} (f(x)g(x))^{(10)} &= \sum_{k=0}^{10} \binom{10}{k} f^{(10-k)}(x)g^{(k)}(x)\\ &= \binom{10}{0} f^{(10)}(x)g(x) + \binom{10}{1} f^{(9)}(x)g'(x) + \cdots + \binom{10}{10} f(x)g^{(10)}(x)\\ &= -x^4\sin x + 40x^3\cos x + 540x^2\sin x - 2280x\cos x -5040\sin x. \end{aligned}

Exercises for this section

  1. Find yy'' if
    1. y=sin2xy=\sin^2 x.
    2. y=e6xy=e^{6x}.
    3. y=cosxy=\cos x.
  2. A moving particle has equation of motion s=10+20t5t2s = 10 + 20t – 5t^2. Find the particle’s velocity and acceleration at time t=2t = 2. Does the particle’s acceleration ever change?

3.9 Maxima and Minima

Differentiation can be used to help locate maxima and minima of functions. There are two different uses of the word "maximum" in mathematics. One is the absolute maximum or minimum of a function, which is the largest or smallest value of the function over its entire domain. The other is the local maximum or minimum of a function, which is the largest or smallest value of the function in some neighborhood of a point. The local maximum or minimum is also called the relative maximum or minimum.

Theorem 3.9.1 (First derivative test): If ff is differentiable at x0x_0 and f(x0)=0f'(x_0) = 0, then ff has a local maximum or minimum at x0x_0.

Proof: If f(x0)=0f'(x_0) = 0, then the tangent to the curve y=f(x)y = f(x) at x0x_0 is horizontal. Therefore the curve has a horizontal tangent at x0x_0. This implies that the curve has a local maximum or minimum at x0x_0. This completes the proof.

Remark: The first derivative test is a very useful tool in the study of maxima and minima of functions. The first derivative test is also called the stationary point test. One may also wonder why the first derivative test can only give us the local maximum or minimum of a function. The reason is that the first derivative test can only give us the critical points of a function. The critical points of a function are the points where the derivative of the function is zero or undefined. The critical points of a function are the points where the function may have a local maximum or minimum.

Theorem 3.9.2 (Second derivative test): If ff is twice differentiable at x0x_0 and f(x0)=0f'(x_0) = 0, then

  1. If f(x0)>0f''(x_0) > 0, then ff has a local minimum at x0x_0.
  2. If f(x0)<0f''(x_0) < 0, then ff has a local maximum at x0x_0.
  3. If f(x0)=0f''(x_0) = 0, then the test is inconclusive.
  4. If f(x0)f''(x_0) does not exist, then the test is inconclusive.

Proof: If f(x0)>0f''(x_0) > 0, then the curve y=f(x)y = f(x) is concave up at x0x_0. Therefore the curve has a local minimum at x0x_0. If f(x0)<0f''(x_0) < 0, then the curve y=f(x)y = f(x) is concave down at x0x_0. Therefore the curve has a local maximum at x0x_0. If f(x0)=0f''(x_0) = 0, then the test is inconclusive. If f(x0)f''(x_0) does not exist, then the test is inconclusive. This completes the proof.

Example 3.9.1: Determine the local maximum and minimum of the function f(x)=x33x2+2f(x) = x^3 - 3x^2 + 2.

Solution: We have f(x)=3x26x=3x(x2)f'(x) = 3x^2 - 6x = 3x(x-2). Therefore f(x)=0f'(x) = 0 at x=0x = 0 and x=2x = 2. Then we have f(x)=6x6f''(x) = 6x - 6. Therefore f(0)=6f''(0) = -6 and f(2)=6f''(2) = 6. Therefore ff has a local maximum at x=0x = 0 and a local minimum at x=2x = 2.

Example 3.9.2: Determine the local maximum and minimum of the function f(x)=sinxf(x) = \sin x.

Solution: We have f(x)=cosxf'(x) = \cos x. Therefore f(x)=0f'(x) = 0 at x=π2+nπx = \frac{\pi}{2} + n\pi where nn is an integer. Then we have f(x)=sinxf''(x) = -\sin x. Therefore f(π2+nπ)=1f''\left(\frac{\pi}{2} + n\pi\right) = -1. Therefore ff has a local maximum at x=π2+nπx = \frac{\pi}{2} + n\pi.

3.10 Rolle's Theorem and Further Applications

Let ff be differentiable on the closed interval I=[a,b]I = [a,b] and continuous on the open interval (a,b)(a,b). If f(a)=f(b)=0f(a) = f(b) = 0, suppose that ff is nonzero in at least one point of the open interval (a,b)(a,b). Then arguing heuristically, one may translate the horizontal axis parallel to itself, until it becomes tangent to the graph of ff at some point cc in the open interval (a,b)(a,b). Then the graph of ff will have a horizontal tangent at cc. In this case, the derivative of ff at cc is zero. This is the content of the following theorem.

Theorem 3.9.1 (Rolle's Theorem): If ff is differentiable on the closed interval I=[a,b]I = [a,b] and continuous on the open interval (a,b)(a,b), and f(a)=f(b)=0f(a) = f(b) = 0, then there exists a point cc in the open interval (a,b)(a,b) such that f(c)=0f'(c) = 0.

Proof: Since ff is continuous on the closed interval I=[a,b]I = [a,b], then by the extreme value theorem, ff attains its maximum and minimum values on the interval II. Since f(a)=f(b)=0f(a) = f(b) = 0, then ff attains its maximum and minimum values on the open interval (a,b)(a,b). If ff is nonzero in at least one point of the open interval (a,b)(a,b), then ff attains its maximum and minimum values on the open interval (a,b)(a,b), and hence ff attains its maximum or minimum value at some point cc in the open interval (a,b)(a,b). Since ff attains its maximum or minimum value at cc, then f(c)=0f'(c) = 0. This completes the proof.

To illustrate the theorem, we consider the following figure:

The following example is a typical application of Rolle's theorem.

Example 3.10.1: Given a,b,cRa,b,c \in \mathbb{R}, prove that the equation 4ax3+3bx2+2cx=a+b+c4ax^3+3bx^2 + 2cx = a+b+c has at least one real root between 00 and 11.

Solution: Let f(x)=4ax3+3bx2+2cxabcf(x) = 4ax^3+3bx^2 + 2cx - a-b-c. Then we have f(0)=abcf(0) = -a-b-c and f(1)=4a+3b+2cabc=3a+2b+cf(1) = 4a+3b+2c-a-b-c = 3a+2b+c. One then other hand, if f(x)=ax4+bx3+cx2(a+b+c)xf(x) = ax^4+bx^3+cx^2 - (a+b+c)x, then f(0)=0f(0) = 0 and f(1)=0f(1) = 0. Therefore by Rolle's theorem, there exists a point cc in the open interval (0,1)(0,1) such that f(c)=0f'(c) = 0. Therefore 4ac3+3bc2+2c2(a+b+c)=04ac^3+3bc^2+2c^2 - (a+b+c) = 0. This completes the proof.

Remark: The proof of Example 3.10.1 is a typical application of Rolle's theorem. One may wonder why the equation 4ax3+3bx2+2cx=a+b+c4ax^3+3bx^2 + 2cx = a+b+c has at least one real root between 00 and 11. The reason is that the equation 4ax3+3bx2+2cx=a+b+c4ax^3+3bx^2 + 2cx = a+b+c is a cubic equation. The cubic equation has at least one real root. The proof of Example 3.10.1 is a typical application of Rolle's theorem.

After what we have learned about Rolle's theorem, one may wonder what if f(a),f(b)f(a), f(b) be any real numbers. The slope of the secant line to the graph of ff at the points (a,f(a))(a,f(a)) and (b,f(b))(b,f(b)) is f(b)f(a)ba\frac{f(b)-f(a)}{b-a}. The slope of the tangent line to the graph of ff at some point cc in the open interval (a,b)(a,b) is f(c)f'(c). If the slope of the secant line is equal to the slope of the tangent line, then the graph of ff will have a tangent line at some point cc in the open interval (a,b)(a,b). This is the content of the following theorem.

Theorem 3.10.2 (Lagrange Mean Value Theorem): If ff is differentiable on the closed interval I=[a,b]I = [a,b] and continuous on the open interval (a,b)(a,b), then there exists a point cc in the open interval (a,b)(a,b) such that

f(c)=f(b)f(a)ba.f'(c) = \frac{f(b)-f(a)}{b-a}.

Proof: The proof is a constructive proof. Let g(x)=f(x)f(b)f(a)baxg(x) = f(x) - \frac{f(b)-f(a)}{b-a}x. Then g(a)=f(a)g(a) = f(a) and g(b)=f(b)g(b) = f(b). Since gg is continuous on the closed interval I=[a,b]I = [a,b] and differentiable on the open interval (a,b)(a,b), then by Rolle's theorem, there exists a point cc in the open interval (a,b)(a,b) such that g(c)=0g'(c) = 0. Therefore f(c)=f(b)f(a)baf'(c) = \frac{f(b)-f(a)}{b-a}. This completes the proof.

Remark: In order not to confuse with the Cauchy Mean Value Theorem, one may call the theorem as the Lagrange Mean Value Theorem. The Lagrange Mean Value Theorem is a very useful tool in the study of the mean value of a function. The Lagrange Mean Value Theorem is also called the mean value theorem.

Lagrange Mean Value Theorem is a very useful tool in the study of the mean value of a function. We may encounter a real-world example of the Lagrange Mean Value Theorem in the study of the average velocity of a moving particle. One typical example is about determining whether the driver of a car has exceeded the speed limit. The average velocity of a moving particle is the total displacement of the particle divided by the total time taken. The average velocity of a moving particle is the slope of the secant line to the graph of the position function of the particle at the initial and final points. The instantaneous velocity of a moving particle is the slope of the tangent line to the graph of the position function of the particle at some point. If the average velocity of a moving particle is equal to the instantaneous velocity of the particle at some point, then the driver of the car has not exceeded the speed limit. This is the content of the following example.

Example 3.10.2: A car travels along a straight road. The position of the car at time tt is given by s(t)=t36t2+9t+3s(t) = t^3 - 6t^2 + 9t + 3. Determine whether the driver of the car has exceeded the speed limit at time t=3t = 3 where the speed limit is 6060 km/h.

Solution: The velocity of the car at time tt is given by v(t)=s(t)=3t212t+9v(t) = s'(t) = 3t^2 - 12t + 9. The average velocity of the car from time t=0t = 0 to time t=3t = 3 is given by

s(3)s(0)30=33632+93+303=9.\frac{s(3) - s(0)}{3-0} = \frac{3^3 - 6 \cdot 3^2 + 9 \cdot 3 + 3 - 0}{3} = 9.

The instantaneous velocity of the car at time t=3t = 3 is given by v(3)=332123+9=0v(3) = 3 \cdot 3^2 - 12 \cdot 3 + 9 = 0. Therefore by the Lagrange Mean Value Theorem, there exists a point cc in the open interval (0,3)(0,3) such that v(c)=s(3)s(0)30v(c) = \frac{s(3) - s(0)}{3-0}. Therefore the driver of the car has not exceeded the speed limit at time t=3t = 3.

After we have discussed the Lagrange Mean Value Theorem, then we may also dicuss the Cauchy Mean Value Theorem. The Cauchy Mean Value Theorem is a generalization of the Lagrange Mean Value Theorem. The Cauchy Mean Value Theorem is a very useful tool in the study of the mean value of a function. The Cauchy Mean Value Theorem is also called the generalized mean value theorem.

Theorem 3.10.3 (Cauchy Mean Value Theorem): If ff and gg are differentiable on the closed interval I=[a,b]I = [a,b] and continuous on the open interval (a,b)(a,b), then there exists a point cc in the open interval (a,b)(a,b) such that

(f(b)f(a))g(c)=(g(b)g(a))f(c).(f(b)-f(a))g'(c) = (g(b)-g(a))f'(c).

or equivalently

f(b)f(a)g(b)g(a)=f(c)g(c).\frac{f(b)-f(a)}{g(b)-g(a)} = \frac{f'(c)}{g'(c)}.

Proof: Let h(x)=(f(b)f(a))g(x)(g(b)g(a))f(x)h(x) = (f(b)-f(a))g(x) - (g(b)-g(a))f(x). Then h(a)=h(b)=0h(a) = h(b) = 0. Since hh is continuous on the closed interval I=[a,b]I = [a,b] and differentiable on the open interval (a,b)(a,b), then by Rolle's theorem, there exists a point cc in the open interval (a,b)(a,b) such that h(c)=0h'(c) = 0. Therefore f(c)(f(b)f(a))=g(c)(g(b)g(a))f'(c)(f(b)-f(a)) = g'(c)(g(b)-g(a)). This completes the proof.

Remark: The proof of the Cauchy Mean Value Theorem is also a constructive proof. The Cauchy Mean Value Theorem is an extension of the Lagrange Mean Value Theorem, which can also allow us to discuss the L'Hospital's rule.

Theorem 3.10.4 (L'Hospital's rule): If limxaf(x)=limxag(x)=0\lim_{x \to a} f(x) = \lim_{x \to a} g(x) = 0 or limxaf(x)=±\lim_{x \to a} f(x) = \pm \infty and limxag(x)=±\lim_{x \to a} g(x) = \pm \infty, then

limxaf(x)g(x)=limxaf(x)g(x).\lim_{x \to a} \frac{f(x)}{g(x)} = \lim_{x \to a} \frac{f'(x)}{g'(x)}.

Remark: The proof for L'Hospital's rule is a direct application of the Cauchy Mean Value Theorem which you may encounter in your further study in mathematics. L'Hospital's rule is a very useful tool in the study of the limit of a function, especially when the limit of the function is in the form of 00\frac{0}{0} or \frac{\infty}{\infty}.

Exercises for this section

  1. Prove that the equation x33x+1=0x^3 - 3x + 1 = 0 has exactly one real root.
  2. Find the limit for the following functions:
    1. limx0sinxx\lim_{x \to 0} \frac{\sin x}{x}.
    2. limx01cosxx\lim_{x \to 0} \frac{1-\cos x}{x}.
    3. limx0ex1x\lim_{x \to 0} \frac{e^x-1}{x}.
    4. limx0ln(1+x)x\lim_{x \to 0} \frac{\ln(1+x)}{x}.

3.11 Applications

Now, we have acquired the basic knowledge of differentiation. We may now apply the concept of differentiation to solve some real-world problems. The following are some applications of differentiation.

  1. Optimization: The concept of differentiation can be used to find the maximum or minimum value of a function. The maximum or minimum value of a function is called the optimal value of the function. The optimal value of a function is very useful in the study of optimization problems. The optimization problems are very useful in the study of economics, engineering, physics, and other fields of study.
  2. Related Rates: The concept of differentiation can be used to find the rate of change of a function with respect to another function. The rate of change of a function with respect to another function is called the related rate of the function. The related rate of a function is very useful in the study of physics, engineering, and other fields of study.
  3. Linear Approximation: The concept of differentiation can be used to find the linear approximation of a function. The linear approximation of a function is a linear function that approximates the function at some point. The linear approximation of a function is very useful in the study of numerical analysis.
  4. Antiderivatives: The concept of differentiation can be used to find the antiderivative of a function. The antiderivative of a function is the reverse process of differentiation. The antiderivative of a function is very useful in the study of integral calculus.

These are the topics we will (try to) cover in the future, but now we will try to tackle with the basic applications of differentiation.

Example 3.11.1: What is the maximum area of a rectangle with a perimeter of 100100 m?

Solution: Let xx be the length of the rectangle and yy be the width of the rectangle. Then we have 2x+2y=1002x + 2y = 100. Therefore x+y=50x + y = 50. The area of the rectangle is A=xyA = xy. Then we have y=50xy = 50 - x. Therefore A=x(50x)=50xx2A = x(50-x) = 50x - x^2. Then we have A=502xA' = 50 - 2x which implies that A=0A' = 0 at x=25x = 25. We have A=2A'' = -2 and A(25)=2<0A''(25) = -2 < 0, it follows that the area of the rectangle is maximized when the length of the rectangle is 2525 m and the width of the rectangle is 2525 m. The maximum area of the rectangle is 625625 m$^2$.

Example 3.11.2: A ladder of length 1010 m is leaning against a wall. If the foot of the ladder is being pulled away from the wall at the rate of 0.10.1 m/s, how fast is the top of the ladder sliding down the wall when the foot of the ladder is 66 m away from the wall?

Solution: Let xx be the distance of the foot of the ladder from the wall and yy be the height of the ladder on the wall. Then we have x2+y2=102x^2 + y^2 = 10^2. Differentiating the equation with respect to tt, we have 2xdxdt+2ydydt=02x\frac{dx}{dt} + 2y\frac{dy}{dt} = 0. Substitute x=6x = 6 and dxdt=0.1\frac{dx}{dt} = 0.1, we have 260.1+2ydydt=02 \cdot 6 \cdot 0.1 + 2y\frac{dy}{dt} = 0. Therefore dydt=0.01\frac{dy}{dt} = -0.01 m/s. Therefore the top of the ladder is sliding down the wall at the rate of 0.010.01 m/s.

Exercises for this section

  1. Among all rectangles of given area AA, show that the square has the smallest perimeter.
  2. Find the right triangle of greatest area, given that the sum of one leg of the triangle and the hypotenuse is a constant.

3.12 Antiderivatives

The concept of antiderivatives is the reverse process of differentiation. Suppose FF is a function defined on an interval II. If ff is the derivative of FF, then FF is called an antiderivative of ff. The antiderivative of a function is not unique. If FF is an antiderivative of ff, then F+CF + C is also an antiderivative of ff for any constant CC. The antiderivative of a function is denoted by f(x)dx\int f(x)dx.

Here we consider some antiderivatives for some elementary functions.

  1. xndx=xn+1n+1+C\int x^n dx = \frac{x^{n+1}}{n+1} + C for n1n \neq -1.
  2. 1xdx=lnx+C\int \frac{1}{x} dx = \ln |x| + C.
  3. exdx=ex+C\int e^x dx = e^x + C.
  4. sinxdx=cosx+C\int \sin x dx = -\cos x + C.
  5. cosxdx=sinx+C\int \cos x dx = \sin x + C.
  6. sec2xdx=tanx+C\int \sec^2 x dx = \tan x + C.
  7. csc2xdx=cotx+C\int \csc^2 x dx = -\cot x + C.

The proof for the above antiderivatives is a direct application of the differentiation of the antiderivatives. The antiderivatives of the elementary functions are very useful in the study of the integral calculus.

Example 3.11.1: Find the antiderivative of the function f(x)=3x26x+2f(x) = 3x^2 - 6x + 2.

Solution: We have

f(x)dx=(3x26x+2)dx=3x2dx6xdx+2dx=3x2dx6xdx+2dx=3x336x22+2x+C=x33x2+2x+C.\begin{aligned} \int f(x)dx &= \int (3x^2 - 6x + 2)dx\\ &= \int 3x^2 dx - \int 6x dx + \int 2 dx\\ &= 3 \int x^2 dx - 6 \int x dx + 2 \int dx\\ &= 3 \cdot \frac{x^3}{3} - 6 \cdot \frac{x^2}{2} + 2 \cdot x + C\\ &= x^3 - 3x^2 + 2x + C. \end{aligned}

We will discuss more about the concept of antiderivatives in the next chapter which is about integration. This section is just a glance of the concept of antiderivatives. The exercises are just for students to think about whether the antiderivatives of the elementary functions are correct.

Exercises for this section

  1. Prove the following:
    1. xndx=xn+1n+1+C\int x^n dx = \frac{x^{n+1}}{n+1} + C for n1n \neq -1.
    2. 1xdx=lnx+C\int \frac{1}{x} dx = \ln |x| + C.
    3. exdx=ex+C\int e^x dx = e^x + C.
    4. sinxdx=cosx+C\int \sin x dx = -\cos x + C.
    5. cosxdx=sinx+C\int \cos x dx = \sin x + C.

3.13 Using Python to Differentiate

In this section, we will use Python to differentiate some functions. We will use the sympy library in Python to differentiate the functions. The sympy library is a very useful library in Python for symbolic mathematics. The sympy library can be used to differentiate the functions symbolically. The following is the code to differentiate the functions symbolically.

import sympy as sp

x = sp.symbols('x') # Define the variable x
f = x**3 - 3*x**2 + 2 # Define the function f(x) = x^3 - 3x^2 + 2
f_prime = sp.diff(f, x) # Differentiate the function f with respect to x
print(f_prime) # Print the derivative of the function f

The above code will differentiate the function f(x)=x33x2+2f(x) = x^3 - 3x^2 + 2 with respect to xx. The output of the code will be 3x26x3x^2 - 6x which is the derivative of the function f(x)=x33x2+2f(x) = x^3 - 3x^2 + 2. Based on the above code, could you think of how to differentiate the function f(x)=sinxf(x) = \sin x with respect to xx?

Since we have also discussed the L'Hospital's rule, we may also use Python to evaluate the limit of a function. The following is the code to evaluate the limit of a function using Python.

import sympy as sp

x = sp.symbols('x') # Define the variable x
f = sp.sin(x)/x # Define the function f(x) = sin(x)/x
limit_f = sp.limit(f, x, 0) # Evaluate the limit of the function f as x approaches 0
print(limit_f) # Print the limit of the function f

Here is another one for the limit where the function is f(x)=xexf(x) = \frac{x}{e^x} where xx approaches \infty.

import sympy as sp

x = sp.symbols('x') # Define the variable x
f = x/sp.exp(x) # Define the function f(x) = x/exp(x)
limit_f = sp.limit(f, x, sp.oo) # Evaluate the limit of the function f as x approaches infinity, we use sp.oo for infinity while negative infinity is -sp.oo
print(limit_f) # Print the limit of the function f

The above code will evaluate the limit of the function f(x)=xexf(x) = \frac{x}{e^x} as xx approaches \infty. The output of the code will be 00 which is the limit of the function f(x)=xexf(x) = \frac{x}{e^x} as xx approaches \infty. Based on the above code, could you think of how to evaluate the limit of the function f(x)=1cosxxf(x) = \frac{1-\cos x}{x} as xx approaches 00?

Now, let us think about antiderivatives. We may also use Python to find the antiderivatives of some functions. The following is the code to find the antiderivatives of some functions using Python.

import sympy as sp

x = sp.symbols('x') # Define the variable x
f = x**3 - 3*x**2 + 2 # Define the function f(x) = x^3 - 3x^2 + 2
F = sp.integrate(f, x) # Find the antiderivative of the function f with respect to x
print(F) # Print the antiderivative of the function f

The above code will find the antiderivative of the function f(x)=x33x2+2f(x) = x^3 - 3x^2 + 2 with respect to xx. The output of the code will be x44x3+2x+C\frac{x^4}{4} - x^3 + 2x + C which is the antiderivative of the function f(x)=x33x2+2f(x) = x^3 - 3x^2 + 2. Based on the above code, could you think of how to find the antiderivative of the function f(x)=sinxf(x) = \sin x with respect to $x?

Exercises for this section

  1. Differentiate the following functions using Python:
    1. f(x)=x33x2+2f(x) = x^3 - 3x^2 + 2.
    2. f(x)=sinxf(x) = \sin x.
    3. f(x)=exf(x) = e^x.
    4. f(x)=cosxf(x) = \cos x.
    5. f(x)=sec2x+csc2xcotxf(x) = \sec^2 x + \csc^2 x \cdot \cot x.
    6. f(x)=1x2+1f(x) = \frac{1}{x^2+1}.
  2. Find the limit of the following functions using Python:
    1. f(x)=sinxxf(x) = \frac{\sin x}{x} as xx approaches 00.
    2. f(x)=x21x1f(x) = \frac{x^2-1}{x-1} as xx approaches 11.
    3. f(x)=ex1xf(x) = \frac{e^x-1}{x} as xx approaches 00.
    4. f(x)=ln(1+x)xf(x) = \frac{\ln(1+x)}{x} as xx approaches 00.
    5. f(x)=2x21x2+1f(x) = \frac{2x^2-1}{x^2+1} as xx approaches \infty.
  3. Find the antiderivative of the following functions using Python:
    1. f(x)=x33x2+2f(x) = x^3 - 3x^2 + 2.
    2. f(x)=sinxcosxf(x) = \sin x \cdot \cos x.
    3. f(x)=e2x+1f(x) = e^{2x+1}.

References

  1. Silverman, Richard A. Modern calculus and analytic geometry. Courier Corporation, 2002.
  2. Neto, Antonio Caminha Muniz. An Excursion through Elementary Mathematics, Volume I: Real Numbers and Functions. Springer, 2017.