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 welldefined 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

The function f of a single variable defined on an open interval I is differentiable at the point a in I if
lim_{h→0} f(a + h) − f(a) h
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
 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 lim_{h→0} f(a + h) − f(a) = 0. Write f(a + h) − f(a) as (f(a + h) − f(a))/h · h. Then lim_{h→0} f(a + h) − f(a) = lim_{h→0} (f(a + h) − f(a))/h · lim_{h→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 lim_{h→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  
kx^{n}  knx^{n−1}  
ln x  1/x  
e^{x}  e^{x}  
a^{x}  a^{x}ln 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
 Let F(x) = x^{2} + ln x. By the sum rule, F'(x) = 2x + 1/x.
 Example
 Let F(x) = x^{2}ln x. By the product rule, F'(x) = 2xln x + x^{2}/x = 2xln x + x.
 Example
 Let F(x) = x^{2}/ln x. By the quotient rule, F'(x) = [2xln x − x^{2}/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 twicedifferentiable and call the derivative of f', which we denote f", the second derivative of f.
 Example
 Let f(x) = x^{2} 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 twicedifferentiable 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 x_{1}, x_{2}, ..., x_{n} in [a, b] with a = x_{1} < x_{2} < ... < x_{n} = 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 (x_{1}, x_{2}, ..., x_{n}) of numbers with a = x_{1} < x_{2} < ... < x_{n} = b.
The area under the graph of m consists of a collection of rectangles, whose areas we know: it is
i=1m_{i}(x_{i+1} − x_{i})
 Definition

Let f be a function of a single variable defined on the interval [a, b] and let (x_{1}, ..., x_{n}) be a partition of [a, b]. For i = 1, ..., n−1 let
m_{i} be the largest number such that f(x) ≥ m_{i} for all x in the interval [x_{i}, x_{i+1}]. The lower sum of f for
(x_{1}, ..., x_{n}) is
∑n−1 .
i=1m_{i}(x_{i+1} − x_{i})
For the partition (x_{1}, ..., x_{8}) 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 (x_{1}, ..., x_{n}) be a partition of [a, b]. For i = 1, ..., n−1, let
M_{i} be the smallest number such that f(x) ≤ M_{i} for all x in the interval [x_{i}, x_{i+1}]. The upper sum of f for
(x_{1}, ..., x_{n}) is
∑_{i=1}^{n−1}M_{i}(x_{i+1} − x_{i}) .
 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 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 (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 x^{2}. But x^{2} is not the only antiderivative of 2x: for any number c, the function x^{2} + 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) = x^{2} + c for some number c, for all x}, which we usually write more briefly as ∫2x dx = x^{2} + 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 (x^{2} + 1) + c. 
 Proposition (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
 ∫xe^{x}dx = xe^{x} − ∫e^{x}dx = xe^{x} − e^{x} + c. We cannot integrate xe^{x} directly, but we can integrate the product of the derivative of x (namely 1) and the integral of e^{x} (namely e^{x}), because that product is simply e^{x}.
af(x)g'(x)dx 
= 
f(b)g(b) − f(a)g(a) − af'(x)g(x)dx. 
 Example

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 E_{H}(x). So we have
aH'(x)x dx∫ban expression that is sometimes useful.
aH(x)dx = b − E_{H}(x),
 Proposition (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

Consider the problem of finding the indefinite integral
∫rx(sx^{2} + t)^{k}dx,where r, s, t, and k are constants. Notice that the first term, rx, is proportional to the derivative of sx^{2} + t. Specifically, if we define g by g(x) = sx^{2} + t, so that g'(x) = 2sx, and f by f(z) = z^{k}, 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 z^{k+1}/(k+1), so that the indefinite integral is(r/(2s))(1/(k+1))(sx^{2} + 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 = sx^{2} + t, so that dy = 2sx dx, which transforms
∫rx(sx^{2} + t)^{k}dxto(r/(2s))∫y^{k}dy = (r/(2s))(1/(k+1))y^{k+1} + C. For the definite integral
∫bwe have
arx(sx^{2} + t)^{k}dx∫b
arx(sx^{2} + t)^{k}dx= (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} − t^{k+1}].