1.5 Calculus: one variable
Differentiation
Let f be a function of a single variable defined on an open interval. This function is differentiable at the point a if it has a well-defined tangent at a. Its derivative at a, denoted f'(a), is the slope of this tangent.Precisely, consider “secant lines” like the one from (a, f(a)) to (a + h, f(a + h)) in the following figure.
Such a line has slope (f(a + h) − f(a))/h. The derivative of f at a is defined to be the limit, if it exists, of this slope as h decreases to zero.
- Definition
-
Let I be an open interval, let f be a function of a single variable defined on I, and let a be a point in I. The function f is differentiable at a if
limh→0 f(a + h) − f(a) h If f is differentiable at every point in I then it is differentiable on I and the function f' is its derivative.
Note also that the definition applies only to functions defined on open intervals.
The graph of a function differentiable at a is “smooth” at a. In particular, a function that is differentiable at a is definitely continuous at a.
- Proposition 1.5.1
- If the function f of a single variable defined on an open interval I is differentiable at the point a in I then it is continuous at a.
- Proof
- We need to show that limh→0 f(a + h) − f(a) = 0. Write f(a + h) − f(a) as (f(a + h) − f(a))/h · h. Then limh→0 f(a + h) − f(a) = limh→0 (f(a + h) − f(a))/h · limh→0 h = f'(a) · 0 = 0.
The function f in the figure is not differentiable at a, because the slope of the secant line from (a, f(a)) to (a + h, f(a + h)) is very different for h > 0 and for h < 0, even when h is arbitrarily small, as shown in the following two figures. Thus limh→0(f(a + h) − f(a))/h does not exist: there is no number k such that for all h close enough to 0 the slope a secant line through (a, f(a)) and (a + h, f(a + h)) is close to k.
At any point at which a function has such a “kink”, the function is not differentiable.
The derivative of f at a is sometimes denoted (df/dx)(a) rather than f'(a) (although the latter is more compact, more elegant, and more precise).
Rules for differentiation
The definition of a derivative implies the following formulas for the derivative of specific functions, where a and k are constants.
f(x) | f'(x) | |
k | 0 | |
kxn | knxn−1 | |
ln x | 1/x | |
ex | ex | |
ax | axln a | |
cos x | −sin x | |
sin x | cos x | |
tan x | 1 + (tan x)2 |
Here are three (very important!) general rules.
- Sum rule
- If F(x) = f(x) + g(x) then F'(x) = f'(x) + g'(x)
- Product rule
- If F(x) = f(x)g(x) then F'(x) = f'(x)g(x) + f(x)g'(x)
- Quotient rule
- If F(x) = f(x)/g(x) then F'(x) = [f'(x)g(x) − f(x)g'(x)]/(g(x))2.
- Example 1.5.1
- Let F(x) = x2 + ln x. By the sum rule, F'(x) = 2x + 1/x.
- Example 1.5.2
- Let F(x) = x2ln x. By the product rule, F'(x) = 2xln x + x2/x = 2xln x + x.
- Example 1.5.3
- Let F(x) = x2/ln x. By the quotient rule, F'(x) = [2xln x − x2/x]/(ln x)2 = [2xln x − x]/(ln x)2.
Second derivatives
If the function f is differentiable at every point in some open interval I then its derivative f' may itself be differentiable at points in this interval.- Definition
- Let f be a function of a single variable defined on an open interval I. If the derivative f' of f is differentiable then we say f is twice-differentiable and call the derivative of f', which we denote f", the second derivative of f.
- Example 1.5.4
- Let f(x) = x2 for x ≤ 0 and f(x) = 0 for x > 0. Then f is differentiable, with f'(x) = 2x for x ≤ 0 and f'(x) = 0 for x > 0. The derivative f' is continuous, but has a kink at 0, so f' is not differentiable at 0, and thus f is not twice-differentiable at 0.
Integration
Let f be a function of a single variable on the domain [a, b]. The (“definite”) integral of f from a to b, denotedaf(x)dx,
How exactly can we define the area under the graph of a function? Let's approximate the area with a shape whose area we know how to calculate. First choose some points x1, x2, ..., xn in [a, b] with a = x1 < x2 < ... < xn = b. We're going to refer to such collections of points repeatedly, so let's give them a name.
- Definition
- A partition of the interval [a, b] is a list (x1, x2, ..., xn) of numbers with a = x1 < x2 < ... < xn = b.
The area under the graph of m consists of a collection of rectangles, whose areas we know: it is
i=1mi(xi+1 − xi)
- Definition
-
Let f be a function of a single variable defined on the interval [a, b] and let (x1, ..., xn) be a partition of [a, b]. For i = 1, ..., n−1 let
mi be the largest number such that f(x) ≥ mi for all x in the interval [xi, xi+1]. The lower sum of f for
(x1, ..., xn) is
∑n−1 .
i=1mi(xi+1 − xi)
For the partition (x1, ..., x8) shown in the figure, the function m is not a very good approximation for the function f; the area under the graph of m is not very close to the area under the graph of f. But if we make the partition finer, the difference between the two areas diminishes, as the next figure illustrates.
Before we think about the limit of the areas as we make the partitions finer, consider another approximation to the area under the graph of f. The function m we have constructed lies everywhere below or on the function. We can alternatively approximate f by a function M that lies everywhere above or on the function, as illustrated in the next figure.
The analogue of the lower sum for M is called the “upper sum”.
- Definition
-
Let f be a function of a single variable defined on the interval [a, b] and let (x1, ..., xn) be a partition of [a, b]. For i = 1, ..., n−1, let
Mi be the smallest number such that f(x) ≤ Mi for all x in the interval [xi, xi+1]. The upper sum of f for
(x1, ..., xn) is
∑i=1n−1Mi(xi+1 − xi) .
- Definition
-
Let f be a function of a single variable defined on the interval [a, b]. Let M be the smallest number such that the lower sum of f for P is at most M for every partition P of [a, b] and let m be
the largest number such that the upper sum of f for P is at least m for every partition P of [a, b]. Then f is integrable if M = m, and the common value is the definite integral of
f from a to b, denoted
∫b
a f(x) dx.
- Proposition 1.5.2 source
- Every continuous function of a single variable is integrable.
Note that the variable x in the expression for a definite integral is a dummy variable, and can be replaced by any other variable. Sometimes it is dropped entirely, and the integral is written simply as ∫b
af.
Fundamental theorem of calculus
Let f be an integrable function of a single variable defined on the interval [a, b]. Define the function F on [a, b] by F(x) = ∫xaf(z)dz. How does the value of F change as x increases? An increase in x by a small amount ε adds an area almost equal to a narrow rectangle of height f(x) to the area under f. Thus the rate of increase in the area, for ε small, is close to f(x). This argument suggests that the derivative of F at x is f(x). The following result states this conclusion precisely.
- Proposition 1.5.3 (Fundamental theorem of calculus) source
-
Let f be an integrable function of a single variable defined on the interval [a, b]. Define the function F of a single variable on [a, b] by
F(x) = ∫xIf f is continuous at the point c in [a, b], then F is differentiable at c and
af(z)dz.F'(c) = f(c).Similarly, define the function G on [a, b] byG(x) = ∫bIf f is continuous at the point c in [a, b], then G is differentiable at c and
xf(z)dz.G'(c) = −f(c).If f is integrable on [a, b] and f = H' for some function H, then∫b
af(z)dz = H(b) − H(a).
Antiderivatives and indefinite integration
The function H in the last part of this result is an “antiderivative” of f: a function whose derivative is f. (Some authors use the term “primitive” instead of “antiderivative”.)
- Definition
- Let f be a function of a single variable. An antiderivative of f is a function F for which F'(x) = f(x) for all x in the domain of f.
As an example, an antiderivative of the function 2x is the function x2. But x2 is not the only antiderivative of 2x: for any number c, the function x2 + c is an antiderivative, and in fact every antiderivative of 2x has this form. In general, if F is an antiderivative of f, then the function G is an antiderivative of f if and only if for some number c we have G(x) = F(x) + c for all x.
We refer to the set of all antiderivatives of a function f as the “indefinite integral” of f, which we denote by ∫f(x)dx. (This notation makes sense given the fundamental theorem of calculus.) For example, ∫2x dx = {F: F(x) = x2 + c for some number c, for all x}, which we usually write more briefly as ∫2x dx = x2 + c.
- Definition
-
Let f be a function of a single variable. The indefinite integral of f, denoted
∫f(z)dzor∫fis the set of antiderivatives of f.
For many functions, finding the indefinite integral is not easy. In fact, the indefinite integrals of many functions cannot be written as explicit formulae.
Some indefinite integrals that may be expressed simply are
∫ |
|
dx = (1/2)ln (x2 + 1) + c. |
- Proposition 1.5.4 (Integration by parts) proof
-
Let f and g be differentiable functions of a single variable whose derivatives are continuous. Then
∫f(x)g'(x)dx = f(x)g(x) − ∫f'(x)g(x)dx.
- Proof hide
- Define the function h by h(x) = f(x)g(x) for all x. Then by the product rule for differentiation, h'(x) = f'(x)g(x) + f(x)g'(x). Given that the derivatives f' and g' are continuous, h' is continuous and hence integrable. Integrating h' we get h(x) = f(x)g(x) = ∫f'(x)g(x)dx + ∫f(x)g'(x)dx.
- Example 1.5.5
- ∫xexdx = xex − ∫exdx = xex − ex + c. We cannot integrate xex directly, but we can integrate the product of the derivative of x (namely 1) and the integral of ex (namely ex), because that product is simply ex.
af(x)g'(x)dx |
= |
f(b)g(b) − f(a)g(a) − af'(x)g(x)dx. |
- Example 1.5.6
-
Let H be a cumulative probability distribution on [a,b]. That is, H is a nondecreasing function with H(a) = 0 and H(b) = 1. We can find an expression for
∫bby using integration by parts with f(x) = H(x) and g'(x) = 1. We have g(x) = x, so that
aH(x)dx∫b
aH(x)dx= H(b)g(b) − H(a)g(a) − ∫b
aH'(x)x dx∫bNow,
aH(x)dx = b − ∫b
aH'(x)x dx.∫bis the expected value of the distribution, which we can denote EH(x). So we have
aH'(x)x dx∫ban expression that is sometimes useful.
aH(x)dx = b − EH(x),
- Proposition 1.5.5 (Change of variable in integration) proof
-
Let g be a differentiable function of a single variable on the interval [a, b], let f be a function of a single variable on the range of g, and let F be an
antiderivative of f (that is, F' = f). Then
∫f(g(x))g'(x)dx = F(g(x)) + C ∫b
af(g(x))g'(x)dx= F(g(b)) − F(g(a)) = ∫g(b)
g(a)f(y)dy.
- Proof hide
-
Define the function h by h(x) = F(g(x)) for all x. By the chain rule, h'(x) = F'(g(x))g'(x) = f(g(x))g'(x), establishing the first claim.
By a previous result, a continuous function is integrable, so that f and the function k defined by k(x) = f(g(x))g'(x) are both integrable. Then by the fundamental theorem of calculus applied to the function k we have
∫b
af(g(x))g'(x)dx= h(b) − h(a). F(g(b)) − F(g(a)) = ∫g(b)
g(a)f(x)dx.
- Example 1.5.7
-
Consider the problem of finding the indefinite integral
∫rx(sx2 + t)kdx,where r, s, t, and k are constants. Notice that the first term, rx, is proportional to the derivative of sx2 + t. Specifically, if we define g by g(x) = sx2 + t, so that g'(x) = 2sx, and f by f(z) = zk, then the integral is(r/(2s))∫f(g(x))g'(x)dx.By the result, this integral is(r/(2s))(F(g(x)) + C),where F is an antiderivative of f. The antiderivatives of f take the form zk+1/(k+1), so that the indefinite integral is(r/(2s))(1/(k+1))(sx2 + t)k+1 + C.(By differentiating this expression you can verify that it is correct.)
Another way to express this calculation is that we are making the substitution y = sx2 + t, so that dy = 2sx dx, which transforms
∫rx(sx2 + t)kdxto(r/(2s))∫ykdy = (r/(2s))(1/(k+1))yk+1 + C. For the definite integral
∫bwe have
arx(sx2 + t)kdx∫b
arx(sx2 + t)kdx= (r/(2s))∫g(b)
g(a)f(z)dz= (r/(2s))(1/(k+1))[(g(b))k+1 − (g(a))k+1]. (r/(2s))(1/(k + 1))[(s + t)k+1 − tk+1].