Integration PDF
Integration PDF
Often, when attempting to solve a differential equation, we are naturally led to computing one or
more integrals — after all, integration is the inverse of differentiation. Indeed, we have already
solved one simple second-order differential equation by repeated integration (the one arising in
the simplest falling object model, starting on page 10). Let us now briefly consider the general
case where integration is immediately applicable, and also consider some practical aspects of
using both the indefinite integral and the definite integral.
Since the right-hand side of the last equation depends only on x , we do have
dy 4x + 6
= f (x) with f (x) = 2
.
dx x
23
24 Integration and Differential Equations
Here, the right-hand side of the last equation depends on both x and y , not just x . So
equation (2.3) is not directly integrable.
Solving a directly-integrable equation is easy: First solve for the derivative to get the equation
into form (2.1) or (2.1 ′ ), then integrate both sides as many times as needed to eliminate the
derivatives, and, finally, do whatever simplification seems appropriate.
= 4 ln |x| + c2 − 6x −1 + c3
where c1 , c2 , and c3 are arbitrary constants. Rearranging things slightly and letting c =
c2 + c3 − c1 , this last equation simplifies to
y(x) = 4 ln |x| − 6x −1 + c . (2.6)
This is our general solution to differential equation (2.4). Since both ln |x| and x −1 are
discontinuous at x = 0 , the solution can be valid over any interval not containing x = 0 .
?◮Exercise 2.1: Consider the differential equation in example 2.2 and explain why the y ,
which is an unknown function of x , makes it impossible to completely integrate both sides of
dy 4x y + 6
=
dx x2
with respect to x .
On Using Indefinite Integrals 25
= 4 ln |x| − 6x −1 + c .
instead of Z
dy
y(x) + some arbitrary constant = dx .
dx
By our new convention, that “some arbitrary constant” is still in equation (2.7) — it’s just been
moved to the right-hand side of the equation and combined with the constants arising from the
integral there.
Finally, like you, this author will get tired of repeatedly saying “where c is an arbitrary
constant” when it is obvious that the c (or the c1 or the A or …) that just appeared in the
previous line is, indeed, some arbitrary constant. So let us not feel compelled to constantly
repeat the obvious, and agree that, when a new symbol suddenly appears in the computation of
an indefinite integral, then, yes, that is an arbitrary constant. Remember, though, to use different
symbols for the different constants that arise when integrating a function already involving an
arbitrary constant.
In practice, rather than use the same letter with different subscripts for different arbitrary
constants (as we did in the above example), you might just want to use different letters, say,
writing
3
y(x) = x 4 + ax + b
2
instead of
3 4
y(x) = x + c1 x + c2 .
2
This sometimes prevents dumb mistakes due to bad handwriting.
1. Pick a convenient value for the lower limit of integration a . In particular, if the value of
y(x0 ) is given for some point x0 , set a = x0 .
2. Rewrite the differential equation with s denoting the variable instead of x (i.e., replace
x with s ),
dy
= f (s) . (2.10)
ds
After that, simply integrate both sides of equation (2.10) with respect to s from a to x :
Z x Z x
dy
ds = f (s) ds
a ds a
Z x
֒→ y(x) − y(a) = f (s) ds .
a
This is a general solution to the given differential equation. It should be noted that the integral
here is a definite integral. Its evaluation does not lead to any arbitrary constants. However, the
value of y(a) , until specified, can be anything; so y(a) is the “arbitrary constant” in this general
solution.
y(x) = x 3 − 8 + y(2) .
This is a general solution to our differential equation. To find the particular solution that also
satisfies y(2) = 12 , as desired, we simply replace the y(2) in the general solution with its
given value,
y(x) = x 3 − 8 + y(2)
= x 3 − 8 + 12 = x 3 + 4 .
28 Integration and Differential Equations
and compute the integral. That is, after all, what we derived for any choice of f .
Unfortunately, this integral was not one you learned to evaluate in calculus.1 And if you check
the tables, you will discover that no one else has discovered a usable formula for this integral.
Consequently, the above formula for y(x) is not very usable. Heck, we can’t even isolate an
arbitrary constant or see how the solution depends on the initial value.
On the other hand, using definite integrals, we get
Z x Z x
dy 2
ds = e−s ds
0 ds 0
Z x
2
֒→ y(x) − y(0) = e−s ds
0
Z x
2
֒→ y(x) = e−s ds + y(0) .
0
This last formula explicitly describes how y(x) depends on the initial value y(0) . Since we
are assuming y(0) = 0 , this reduces to
Z x
2
y(x) = e−s ds .
0
1 Well, you could expand e−x 2 in a Taylor series and integrate the series.
On Using Definite Integrals 29
We still cannot find a computable formula for this integral, but, if we choose a specific value
for x , say, x = 10 , this expression becomes
Z 10
2
y(10) = e−s ds .
0
The value of this integral can be very accurately approximated using any of a number of
numerical integration methods such as the trapezoidal rule or Simpson’s rule. In practice,
of course, we’ll just use the numerical integration command in our favorite computer math
package (Maple, Mathematica, etc.). Using any such package, you will find that
Z 10
2
y(10) = e−s ds ≈ 0.886 .
0
In one sense, Z
y(x) = f (x) d x (2.12)
and Z x
y(x) = f (s) ds + y(a) (2.13)
a
are completely equivalent mathematical expressions. In practice, either can be used just about
as easily provided a reasonable formula for the indefinite integral in (2.12) can be found. If no
such formula can be found, however, then expression (2.13) is much more useful because it can
still be used, along with a numerical integration routine, to evaluate y(x) for specific values of
x . Indeed, one can compute y(x) for a large number of values of x , plot each of these values
of y(x) against x , and thereby construct a very accurate approximation of the graph of y .
There are other ways to approximate solutions to differential equations, and we will discuss
some of them. However, if you can express your solution in terms of definite integrals — even
if the integral must be computed approximately — then it is usually best to do so. The other
approximation methods for differential equations are typically more difficult to implement, and
more likely to result in poor approximations.
While ln(x) and arctan(x) can be defined independently of these integrals, their alternative
definitions do not provide us with particularly useful ways to compute these functions by hand
(unless x is something special, such as 1 ). Indeed, if you need the value of ln(x) or arctan(x)
for, say, x = 18 , then you are most likely to “compute” these values by having your calculator or
computer or published tables2 tell you the (approximate) value of ln(18) or arctan(18) . Thus,
2 if you are an old-timer
30 Integration and Differential Equations
for computational purposes, we might as well just view ln(x) and arctan(x) as names for the
above integrals, and be glad that their values can be easily looked up electronically or in published
tables.
It turns out that other integrals arise often enough in applications that workers dealing with
these applications have decided to “name” these integrals, and to have their values tabulated.
Two noteworthy “named integrals” are:
Both of these are considered to be well-known functions, at least among certain groups of
mathematicians, scientists and engineers. They (the functions, not the people) can be found in
published tables and standard mathematical software (e.g., Maple, Mathematica, and MathCad)
alongside such better-known functions as the natural logarithm and the trigonometric functions.
Moreover, using tables or software, the value of erf(x) and Si(x) for any real value of x can be
accurately computed just as easily as can the value of arctan(x) . For these reasons, and because
“ erf(x) ” and “ Si(x) ” take up less space than the integrals they represent, we will often follow
the lead of others and use these function names instead of writing out the integrals.
3 This integral is clearly mis-named since it is not the integral of the sine. In fact, the function being integrated,
sin(x)/x , is often called the “sinc” function (pronounced “sink”), so Si should really be called the “sinc-integral
function”. But nobody does.
Integrals of Piecewise-Defined Functions 31
Y Y Y
4
1 1
0 1 X 0 1 X 0 2 X
(a) (b) (c)
Figure 2.1: Three piecewise defined functions: (a) the step function, (b) the ramp function,
(c) f (x) from example 2.8.
32 Integration and Differential Equations
Now, if x ≤ 2 , then f (s) = s 2 for every value of s in the interval (0, x) . So, when
x ≤ 2, Z x Z x
1 x
1
f (s) ds = s 2 ds = s 3 = x3 .
0 0 3 s=0 3
(Notice that this integral is valid for x = 2 even though the formula used for f (s) , s 2 , was
only valid for s < 2 .)
On the other hand, if 2 < x , we must break the integral into two pieces, the one over
(0, 2) and the one over (2, x) :
Z x Z 2 Z x
f (s) ds = f (s) ds + f (s) ds
0 0 2
Z 2 Z x
= s 2 ds + 1 ds
0 2
1 3 2
x
= s + s s=2
3 s=0
h i
1 2
= · 23 − 0 + [x − 2] = x + .
3 3
Keep in mind that solutions to differential equations are required to be continuous. After
checking the above formulas, it should be obvious that the y(x) obtained in the last example
is continuous everywhere except, possibly, at x = 2 . With a little work we could also verify
that, in fact, we also have continuity at x = 2 . We simply have to recall the limit definition
of continuity, and verify that the appropriate requirements are satisfied. But we won’t bother
because, in a little bit, it will seen that solutions so obtained via definite integration are guaranteed
to be continuous, provided the discontinuities in the function being integrated are not too bad.
On the other hand, as the next example illustrates, the continuity of the solution is an issue
when we use indefinite integrals.
The indefinite integral of f (x) is computed by simply finding the indefinite integral of each
“piece”, noting the values of the variable for which the integration is valid. Thus,
Z
1
Z x 2 d x if x < 2
x 3 + c1
if x < 2
3
y(x) = f (x) d x = Z = .
1 dx if 2 ≤ x
x +c
2 if 2 ≤ x
Again, I remind you that solutions to differential equations are required to be continuous.
And, again, it should be obvious that the y(x) just obtained is continuous everywhere except,
possibly, at x = 2 . Now, recall what is means to say “ y(x) is continuous at x = 2 ” — it
means
lim y(x) = y(2) .
x→2
Here, however, y(x) is given by different formulas on either side of x = 2 . So we will have
to consider both the left- and the right-hand limits, and require that
y(2) = 2 + c2 ,
h i
1 1 8
lim− y(x) = lim x 3 + c1 = · 23 + c1 = + c1
x→2 x→2 3 3 3
and
lim y(x) = lim [x + c2 ] = 2 + c2 .
x→2+ x→2
This, in turn, means that the “arbitrary constants” c1 and c2 are not completely arbitrary;
they must be related by
8
+ c1 = 2 + c2 .
3
Consequently, we must insist that
8 2
c1 = c2 + 2 − = c2 −
3 3
or, equivalently, that
2
c2 = c1 + .
3
Choosing the later, we finally get a valid general solution to our differential equation, namely,
1
1 3
x 3 + c1 if x < 2
3 x + c1
if x < 2
3
y(x) = = .
2
x +c
2 if 2 ≤ x x + + c1 if 2 ≤ x
3
34 Integration and Differential Equations
In practice, a given piecewise defined function may have more than two “pieces”, and the
differential equation may have order higher than one. For example, you may be called upon to
solve
0 if x < 1
d2 y
= f (x) where f (x) = 1 if 1 ≤ x < 2
dx 2
0 if 2 ≤ x
or even something involving infinitely many pieces, such as
0 if x<0
1 if 0 ≤ x < 1
4 2
if 2 ≤ x < 3
d y
= stair(x) where stair(x) = . (2.14)
dx 4
3 if 3 ≤ x < 4
4 if 4 ≤ x < 5
...
The methods illustrated in the two examples can still be applied; you just have more integrals to
keep track of, and the accompanying bookkeeping becomes more involved. If you use indefinite
integrals, make sure to relate all the “arbitrary” constants to each other so that your solution is
continuous. If you use definite integrals, then any concerns about the continuity of your solutions
can probably be aleviated by the discussion in the next subsection.
follows from the fact that this integral is closely related to the area of the region enclosed by the
graph of f and the S–axis over the interval between a and x . In particular, if a < x and f
is a positive function on (a, x) , then this integral is the area of the region bounded above by the
graph of f , below by the S–axis, and on the sides by the lines s = a and s = x . Changing
x by just a little changes the base of this region by just a little, and this changes g(x) , the area
given by the above integral, by only a little. That, essentially, is what continuity is all about —
small changes in x can only result in small changes in g(x) .
More generally, f might not be a positive function, and we may be concerned with the
above integral when x < a . Still, as long as f does not behave too badly, “area arguments”
can assure us that the above g is a continuous function of x . What would be bad and would
make these arguments impossible would be for the area to become infinite, as happens when we
(foolishly) try to integrate x −1 across x = 0 . This, of course, cannot happen unless the function
being integrated “blows up” at some point (as x −1 does at 0 ). In practice, this means that such
a point cannot be in the interval over which the differential equation can be solved. At best, it is
an endpoint of our interval of interest.
All this leads to the following theorem, which gives an easily applied condition under which
the continuity of Z x
g(x) = f (s) ds
a
Integrals of Piecewise-Defined Functions 35
is guaranteed. It does not give the most general conditions, but it should cover all cases you are
likely to encounter in the foreseeable future.
Theorem 2.1
Let f be a function on an interval (α, β) and let a be a point in that interval. Suppose, further,
that f is continuous at all but, at most, a finite number of points in (α, β) , and that, at each such
point x0 of discontinuity, the left- and right-hand limits
is continuous on (α, β) .
We will prove this theorem in a little bit. First, let’s apply it to verify that the solution
obtained in example 2.8 is continuous.
as a general solution to
(
dy x2 if x <2
= f (x) where f (x) = .
dx 1 if 2 ≤ x
So the one-sided limits exist (as finite values). Theorem 2.1 then assures us that
Z x
g(x) = f (s) ds
0
Theorem 2.1 can still be applied in those rare instances where the function being integrated
has infinitely many discontinuities (as with the “stair function”, defined above in line (2.14)),
provided the function only has finitely many discontinuities on each finite subinterval, and each
of these discontinuities is only a finite-jump discontinuity. For example, the stair function has
“jumps” at
x = 0, 1, 2, 3, 4, 5, . . . .
However, on the finite interval (−N , N ) , where N is any positive integer, the only discontinuities
of stair(x) are at
x = 0, 1, 2, 3, 4, . . . , N − 1 .
So stair(x) has only a finite number of discontinuities on (−N , N ) , and each of these is a
finite-jump discontinuity. The theorem then tells us that
Z x
g(x) = stair(s) ds
0
is continuous at each x in (−N , N ) . Since N can be made as large as we wish, we can conclude
that, in fact, g(x) is continuous at every x in (−∞, ∞) .
Now let’s prove our theorem. For the proof, we will use facts based on “area arguments”
that you should recall from your elementary calculus course.
PROOF (of theorem 2.1): First of all, note that the two requirements placed on f ensure
Z x
g(x) = f (s) ds
a
is well defined for any x in (α, β) using any of the definitions for the integral found in most
calculus texts (check this out yourself, using the definition in your calculus text). They also
prevent f (x) from “blowing up” on any closed subinterval [α ′ , β ′ ] of (α, β) . Thus, for each
such closed subinterval [α ′ , β ′ ] , there is a corresponding finite constant M such that5
| f (s)| ≤ M whenever α ′ ≤ s ≤ β ′ .
for any x0 in (α, β) . But by the definition of g and well-known properties of integration,
Z x
lim g(x) = lim f (s) ds
x→x 0 x→x 0 a
Z x0 Z x
= lim f (s) ds + f (s) ds
x→x 0 a x0
Z x
= lim g(x0 ) + f (s) ds
x→x 0 x0
Z x
= g(x0 ) + lim f (s) ds .
x→x 0 x0
5 The constant M can be the maximum value of | f (s)| on [α ′ , β ′ ] , provided that maximum exists. It may change
if either endpoint α ′ or β ′ is changed.
Additional Exercises 37
Hence,
x
Z
0 ≤ lim+ f (s) ds ≤ lim M[x − x0 ] = M[x0 − x0 ] = 0
x→x 0 x0 x→x 0 +
and
x
Z
0 ≤ lim f (s) ds ≤ lim M[x0 − x] = M[x0 − x0 ] = 0 , (2.18)
x→x 0 − x→x 0 −
x0
Additional Exercises
2.2. Determine whether each of the following differential equations is or is not directly
integrable:
dy dy
a. = 3 − sin(x) b. = 3 − sin(y)
dx dx
dy dy
c. + 4y = e2x d. x = arcsin(x 2 )
dx dx
dy d2 y x +1
e. y = 2x f. 2
=
dx dx x −1
d2 y d2 y
g. x 2 = 1 h. y 2 = 8x 2
dx 2 dx 2
38 Integration and Differential Equations
d2 y dy 2
i. + 3 + 8y = e−x
dx 2 dx
2.3. Find a general solution for each of the following directly integrable equations. (Use
indefinite integrals on these.)
dy dy
a. = 4x 3 b. = 20e−4x
dx dx
dy √ √ dy
c. x + x = 2 d. x +4 = 1
dx dx
dy dy
= x cos x 2
e. f. = x cos(x)
dx dx
dy dy
g. x = x 2 − 9 h. 1 = x 2 − 9
dx dx
dy d2 y
i. 1 = x 2 − 9 j. = sin(2x)
dx dx 2
d2 y d4 y
k. − 3 = x l. = 1
dx 2 dx 4
2.4. Solve each of the following initial-value problems (using the indefinite integral). Also,
state the largest interval over which the solution is valid (i.e., the maximal possible
interval of interest).
dy
a. = 4x + 10e2x with y(0) = 4
dx
√
3 dy
b. x +6 = 1 with y(2) = 10
dx
dy x −1
c. = with y(0) = 8
dx x +1
dy √
d. x + 2 = x with y(1) = 6
dx
dy
e. cos(x) − sin(x) = 0 with y(0) = 3
dx
dy
f. x2 + 1 = 1 with y(0) = 3
dx
d2 y √
g. x 2
+ 2 = x with y(1) = 8 and y ′ (1) = 6
dx
2.5 a. Using definite integrals (as in example 2.5 on page 27), find the general solution to
dy
x
= sin
dx 2
2.6 a. Using definite integrals (as in example 2.5 on page 27), find the general solution to
dy √
= 3 x +3
dx
with y(1) acting as the arbitray constant.
b. Using the formula just found for y(x) :
i. Find y(6) when y(1) = 16 . ii. Find y(6) when y(1) = 20 .
iii. Find y(−2) when y(1) = 0 .
2.7. Using definite integrals (as in example 2.5 on page 27), find the solution to each of
the following initial-value problems. (In some cases, you may want to use the error
function or the sine-integral function.)
dy 2
a. = x e−x with y(0) = 3
dx
dy x
b. = √ with y(2) = 7
dx x2 + 5
dy 1
c. = 2 with y(1) = 0
dx x +1
dy 2
d. = e−9x with y(0) = 1
dx
dy
e. x = sin(x) with y(0) = 4
dx
dy
f. x = sin x 2 with y(0) = 0
dx
2.8. Using an appropriate computer math package (such as Maple, Mathematica or Mathcad),
graph each of the following over the interval 0 ≤ x ≤ 10 :
a. the error function, erf(x) . b. the sine integral function, Si(x) .
c. the solution to
dy
= ln 2 + x 2 sin(x) with y(0) = 0 .
dx
2.9. Each of the following differential equations involves a function that is (or can be)
piecewise defined. Sketch the graph of each of these piecewise defined functions, and
find the general solution of each differential equation. If an initial value is also given,
then also solve the given initial-value problem:
dy
a. = step(x) with y(0) = 0 and step(x) as defined on page 31
dx
(
dy 0 if x <1
b. = f (x) with y(0) = 2 and f (x) =
dx 1 if 1 ≤ x
0
if x <1
dy
c. = f (x) with y(0) = 0 and f (x) = 1 if 1 ≤ x < 2
dx
0 if 2 ≤ x
40 Integration and Differential Equations
dy
d. = |x − 2|
dx
dy
e. = stair(x) with y(0) = 0 and stair(x) as defined on page 34
dx