[Notes on Diffy Qs home] [PDF version] [Buy cheap paperback version]


1.1 Integrals as solutions

Note: 1 lecture (or less), §1.2 in [EP], covered in §1.2 and §2.1 in [BD]

A first order ODE is an equation of the form

dy-= f(x,y), dx

or just

y′ = f (x,y).

In general, there is no simple formula or procedure one can follow to find solutions. In the next few lectures we will look at special cases where solutions are not difficult to obtain. In this section, let us assume that f is a function of x alone, that is, the equation is

 ′ y = f (x).

We could just integrate (antidifferentiate) both sides with respect to x .

∫ ∫ y′(x) dx = f(x) dx + C,

that is

 ∫ y(x) = f(x) dx + C.

This y(x) is actually the general solution. So to solve (1.1), we find some antiderivative of f (x ) and then we add an arbitrary constant to get the general solution.

Now is a good time to discuss a point about calculus notation and terminology. Calculus textbooks muddy the waters by talking about the integral as primarily the so-called indefinite integral. The indefinite integral is really the antiderivative (in fact the whole one-parameter family of antiderivatives). There really exists only one integral and that is the definite integral. The only reason for the indefinite integral notation is that we can always write an antiderivative as a (definite) integral. That is, by the fundamental theorem of calculus we can always write ∫ f (x ) dx + C as

∫ x f (t) dt + C. x0

Hence the terminology to integrate when we may really mean to antidifferentiate. Integration is just one way to compute the antiderivative (and it is a way that always works, see the following examples). Integration is defined as the area under the graph, it only happens to also compute antiderivatives. For sake of consistency, we will keep using the indefinite integral notation when we want an antiderivative, and you should always think of the definite integral.

Example 1.1.1: Find the general solution of y′ = 3x2 .

Elementary calculus tells us that the general solution must be  3 y = x + C . Let us check by differentiating: y′ = 3x2 . We have gotten precisely our equation back.

Normally, we also have an initial condition such as y(x0) = y0 for some two numbers x0 and y0 (x0 is usually 0, but not always). We can then write the solution as a definite integral in a nice way. Suppose our problem is  ′ y = f(x) , y(x0) = y0 . Then the solution is

 ∫ x y(x) = f(s) ds + y . x0 0

Let us check! We compute  ′ y = f (x) , via the fundamental theorem of calculus, and by Jupiter, y is a solution. Is it the one satisfying the initial condition? Well,  ∫ x y(x0) = x0f (x) dx + y0 = y0 0 . It is!

Do note that the definite integral and the indefinite integral (antidifferentiation) are completely different beasts. The definite integral always evaluates to a number. Therefore, (1.2) is a formula we can plug into the calculator or a computer, and it will be happy to calculate specific values for us. We will easily be able to plot the solution and work with it just like with any other function. It is not so crucial to always find a closed form for the antiderivative.

Example 1.1.2: Solve

y′ = e-x2, y(0) = 1.

By the preceding discussion, the solution must be

 ∫ x 2 y(x) = e-s ds + 1. 0

Here is a good way to make fun of your friends taking second semester calculus. Tell them to find the closed form solution. Ha ha ha (bad math joke). It is not possible (in closed form). There is absolutely nothing wrong with writing the solution as a definite integral. This particular integral is in fact very important in statistics.

Using this method, we can also solve equations of the form

y′ = f(y).

Let us write the equation in Leibniz notation.

dy ---= f(y). dx

Now we use the inverse function theorem from calculus to switch the roles of x and y to obtain

dx- -1-- dy = f(y).

What we are doing seems like algebra with dx and dy . It is tempting to just do algebra with dx and dy as if they were numbers. And in this case it does work. Be careful, however, as this sort of hand-waving calculation can lead to trouble, especially when more than one independent variable is involved. At this point we can simply integrate,

 ∫ 1 x(y) = ----dy + C. f(y)

Finally, we try to solve for y .

Example 1.1.3: Previously, we guessed  ′ y = ky (for some k > 0 ) has the solution  kx y = Ce . We can now find the solution without guessing. First we note that y = 0 is a solution. Henceforth, we assume y ⇔ 0 . We write

dx- = 1-. dy ky

We integrate to obtain

 1- x(y) = x = k ln|y| + D,

where D is an arbitrary constant. Now we solve for y (actually for |y| ).

|y| = ekx-kD = e-kDekx.

If we replace e-kD with an arbitrary constant C we can get rid of the absolute value bars (which we can do as D was arbitrary). In this way, we also incorporate the solution y = 0 . We get the same general solution as we guessed before,  kx y = Ce .

Example 1.1.4: Find the general solution of y′ = y2 .

First we note that y = 0 is a solution. We can now assume that y ⇔ 0 . Write

dx-= 1-. dy y2

We integrate to get

 -1 x = -y-+ C.

We solve for  -1- y = C-x . So the general solution is

y = --1--- or y = 0. C - x

Note the singularities of the solution. If for example C = 1 , then the solution “blows up” as we approach x = 1 . Generally, it is hard to tell from just looking at the equation itself how the solution is going to behave. The equation y′ = y2 is very nice and defined everywhere, but the solution is only defined on some interval (-∞, C ) or (C,∞ ) .

Classical problems leading to differential equations solvable by integration are problems dealing with velocity, acceleration and distance. You have surely seen these problems before in your calculus class.

Example 1.1.5: Suppose a car drives at a speed et∕2 meters per second, where t is time in seconds. How far did the car get in 2 seconds (starting at t = 0 )? How far in 10 seconds?

Let x denote the distance the car traveled. The equation is

x′ = et∕2.

We can just integrate this equation to get that

x(t) = 2et∕2 + C.

We still need to figure out C . We know that when t = 0 , then x = 0 . That is, x(0) = 0 . So

0 = x(0) = 2e0∕2 + C = 2 + C.

Thus C = -2 and

x (t) = 2et∕2 - 2.

Now we just plug in to get where the car is at 2 and at 10 seconds. We obtain

x(2) = 2e 2∕2 - 2 ≈ 3.44 meters, x (10 ) = 2e10∕2 - 2 ≈ 294 meters.

Example 1.1.6: Suppose that the car accelerates at a rate of t2m∕s2 . At time t = 0 the car is at the 1 meter mark and is traveling at 10 m/s. Where is the car at time t = 10 .

Well this is actually a second order problem. If x is the distance traveled, then x′ is the velocity, and x′′ is the acceleration. The equation with initial conditions is

 ′′ 2 ′ x = t, x(0) = 1, x (0) = 10.

What if we say x′ = v . Then we have the problem

v′ = t2, v(0 ) = 10.

Once we solve for v , we can integrate and find x .

Exercise 1.1.1: Solve for v , and then solve for x . Find x(10) to answer the question.

1.1.1 Exercises

Exercise 1.1.2: Solve dy 2 dx = x + x for y(1) = 3 .

Exercise 1.1.3: Solve dy = sin(5x) dx for y(0) = 2 .

Exercise 1.1.4: Solve ddyx = x12-1- for y(0) = 0 .

Exercise 1.1.5: Solve y′ = y3 for y(0) = 1 .

Exercise 1.1.6 (little harder): Solve  ′ y = (y - 1)(y + 1 ) for y(0) = 3 .

Exercise 1.1.7: Solve dy dx = y1+1 for y(0) = 0 .

Exercise 1.1.8 (harder): Solve y′′ = sin x for y(0) = 0 , y′(0) = 2 .

Exercise 1.1.9: A spaceship is traveling at the speed  2 2t + 1 km/s (t is time in seconds). It is pointing directly away from earth and at time t = 0 it is 1000 kilometers from earth. How far from earth is it at one minute from time t = 0 ?

Exercise 1.1.10: Solve dx = sin(t2) + t dt , x(0) = 20 . It is OK to leave your answer as a definite integral.

Exercise 1.1.101: Solve dy x dx = e + x and y(0) = 10 .

Exercise 1.1.102: Solve x′ = 1x2 , x(1) = 1 .

Exercise 1.1.103: Solve x′ = -1-- cos(x) , x(0) = π 2 .

Exercise 1.1.104: Sid is in a car traveling at speed 10t + 70 miles per hour away from Las Vegas, where t is in hours. At t = 0 , Sid is 10 miles away from Vegas. How far from Vegas is Sid 2 hours later?

Exercise 1.1.105: Solve y′ = yn , y(0) = 1 , where n is a positive integer. Hint: You have to consider different cases.