Notes for Calculus

Chapter 4: Integration

Author: S.K. Cheng

Table of Contents

4.1 Indefinite Integrals

4.1.1 Antiderivative, Integrand, and Variable of Integration

Recall what we have learned in the previous chapter, we know that the derivative of a function is a function that gives the rate of change of the original function. In this chapter, we will learn the opposite of differentiation.

Given a function f(x)f(x) defined on an interval II, suppose there is a function F(x)F(x) defined in II such that

F(x)=dF(x)dx=f(x)F'(x) = \frac{dF(x)}{dx} = f(x)

for all xx in II. Then, we say that F(x)F(x) is an antiderivative of f(x)f(x) on II. Now, consider finding the antiderivative of a function f(x)=x2f(x) = x^2.

By what we have learned in differentiation, we know that the derivative of x3x^3 is 3x23x^2. Therefore, we can say that 13x3\frac{1}{3}x^3 is an antiderivative of x2x^2. However, one may propose another question: is 13x3+1\frac{1}{3}x^3 + 1 also an antiderivative of x2x^2? The answer is yes, because the derivative of a constant is zero. In other words, the antiderivative of a function is not unique. In general, if F(x)F(x) is an antiderivative of f(x)f(x), then F(x)+CF(x) + C is also an antiderivative of f(x)f(x), where CC is a constant.

Now, we introduce the concept of indefinite integral. The definition is as follows:

Definition 4.1.1 If F(x)F(x) is an antiderivative of f(x)f(x) on an interval II, then the expression F(x)+CF(x)+C involving arbitrary constant CC is called an indefinite integral of f(x)f(x) on II, and is denoted by

f(x)dx=F(x)+C.\int f(x)dx = F(x) + C.

Remark: The symbol \int is called the integral sign, the operation leading from the function f(x)f(x), called integrand, to the indefinite integral F(x)+CF(x) + C is called integration, and the variable xx is called the variable of integration.

Example 4.1.1 Clearly, by differentiation, we have

1xdx=dxx=lnx+C.\int \frac{1}{x}dx = \int \frac{dx}{x} = \ln|x| + C.

In fact, if x(0,+)x \in (0, +\infty), then

1xdx=lnx+C.\int \frac{1}{x}dx = \ln x + C.

Theorem 4.1.1 The following formulas hold:

ddxf(x)dx=f(x),df(x)dx=f(x)dx,f(x)dx=f(x)+C.\begin{aligned} \frac{d}{dx}\int f(x)dx &= f(x), \\ d\int f(x)dx &= f(x)dx, \\ \int f'(x)dx &= f(x) + C. \end{aligned}

Proof: If F(x)F(x) is any antiderivative of f(x)f(x) (in some underlying interval), then

ddxf(x)dx=ddx(F(x)+C)=F(x)=f(x),df(x)dx=d(F(x)+C)=F(x)dx=f(x)dx,f(x)dx=F(x)+C.\begin{aligned} \frac{d}{dx}\int f(x)dx &= \frac{d}{dx}(F(x) + C) = F'(x) = f(x),\\ d\int f(x)dx &= d(F(x) + C) = F'(x)dx = f(x)dx,\\ \int f'(x)dx &= F(x) + C. \end{aligned}

Remark: The fact that df(x)=f(x)dxdf(x) = f'(x) dx suggests the definition

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

It then follows from Theorem 4.1.1 that

df(x)=f(x)dx=f(x)+C.\int df(x) = \int f'(x)dx = f(x) + C.

By comparison, one may observe that the symbols dd and \int cancel each other when they are used together. And therefore, we may deduce an integration formula from any given differentiation formula.

For example, we have d(cosx)=sinxdxd(-\cos x) = \sin x dx, and hence

sinxdx=(cosx)dx=cosx+C.\int \sin x dx = \int (-\cos x)' dx = -\cos x + C.

The formula

(1aarctanxa)=1aaa2+x2=1a2+x2(\frac{1}{a}\arctan \frac{x}{a})' = \frac{1}{a} \frac{a}{a^2 + x^2} = \frac{1}{a^2 + x^2}

implies that

1a2+x2dx=1aarctanxa+C.\int \frac{1}{a^2 + x^2}dx = \frac{1}{a}\arctan \frac{x}{a} + C.

and so on.

By continuing this process, we can obtain a large number of integration formulas from the differentiation formulas we have learned. In the following, we will list some of the most important integration formulas.

4.1.2 Basic Integration Formulas

  1. xndx=1n+1xn+1+C\int x^n dx = \frac{1}{n+1}x^{n+1} + C, where n1n \neq -1.
  2. exdx=ex+C\int e^x dx = e^x + C.
  3. axdx=1lnaax+C\int a^x dx = \frac{1}{\ln a}a^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. 1xdx=lnx+C\int \frac{1}{x}dx = \ln|x| + C.
  7. 1a2+x2dx=1aarctanxa+C\int \frac{1}{a^2 + x^2}dx = \frac{1}{a}\arctan \frac{x}{a} + C.
  8. 1a2x2dx=arcsinxa+C\int \frac{1}{\sqrt{a^2 - x^2}}dx = \arcsin \frac{x}{a} + C.
  9. 1x2+a2dx=ln(x+x2+a2)+C\int \frac{1}{\sqrt{x^2 + a^2}}dx = \ln(x + \sqrt{x^2 + a^2}) + C.
  10. 1x2a2dx=lnx+x2a2+C\int \frac{1}{\sqrt{x^2 - a^2}}dx = \ln|x + \sqrt{x^2 - a^2}| + C.
  11. dxsin2x=csc2xdx=cotx+C\int \frac{dx}{\sin^2 x} = \int \csc^2 x dx = -\cot x + C.
  12. dxcos2x=sec2xdx=tanx+C\int \frac{dx}{\cos^2 x} = \int \sec^2 x dx = \tan x + C.

4.1.3 Properties of Indefinite Integrals

We know that if two functions' derivatives are the same, then the two functions differ by a constant. Then one may wonder if the derivatives of two functions are the same, then are the integrals of the two functions the same?

To view this, we note that

ddxf(x)dx=ddxg(x)dx,ddx(f(x)dxg(x)dx)=0,f(x)dxg(x)dx=C,f(x)dx=g(x)dx+C.\begin{aligned} \frac{d}{dx}\int f(x)dx &= \frac{d}{dx}\int g(x)dx,\\ \frac{d}{dx}(\int f(x)dx - \int g(x)dx) &= 0,\\ \int f(x)dx - \int g(x)dx &= C,\\ \int f(x)dx &= \int g(x)dx + C. \end{aligned}

But indefinite integrals are defined only to within an arbitrary constant CC, and in this sense, the integrals of two functions differing by a constant are the same.

The following properties of indefinite integrals are immediate consequences of the definition of the indefinite integral:

  1. (f(x)+g(x))dx=f(x)dx+g(x)dx\int (f(x) + g(x))dx = \int f(x)dx + \int g(x)dx.
  2. cf(x)dx=cf(x)dx\int cf(x)dx = c\int f(x)dx.

Corollary 4.1.1 If f1(x),f2(x),,fn(x)f_1(x),f_2(x),\cdots,f_n(x) all have antiderivatives on an interval II, and if c1,c2,,cnc_1,c_2,\cdots,c_n are constants, then

(c1f1(x)+c2f2(x)++cnfn(x))dx=c1f1(x)dx+c2f2(x)dx++cnfn(x)dx.\int (c_1f_1(x) + c_2f_2(x) + \cdots + c_nf_n(x))dx = c_1\int f_1(x)dx + c_2\int f_2(x)dx + \cdots + c_n\int f_n(x)dx.

The proof is trivial as one may apply the properties of indefinite integrals and obtain the result.

Another useful result is

Theorem 4.1.2 If

f(x)dx=F(x)+C,\int f(x)dx = F(x) + C,

then

f(ax+b)dx=1aF(ax+b)+C.\int f(ax + b)dx = \frac{1}{a}F(ax + b) + C.

for arbitrary constants aa and bb where a0a \neq 0. In particular,

f(x+b)dx=F(x+b)+C,f(ax)dx=1aF(ax)+C.\int f(x+b)dx = F(x+b) + C,\\ \int f(ax)dx = \frac{1}{a}F(ax) + C.

Proof: By hypothesis, we have

F(x)=f(x).F'(x) = f(x).

Then, by the chain rule, we have

(F(ax+b))=aF(ax+b)=af(ax+b).(F'(ax+b))' = aF'(ax+b) = af(ax+b).

Therefore, we have

f(ax+b)dx=F(ax+b)+C.\int f(ax+b)dx = F(ax+b) + C.

We now use this new technique to evaluate a few integrals.

Example 4.1.2 Evaluate

(6x23x+2)dx.\int (6x^2-3x+2)dx.

Solution: We have

(6x23x+2)dx=6x2dx3xdx+2dx=6x2dx3xdx+2dx=613x3312x2+2x+C=2x332x2+2x+C.\begin{aligned} \int (6x^2-3x+2)dx &= \int 6x^2dx - \int 3xdx + \int 2dx\\ &= 6\int x^2dx - 3\int xdx + 2\int dx\\ &= 6\frac{1}{3}x^3 - 3\frac{1}{2}x^2 + 2x + C\\ &= 2x^3 - \frac{3}{2}x^2 + 2x + C. \end{aligned}

Example 4.1.3: Evaluate

dxsin2xcos2x\int \frac{dx}{\sin^2 x \cos^2 x}

Solution: By observation, this integral can be rewritten as

dxsin2xcos2x=(sin2x+cos2x)dxsin2xcos2x=dxsin2x+dxcos2x=cotxtanx+C.\begin{aligned} \int \frac{dx}{\sin^2 x \cos^2 x} &= \int \frac{(\sin^2 x + \cos^2 x)dx}{\sin^2x \cos^2x}\\ &= \int \frac{dx}{\sin^2 x} + \int \frac{dx}{\cos^2 x}\\ &= -\cot x - \tan x + C. \end{aligned}

Example 4.1.4 Evaluate

cos2xdx.\int \cos^2 xdx.

Solution: Since cos2x=12(1+cos2x)\cos^2 x = \frac{1}{2}(1 + \cos 2x), we have

cos2xdx=12(1+cos2x)dx=12dx+12cos2xdx=12x+14sin2x+C.\begin{aligned} \int \cos^2 xdx &= \frac{1}{2}\int (1 + \cos 2x)dx\\ &= \frac{1}{2}\int dx +\frac{1}{2} \int \cos 2xdx\\ &= \frac{1}{2}x + \frac{1}{4}\sin 2x + C. \end{aligned}

Problems for this section

  1. Evaluate
    1. (x43x2+2)dx\int (x^4-3x^2+2)dx.
    2. x2(5x)4dx\int x^2(5-x)^4dx.
    3. (1x)(12x)(13x)dx\int (1-x)(1-2x)(1-3x)dx.
    4. (1xx)2dx\int (\frac{1-x}{x})^2 dx.
  2. Prove that

dx1+sinx=tan(π4x2)+C\int \frac{dx}{1+\sin x} = -\tan(\frac{\pi}{4}-\frac{x}{2}) + C

  1. Prove that

dx(x+a)(x+b)=1ablnx+ax+b+C(ab).\int \frac{dx}{(x+a)(x+b)} = \frac{1}{a-b}\ln|\frac{x+a}{x+b}| + C \quad (a \neq b).

4.2 Integration by Substitution and by Parts

Given that

g(t)dt=G(t)+C(G(t)=g(t))\int g(t)dt = G(t) + C \quad (G'(t) = g(t))

let t=t(x)t = t(x) be a differentiable function of xx in an interval II such that g(t(x))g(t(x)) is defined and continuous on II. Then, by the chain rule, we have

ddxG(t(x))=G(t(x))t(x)=g(t(x))t(x),\frac{d}{dx}G(t(x)) = G'(t(x))t'(x) = g(t(x))t'(x),

which implies that

g(t(x))t(x)dx=G(t(x))+C.\int g(t(x))t'(x)dx = G(t(x)) + C.

This is the substitution rule for integration.

Suppose the integral

f(x)dx\int f(x)dx

can be recognized as being of the form

g(t(x))t(x)dx\int g(t(x))t'(x)dx

where t=t(x)t = t(x) is a differentiable function of xx. Moreover, we can integrate g(t)g(t), obtaining

g(t)dt=G(t)+C.\int g(t)dt = G(t) + C.

Then, we can evaluate the integral of f(x)f(x)

f(x)dx=g(t(x))t(x)dx=G(t(x))+C.\int f(x)dx = \int g(t(x))t'(x)dx = G(t(x)) + C.

Now we try to use the substitution rule to evaluate the integral

Example 4.2.1 Evaluate

sin3xcosxdx.\int \sin^3 x \cos x dx.

Solution: Since we can have d(sinx)=cosxdxd(sin x) = \cos x dx, we can let t=sinxt = \sin x, then dt=cosxdxdt = \cos x dx. Therefore, we have

sin3xcosxdx=t3dt=14t4+C=14sin4x+C.\begin{aligned} \int \sin^3 x \cos x dx &= \int t^3 dt\\ &= \frac{1}{4}t^4 + C\\ &= \frac{1}{4}\sin^4 x + C. \end{aligned}

Example 4.2.2 Evaluate

a2x2dx.\int \sqrt{a^2-x^2}dx.

Solution: First, we observe that this integral contains a square root of a quadratic polynomial. One may think of using trigonometric functions to simplify since we have the identity

sin2x+cos2x=1.\sin^2 x + \cos^2 x = 1.

Therefore, we let x=asintx = a\sin t, then dx=acostdtdx = a\cos tdt. Therefore, we have

a2x2dx=a2a2sin2tacostdt=a2cos2tdt=a2(1+cos2t)2dt=a22t+a24sin2t+C=a22arcsinxa+12asintacost+C=a22arcsinxa+12xa2x2+C.\begin{aligned} \int \sqrt{a^2-x^2}dx &= \int \sqrt{a^2-a^2\sin^2 t}a\cos tdt\\ &= \int a^2\cos^2 tdt\\ &= \int \frac{a^2(1+\cos 2t)}{2}dt\\ &= \frac{a^2}{2}t + \frac{a^2}{4}\sin 2t + C\\ &= \frac{a^2}{2}\arcsin \frac{x}{a} + \frac{1}{2}a\sin t a \cos t + C\\ &= \frac{a^2}{2}\arcsin \frac{x}{a} + \frac{1}{2}x\sqrt{a^2-x^2} + C. \end{aligned}

We now turn to another important technique of integration. Let u=u(x)u = u(x) and v=v(x)v = v(x) be differentiable functions of xx such that u(x)v(x)u'(x)v(x) and u(x)v(x)u(x)v'(x) have antiderivatives. Then, by the product rule, we have

d(uv)=udv+vdud(uv) = udv + vdu

and hence

udv=d(uv)vduudv = d(uv) - vdu

which implies that

udv=uvvdu.\int udv = uv - \int vdu.

This is the integration by parts formula. However, one may wonder how does it relate to our integration problems. Let us consider the following example.

Example 4.2.3 Evaluate

xsinxdx.\int x\sin xdx.

Solution: We can let u=xu = x and dv=sinxdxdv = \sin xdx, then du=dxdu = dx and v=cosxv = -\cos x. Therefore, we have

xsinxdx=xcosxcosxdx=xcosx+sinx+C.\begin{aligned} \int x\sin xdx &= -x\cos x - \int -\cos xdx\\ &= -x\cos x + \sin x + C. \end{aligned}

Remark: One may wonder why we choose u=xu = x and dv=sinxdxdv = \sin xdx. The reason is that unlike sinx\sin x, xx is simplified by differentiation. Therefore, we choose u=xu = x and dv=sinxdxdv = \sin xdx. The whole point is to make vdu\int vdu easier to integrate than udv\int udv.

Example 4.2.4 Evaluate

lnxdx.\int \ln xdx.

Solution: We can let u=lnxu = \ln x and dv=dxdv = dx, then du=1xdxdu = \frac{1}{x}dx and v=xv = x. Therefore, we have

lnxdx=xlnxx1xdx=xlnxdx=xlnxx+C.\begin{aligned} \int \ln xdx &= x\ln x - \int x\frac{1}{x}dx\\ &= x\ln x - \int dx\\ &= x\ln x - x + C. \end{aligned}

Remark: This example is to show that even we only have a logarithmic function, we can still use integration by parts to evaluate the integral.

Problems for this section

  1. Use integration by substitution to evaluate
    1. ex2xdx\int e^{x^2}xdx.
    2. xdx1+x4\int \frac{xdx}{1+x^4}.
    3. lnxdxx\int \frac{\ln x dx}{x}.
  2. Use integration by parts to evaluate
    1. xcosxdx\int x\cos xdx.
    2. x3lnxdx\int x^3 \ln x dx.
    3. xlnxdx\int \sqrt{x} \ln x dx.

4.3 Definite Integrals

The definite integral is one of the key concepts of Calculus, and is habitually encountered in various applications. Rigoriously, the definite integral we discussed in this section is the Riemann integral. We first begin by studying the following example.

Example 4.3.1: Given a particle moving along a straight line, let v=v(t)v=v(t) be the particle's velocity at time tt. Find the distance traveled by the particle from time aa to time bb.

Solution: Assuming that the velocity is continuous (One may note that the physics meaning of velocity guarantees that the velocity is continuous), we divide the interval [a,b][a,b] into nn small subintervals by introducing a large number of points of subdivision t1,t2,,tn1t_1,t_2,\cdots,t_{n-1} such that a=t0<t1<t2<<tn1<tn=ba = t_0 < t_1 < t_2 < \cdots < t_{n-1} < t_n = b, where, in the interest of a uniform notation, the end points aa and bb of the original interval are assigned alternative symbols t0t_0 and tnt_n, as if they were points of subdivision too. Let

Δti=titi1(i=1,2,,n),\Delta t_i = t_i - t_{i-1} \quad (i = 1,2,\cdots,n),

and let λ\lambda be the maximum length of the subintervals, i.e., let

max{t1t0,t2t1,,tntn1}=max{Δt1,Δt2,,Δtn}=λ.\max\{t_1-t_0,t_2-t_1,\cdots,t_n-t_{n-1}\} = \max\{\Delta t_1,\Delta t_2,\cdots,\Delta t_n\} = \lambda.

Being continuous, the velocity does not change abruptly, and hence, it is a reasonable assumption that the velocity is approximately constant over each subinterval which we denoted by v(τi)v(\tau_i) during [ti1,ti][t_{i-1},t_i], where τi\tau_i is a point in [ti1,ti][t_{i-1},t_i]. Then, the distance traveled by the particle during [ti1,ti][t_{i-1},t_i] is approximately

v(τi)(titi1)=v(τi)Δti,v(\tau_i)(t_i - t_{i-1}) = v(\tau_i)\Delta t_i,

and hence the distance traveled during the whole interval [a,b][a,b] is approximately

i=1nv(τi)Δti.\sum_{i=1}^n v(\tau_i)\Delta t_i.

This approximation gets better as the subintervals [t0,t1],[t1,t2],,[tn1,tn][t_0,t_1],[t_1,t_2],\cdots,[t_{n-1},t_n] get jointly smaller. Therefore, the distance traveled by the particle from time aa to time bb is defined to be

limλ0i=1nv(τi)Δti.\lim_{\lambda \to 0} \sum_{i=1}^n v(\tau_i)\Delta t_i.

Remark: Let x=x(t)x=x(t) be the particle's poisition at time tt. Then, since

v(t)=dx(t)dt,v(t) = \frac{dx(t)}{dt},

by the very definition of velocity, x(t)x(t) must be an antiderivative of v(t)v(t). On the other hand, in terms of x(t)x(t), the distance II (which we denoted) traveled by the particle from time aa to time bb is obviously x(b)x(a)x(b) - x(a). Therefore, we have

I=limλ0i=1nv(τi)Δti=x(b)x(a).I = \lim_{\lambda \to 0} \sum_{i=1}^n v(\tau_i)\Delta t_i = x(b) - x(a).

This is indeed true and is an immediate consequence of the very important theorem we are about to discuss, which is the Fundamental Theorem of Calculus.

Example 4.3.2 Find the area AA of the plane region bounded by the lines x=ax=a and x=bx=b, the $x-$axis and the curve

y=f(x)(axb),y=f(x) \quad (a \leq x \leq b),

where f(x)0f(x) \geq 0

Solution: To illustrate, one may think of the following figure:

Example1
Figure 1: The area under the curve y=f(x) from x=a to x=b

Then we may think of the regions as a kind of trapezoid with three straight sides and on curved side. Such regions are not considered in elementary geometry. Hence we need to find a way to calculate the area of such regions. As in the preceding example, we divide the interval [a,b][a,b] into nn subintervals by introducing points of subdivision x0,x1,,xnx_0,x_1,\cdots,x_n such that a=x0<x1<x2<<xn1<xn=ba = x_0 < x_1 < x_2 < \cdots < x_{n-1} < x_n = b. Let

Δxi=xixi1(i=1,2,,n),\Delta x_i = x_i - x_{i-1} \quad (i = 1,2,\cdots,n),

and let λ\lambda be the maximum length of the subintervals, i.e., let

λ=max{Δx1,Δx2,,Δxn}.\lambda = \max\{\Delta x_1,\Delta x_2,\cdots,\Delta x_n\}.

Then we may have the following figure:

Example2
Figure 2: The area under the curve y=f(x) from x=a to x=b divided into n subintervals

In the figure, we divide the region into nn subintervals and approximate the area of each subinterval by a rectangle. Then, the total area of the region is approximately

i=1nf(ξi)Δxi,\sum_{i=1}^n f(\xi_i)\Delta x_i,

where ξi\xi_i is a point in [xi1,xi][x_{i-1},x_i]. This approximation gets better as the subintervals get smaller. Therefore, the area of the region we denoted by AA is defined to be

A=limλ0i=1nf(ξi)Δxi.A = \lim_{\lambda \to 0} \sum_{i=1}^n f(\xi_i)\Delta x_i.

The existence of the limit is guaranteed by the continuity of f(x)f(x).

Moreover, many other geometrical and pphysical problems lead to expressions of the same kind. They are all instances of the key concept of a definite integral:

Definition 4.3.1 Given a function f(x)f(x) defined in an interval [a,b][a,b], let x1,,xn1x_1,\dots,x_{n-1} be points of subdivision such that

a=x0<x1<x2<<xn1<xn=b,a = x_0 < x_1 < x_2 < \cdots < x_{n-1} < x_n = b,

and let ξi\xi_i be an arbitrary point of the subinterval [xi1,xi][x_{i-1},x_i], of length Δxi=xixi1\Delta x_i = x_i - x_{i-1}. Suppose the sum

σ=i=1nf(ξi)Δxi\sigma = \sum_{i=1}^n f(\xi_i)\Delta x_i

approaches a (finite) limit as

λ=max{Δx1,Δx2,,Δxn}0.\lambda = \max\{\Delta x_1,\Delta x_2,\cdots,\Delta x_n\} \to 0.

Then, this limit is called the definite integral of f(x)f(x) from aa to bb, and is denoted by

abf(x)dx.\int_a^b f(x)dx.

and the function f(x)f(x) is said to be integrable on [a,b][a,b].

Remark: Since definite integration is an operation producing a number from a given function f(x)f(x), the symbol chosen for the variable of integration is unimportant, and any other symbol would do as well. Thus

abf(x)dx=abf(t)dt=abf(u)du=.\int_a^b f(x)dx = \int_a^b f(t)dt = \int_a^b f(u)du = \cdots.

Theorem 4.3.1 If f(x)f(x) is continuous on [a,b][a,b], then f(x)f(x) is integrable on [a,b][a,b].

Exercises for this section

  1. Write an expression for the area of the figure bounded by the curve y=lnxy=\ln x and the lines x=3,x=5,y=1x=3,x=5,y=1.
  2. Suppose a pot of water is heated up at the rate of f(t)f(t) degrees per minute. How much does the temperature of the water change after 1010 minutes if f(t)=2t23t+1f(t) = 2t^2 - 3t + 1?

4.4 Properties of Definite Integrals

Since we have discussed the definition of definite integrals, we now turn to the properties of definite integrals.

Theorem 4.4.1 If ff is continuous in [a,b][a,b], then

kabf(x)dx=abkf(x)dxk\int_a^b f(x)dx = \int_a^b kf(x)dx

where kk is a constant.

You may prove by using definition of definite integrals.

Theorem 4.4.2 If ff and gg are continuous in [a,b][a,b], then

ab(f(x)+g(x))dx=abf(x)dx+abg(x)dx.\int_a^b (f(x) + g(x))dx = \int_a^b f(x)dx + \int_a^b g(x)dx.

Corollary 4.4.1 If ff and gg are continuous in [a,b][a,b], and kk is arbitrary constant, then

ab(kf(x)+g(x))dx=kabf(x)dx+abg(x)dx.\int_a^b (kf(x) + g(x))dx = k\int_a^b f(x)dx + \int_a^b g(x)dx.

Theorem 4.4.3 If ff is continuous in [a,b][a,b], and if cc is an interior point of [a,b][a,b], then

abf(x)dx=acf(x)dx+cbf(x)dx.\int_a^b f(x)dx = \int_a^c f(x)dx + \int_c^b f(x)dx.

This Theorem has a more general case:

Theorem 4.4.4 If ff is continuous an interval containing the points a,b,ca,b,c, then

abf(x)dx=acf(x)dx+cbf(x)dx.\int_a^b f(x)dx = \int_a^c f(x)dx + \int_c^b f(x)dx.

Remark: The Theorem 4.4.4 is a generalization of Theorem 4.4.3. In this theorem, the point cc is not necessarily an interior point of [a,b][a,b].

Theorem 4.4.5 (Mean Value Theorem for Integrals) If ff is continuous in [a,b][a,b], then there exists a point cc in [a,b][a,b] such that

abf(x)dx=f(c)(ba).\int_a^b f(x)dx = f(c)(b-a).

Remark: By moving the terms, we have the number

1baabf(x)dx\frac{1}{b-a}\int_a^b f(x)dx

which is the average value of f(x)f(x) in [a,b][a,b].

Problems for this section

  1. Prove that if ff is continuous in [a,b][a,b], and if mf(x)Mm \leq f(x) \leq M for all xx in [a,b][a,b], then

m(ba)abf(x)dxM(ba).m(b-a) \leq \int_a^b f(x)dx \leq M(b-a).

  1. Let ff be continuous and nonnegative in [a,b][a,b], and suppose

abf(x)dx=0.\int_a^b f(x)dx = 0.

Prove that f(x)=0f(x) = 0 for all xx in [a,b][a,b]. 3. Determine that which integral is larger:

  1. 01xdx\int_0^1 xdx or 01x2dx\int_0^1 x^2dx.
  2. 0π/2xdx\int_0^{\pi/2}xdx or 0π/2sinxdx\int_0^{\pi/2}\sin xdx.

4.5 The Connection between Definite and Indefinite Integrals

According to Theorem, if f(x)f(x) is continuous in [a,b][a,b], then f(x)f(x) has a definite integral in [a,b][a,b]. We now prove a similar result for indefinite integrals:

Theorem 4.5.1 If f(x)f(x) is continuous in [a,b][a,b], then the function

Φ(x)=axf(t)dt\Phi(x) = \int_a^x f(t)dt

is an antiderivative of f(x)f(x) in [a,b][a,b]. In particular, f(x)f(x) has an indefinite integral Φ(x)+C\Phi(x) + C in [a,b][a,b].

Proof: The existence follows from Theorem 4.3.1. Suppose xx and x+Δxx+\Delta x both belong to [a,b][a,b]. Then,

Φ(x+Δx)Φ(x)=ax+Δxf(t)dtaxf(t)dt=xx+Δxf(t)dt.\begin{aligned} \Phi(x+\Delta x) - \Phi(x) &= \int_a^{x+\Delta x}f(t)dt - \int_a^x f(t)dt\\ &= \int_x^{x+\Delta x}f(t)dt. \end{aligned}

By the Mean Value Theorem for Integrals, there exists a point cc in [x,x+Δx][x,x+\Delta x] such that

xx+Δxf(t)dt=f(c)Δx.\int_x^{x+\Delta x}f(t)dt = f(c)\Delta x.

Therefore, we have

Φ(x+Δx)Φ(x)=f(c)Δx.\Phi(x+\Delta x) - \Phi(x) = f(c)\Delta x.

By taking the limit as Δx0\Delta x \to 0, then f(ξ)f(x)f(\xi) \to f(x), we have

Φ(x)=f(x).\Phi'(x) = f(x).

Therefore, Φ(x)\Phi(x) is an antiderivative of f(x)f(x) in [a,b][a,b].

Remark: The content of this theorem can be written concisely as

ddxaxf(t)dt=f(x),\frac{d}{dx}\int_a^x f(t)dt = f(x),

or

f(x)dx=axf(t)dt+C.\int f(x)dx = \int_a^x f(t)dt + C.

As its name implies, the next theorem is particularly important:

Theorem 4.5.2 (Fundamental Theorem of Calculus) If f(x)f(x) is continuous in [a,b][a,b], then

abf(x)dx=F(b)F(a),\int_a^b f(x)dx = F(b) - F(a),

where F(x)F(x) is any antiderivative of f(x)f(x) in [a,b][a,b].

Proof: By Theorem 4.5.1, the function

Φ(x)=axf(t)dt\Phi(x) = \int_a^x f(t)dt

is an antiderivative of f(x)f(x) in [a,b][a,b]. Therefore, it follows that

Φ(x)=F(x)+C\Phi(x) = F(x) + C

where F(x)F(x) is any other antiderivative of f(x)f(x) in [a,b][a,b]. However, one may note that

Φ(a)=F(a)+C=0,\Phi(a) = F(a) + C = 0,

also since obviously

Φ(b)=abf(t)dt=abf(x)dx,\Phi(b) = \int_a^b f(t)dt = \int_a^b f(x)dx,

and

Φ(b)=F(b)+C=F(b)F(a),\Phi(b) = F(b) + C = F(b) - F(a),

we have

abf(x)dx=F(b)F(a).\int_a^b f(x)dx = F(b) - F(a).

Remark: Note that the Fundamental Theorem of Calculus is a powerful tool for evaluating definite integrals. It allows us to evaluate definite integrals by finding antiderivatives of the integrand.

Example 4.5.1 Given a particle moving along a straight line, let x(t)x(t) and v(t)v(t) be the particle's position and velocity at time tt. Then the distance ll traversed by the particle between the times t=at=a and t=bt=b is given by

l=abv(t)dt=abdx(t)dtdt=abx(t)dt=x(b)x(a).l = \int_a^b v(t)dt = \int_a^b \frac{dx(t)}{dt}dt = \int_a^b x'(t)dt = x(b) - x(a).

Example 4.5.2 Evaluate

abxrdx\int^b_a x^rdx

where r1r \neq -1.

Solution: We have

abxrdx=abxrdx=1r+1xr+1ab=1r+1(br+1ar+1).\int^b_a x^rdx = \int^b_a x^rdx= \frac{1}{r+1}x^{r+1}\Big|_a^b = \frac{1}{r+1}(b^{r+1} - a^{r+1}).

Remark: For evaluating definite integrals, one may use the Fundamental Theorem of Calculus to find antiderivatives of the integrand, and then substitute the limits of integration into the antiderivative. Also the symbol ab\Big|_a^b is used for the evaluation of the antiderivative at the limits of integration.

Problems for this section

  1. Evaluate
    1. 13x3dx\int^3_1 x^3dx.
    2. 0π/2cosxdx\int^{\pi/2}_0 \cos xdx.
    3. 03ex3dx\int^3_0 e^{\frac{x}{3}}dx.
  2. Recall what we have learned in Integration by Substitution and by Parts, and evaluate
    1. 38x1+xdx\int^8_3 \frac{x}{\sqrt{1+x}}dx;
    2. 0ax2a2x2dx(a>0)\int^a_0 x^2\sqrt{a^2-x^2}dx \quad (a>0).
  3. Prove that if ff is continuous in [0,1][0,1], then

    0π2f(sinx)dx=0π2f(cosx)dx.\int^{\frac{\pi}{2}}_0 f(\sin x)dx = \int^{\frac{\pi}{2}}_0 f(\cos x)dx.

    Show that

    0π2cosnxdx=0π2sinnxdx(nN).\int^{\frac{\pi}{2}}_0 \cos^n xdx = \int^{\frac{\pi}{2}}_0 \sin^n xdx \quad (n \in \mathbb{N}).

4.6 Area of a Plane Region

It will be recalled that the integral abf(x)dx\int^b_a f(x)dx is the only reasonable way of defining the area "under the curve y=f(x)y=f(x) from aa to bb" more precisely, the area of the region bounded by the curve y=f(x)y=f(x), the $x-$axis, and the lines x=ax=a and x=bx=b. We now turn to the problem of finding the area of a plane region bounded by two curves.

The area of the plane region bounded by the lines x=ax = a and x=bx = b, the $x-$axis, and the curves y=f(x)y = f(x) and y=g(x)y = g(x), where f(x)g(x)f(x) \geq g(x) in [a,b][a,b], is defined to be

ab(f(x)g(x))dx.\int^b_a (f(x) - g(x))dx.

Remark: The area of the region bounded by the curves y=f(x)y=f(x) and y=g(x)y=g(x) in [a,b][a,b] is the difference between the areas under the two curves.

Example 4.6.1 Find the area of the region bounded by the curves y=xy=\sqrt{x} and y=x2y=x^2.

Solution: The region is shown in the following figure:

Example3
Figure 3: The region bounded by the curves $y=x^2$ and $y=2x-x^2$

The only problem is how to find the points of intersection of the two curves when we are given the equations of the curves. Since one may note that the intersection of the two curves is only in the first quadrant, we have

x=x2,x=1.\begin{aligned} \sqrt{x} &= x^2,\\ x &= 1. \end{aligned}

We now have the intersection point (1,1)(1,1). But how can we determine the area of the region? We may see from the Figure 3 that the area of the region is the difference between the areas under the two curves. Therefore, we have

Area=01(xx2)dx=01(x12x2)dx=23x3213x301=2313=13.\begin{aligned} Area &= \int^1_0 (\sqrt{x} - x^2)dx\\ &= \int^1_0 (x^{\frac{1}{2}} - x^2)dx\\ &= \frac{2}{3}x^{\frac{3}{2}} - \frac{1}{3}x^3\Big|_0^1\\ &= \frac{2}{3} - \frac{1}{3}\\ &= \frac{1}{3}. \end{aligned}

Remark: For student, one may wonder how to know exactly which curve is above the other. The answer is that one should plot the two curves and see which curve is above the other in the region of interest since the area bounded should be positive.

Problems for this section

  1. What is the area between the line x+y=2x+y=2 and the curve y=x2y=x^2?
  2. What is the area bounded by the $x-$axis and the curve y=sinxy=\sin x from x=0x=0 to x=πx=\pi?
  3. Find the area of the region bounded by the curves y=lnxy=\ln x and y=ln2xy=\ln^2 x.

4.7 First-Order Differential Equations

By a differential equation, we mean an equation involving at least one derivative

y=f(x),y=f(x),y' = f'(x), \quad y'' = f''(x), \quad \cdots

of a function y=f(x)y = f(x) and often the function itself. A differential equation is said to be of order nn if nn is the highest order of the derivatives appearing in the equation. Thus

2xy5y=0,y+y=02xy' - 5y = 0, \quad y'' + y = 0

are first-order and second-order differential equations, respectively. This section will be devoted entirely to first-order differential equations. The general form of such an equation is

F(x,y,y)=0,F(x,y,y')=0,

where FF is a function of three variables x,y,yx,y,y'. By a solution of the differential equation, we mean any function y=ϕ(x)y=\phi(x) such that

F(x,ϕ(x),ϕ(x))=0,F(x,\phi(x),\phi'(x)) = 0,

holds identically. For example, the function y=x2y = x^2 is a solution of the differential equation

xy2y=0.xy' - 2y = 0.

since

x(x2)2x2=x(2x)2x2=0.x(x^2)' - 2x^2 = x(2x) - 2x^2 = 0.

The solution of a differential equation is not unique. For example, the function y=0y = 0 is also a solution of the differential equation above. Therefore, the solution

y=Cx2y = Cx^2

is a general solution of the differential equation, where CC is an arbitrary constant.

Example 4.7.1 The simplest first_order differential equation is

y=f(x),y' = f(x),

and its general solution is just the indefinite integral of f(x)f(x):

y=f(x)dx+C.y = \int f(x)dx + C.

Example 4.7.2 Solve the differential equation

y=12x2.y' = 12x^2.

Solution: We have

y=12x2dx+C=4x3+C.\begin{aligned} y &= \int 12x^2dx + C\\ &= 4x^3 + C. \end{aligned}

Example 4.7.3 Find the particular solution of the differential equation

y=12x2,y(0)=3.y' = 12x^2, \quad y(0) = 3.

Solution: We have

y=4x3+C,3=4(0)3+C,C=3.\begin{aligned} y &= 4x^3 + C,\\ 3 &= 4(0)^3 + C,\\ C &= 3. \end{aligned}

Therefore, the particular solution is

y=4x3+3.y = 4x^3 + 3.

Remark: Generalizing the above examples, by an initial condition for the differential equation we mean a condition of the form

y(x0)=y0,y(x_0) = y_0,

where x0x_0 is a given point in the domain of the differential equation, and y0y_0 is a given number. The solution of the differential equation satisfying the initial condition is called the particular solution of the differential equation.

Suppose it has the general solution y=ϕ(x,C)y = \phi(x,C), where CC is an arbitrary constant. Then, the particular solution of the differential equation satisfying the initial condition is obtained by choosing the value of CC such that

ϕ(x0,C)=y0.\phi(x_0,C) = y_0.

More generally, a differential equation of the form

f(x)+g(y)y=0f(x) + g(y)y' = 0

is said to be separable if it can be written in the form

g(y)dy=f(x)dx.g(y)dy = -f(x)dx.

Then, the general solution of the differential equation is

g(y)dy=f(x)dx+C.\int g(y)dy = -\int f(x)dx + C.

Example 4.7.4 Find the particular solution of

2x+yy=0,y(0)=1.2x + \frac{y'}{y} = 0, \quad y(0) = 1.

Solution: First we recall the notation y=dydxy' = \frac{dy}{dx}. Therefore, we rewrite the differential equation as

2x+dyydx=0.2x + \frac{dy}{ydx} = 0.

Equivalently, we have

2xdx+dyy=0.2xdx + \frac{dy}{y} = 0.

Therefore, we have

dyy=2xdx+C,lny=x2+C,y=elny=ex2+C=eCex2=Cex2.\begin{aligned} \int \frac{dy}{y} &= -\int 2xdx + C,\\ \ln |y| &= -x^2 + C,\\ |y| &= e^{\ln |y|} = e^{-x^2 + C} = e^Ce^{-x^2} = Ce^{-x^2}. \end{aligned}

Since y(0)=1y(0) = 1, we have

1=Ce0=C.1 = Ce^0 = C.

Therefore, the particular solution is

y=ex2.y = e^{-x^2}.

Remark: The method of separation of variables is a powerful technique for solving first-order differential equations. The method is based on the observation that if a differential equation can be written in the form.

Remark: For some students, one may wonder why we have transformed eCe^C into simply CC. The reason is that CC is an arbitrary constant, and eCe^C is also an arbitrary constant. Therefore, we can simply write CC. In some notation, people try to differentiate between the two by writing C1,C2,C_1,C_2,\cdots for different arbitrary constants.

Another important type of first-order differential equations is the linear differential equation. A first-order differential equation is said to be linear if it can be written in the form

y+p(x)y=q(x),y' + p(x)y = q(x),

where p(x)p(x) and q(x)q(x) are continuous functions of xx. The general solution of the linear differential equation is

y=ep(x)dx(q(x)ep(x)dxdx+C).y = e^{-\int p(x)dx}\left(\int q(x)e^{\int p(x)dx}dx + C\right).

But usually the general solution is hard to memorize (even I cannot remember it). Therefore, we will use the following method to solve the linear differential equation.

Method: Suppose the linear differential equation is

y+p(x)y=q(x).y' + p(x)y = q(x).

Then, we multiply the equation by the integrating factor ep(x)dxe^{\int p(x)dx}, and we have

ep(x)dxy+p(x)ep(x)dxy=q(x)ep(x)dx.e^{\int p(x)dx}y' + p(x)e^{\int p(x)dx}y = q(x)e^{\int p(x)dx}.

Therefore, we have

ddx(ep(x)dxy)=q(x)ep(x)dx,ep(x)dxy=q(x)ep(x)dxdx+C,y=ep(x)dx(q(x)ep(x)dxdx+C).\begin{aligned} \frac{d}{dx}(e^{\int p(x)dx}y) &= q(x)e^{\int p(x)dx},\\ e^{\int p(x)dx}y &= \int q(x)e^{\int p(x)dx}dx + C,\\ y &= e^{-\int p(x)dx}\left(\int q(x)e^{\int p(x)dx}dx + C\right). \end{aligned}

Example 4.7.5 Solve the differential equation

y+1xy=sinxx.y' + \frac{1}{x}y = \frac{\sin x}{x}.

Solution: First, we note that

p(x)=1x,q(x)=sinxx.p(x) = \frac{1}{x}, \quad q(x) = \frac{\sin x}{x}.

Therefore, we have the integrating factor

e1xdx=elnx=x.e^{\int \frac{1}{x}dx} = e^{\ln x} = x.

Therefore, we multiply the differential equation by xx and we have

xy+y=sinx.xy' + y = \sin x.

Therefore, we have

ddx(xy)=sinx,xy=cosx+C,y=cosxx+Cx.\begin{aligned} \frac{d}{dx}(xy) &= \sin x,\\ xy &= -\cos x + C,\\ y &= -\frac{\cos x}{x} + \frac{C}{x}. \end{aligned}

Remark: The method of integrating factors is a powerful technique for solving linear differential equations.

Next we illustrate the physical applications of first-order differential equations.

Example 4.7.6 Suppose it takes 22 days for 5050% of the radioactivity produced by a nuclear explosion disappear. How long does it take for 9999% of the radioactivity to disappear?

Solution: Let Q(t)Q(t) be the amount of radioactivity at time tt. Then, the rate of change of the radioactivity is proportional to the amount of radioactivity. Therefore, we have

dQdt=kQ,\frac{dQ}{dt} = -kQ,

where kk is a positive constant. The solution of the differential equation is

Q=Cekt.Q = Ce^{-kt}.

Since 5050% of the radioactivity disappears in 22 days, we have

Q(2)Q(0)=12=e2k.\frac{Q(2)}{Q(0)} = \frac{1}{2} = e^{-2k}.

Therefore, we have

k=ln22.k = \frac{\ln 2}{2}.

Hence, 9999% of the radioactivity disappears in tt days, where

Q(t)Q(0)=1100=eln22t.\frac{Q(t)}{Q(0)} = \frac{1}{100} = e^{-\frac{\ln 2}{2}t}.

It implies that

t=2ln100ln2=4ln10ln213.3 days.\begin{aligned} t &= \frac{2\ln 100}{\ln 2}\\ &= 4\frac{\ln 10}{\ln 2}\\ &\approx 13.3 \text{ days}. \end{aligned}

Problems for this section

  1. Find the solution of the differential equation y=yxy' = - \frac{y}{x} satisfying the initial condition y(2)=1y(2) = 1.
  2. Solve the following differential equation
    1. yx3=2yy'x^3 = 2y;
    2. (1+x2)y+1+y2=0(1+x^2)y' + 1 + y^2 = 0.
  3. Solve Bernoulli's differential equation

    y+p(x)y=q(x)yn,y' + p(x)y = q(x)y^n,

    (if n=0n=0 or n=1n=1, it is a linear differential equation). Hint: Divide through by yny^n and let z=y1nz = y^{1-n}.

4.8 Using Python to Solve Integration and Differential Equations

Here we will introduce how to use Python to solve integration and differential equations. We will use the sympy library in Python. The sympy library is a powerful library for symbolic mathematics in Python. We will introduce how to use sympy to solve integration and differential equations.

Here comes the easiest example. We will use sympy to solve the following integration

xkdx.\int x^kdx.

import sympy as sp

x = sp.symbols('x')
k = sp.symbols('k', integer=True, positive=True) # Here we assume k is a positive integer
f = x**k

integral = sp.integrate(f, x)
print(integral)

The output will be

x**(k + 1)/(k + 1)

One may wonder how to solve the definite integral. We can use the following code to solve the definite integral

abxkdx.\int^b_a x^kdx.

import sympy as sp

x = sp.symbols('x')
k = sp.symbols('k', integer=True, positive=True) # Here we assume k is a positive integer
a = sp.symbols('a')
b = sp.symbols('b')
f = x**k

integral = sp.integrate(f, (x, a, b)) # For definite integral, we need to specify the limits of integration
print(integral)

The output will be

b**(k + 1)/(k + 1) - a**(k + 1)/(k + 1)

Next, we will solve the following differential equation

y=12x2.y' = 12x^2.

import sympy as sp

x = sp.symbols('x')
y = sp.Function('y')(x) # We define the function y(x)

f = 12*x**2 # We define the right-hand side of the differential equation

solution = sp.dsolve(sp.Derivative(y, x) - f) # We solve the differential equation
print(solution)

The output will be

Eq(y(x), C1 + 4*x**3)

Which is the same as we have done in Example 4.7.2.

Even we have not learned second-order differential equations, we can still solve them using sympy. Here we will solve the following second-order differential equation

y+y=0.y'' + y = 0.

First, the solution of the differential equation is

y=Acosx+Bsinx.y = A\cos x + B\sin x.

where AA and BB are arbitrary constants.

import sympy as sp

x = sp.symbols('x')
y = sp.Function('y')(x) # We define the function y(x)

f = y.diff(x, x) + y # We define the right-hand side of the differential equation

solution = sp.dsolve(f) # We solve the differential equation
print(solution)

The output will be

Eq(y(x), C1*sin(x) + C2*cos(x))

Which is correct since A=C2A = C_2 and B=C1B = C_1 are just matter of notation.

Problems for this section

  1. Integrate the following function by using Python
    1. x3x^3;
    2. x2sinxx^2\sin x;
    3. 1x\frac{1}{x};
    4. sinxx\frac{\sin x}{x}.
    5. 11+x2\frac{1}{1+x^2}.
  2. Solve the following definite integral by using Python
    1. 13x3dx\int^3_1 x^3dx;
    2. 0π/2cosxdx\int^{\pi/2}_0 \cos xdx;
    3. 03ex3dx\int^3_0 e^{\frac{x}{3}}dx.
    4. 01x21x2dx\int^1_0 x^2\sqrt{1-x^2}dx.
    5. 0π2cos2xdx\int^{\frac{\pi}{2}}_0 \cos^2 xdx.
  3. Solve the following differential equation by using Python
    1. y=12x2y' = 12x^2;
    2. y+1xy=sinxxy' + \frac{1}{x}y = \frac{\sin x}{x};
    3. yx3=2yy'x^3 = 2y;
    4. (1+x2)y+1+y2=0(1+x^2)y' + 1 + y^2 = 0.

References

  1. Silverman, Richard A. Modern calculus and analytic geometry. Courier Corporation, 2002.