DIFFERENTIAL EQUATIONS COURSE NOTES, LECTURE 2: TYPES OF DIFFERENTIAL EQUATIONS, SOLVING SEPARABLE ODES. ANDREW SALCH. PDEs and ODEs, order, and linearity. Differential equations come in so many different kinds that you really need a variety of tools in order to solve many of them; different types of differential equation require different tools in order to solve. So before we get serious about solving differential equations, we need to have some idea of what the basic types of differential equations are that we might encounter. Definition.. A differential equation is called an ordinary differential equation, or an ODE, if all the derivatives in the equation are derivatives with respect a single variable. In other words, all the derivatives are ordinary derivatives, not partial derivatives. A differential equation is called a partial differential equation, or a PDE, if it involves derivatives with respect to more than one variable. In other words, at least one of derivatives in the equation is a partial derivative. The order of a differential equation is the largest integer n such that that an nth order derivative appears in the equation. An ODE is called linear if it can be put into the form f n (t) dn y dt n + f n(t) dn y dt + + f (t) n dt + f 0(t)y = g(t) for some nonnegative integer n and some set of functions f n (t), f n (t),..., f (t), f 0 (t), g(t). (It does not matter that the variables are called y and t in this definition; all that is important is that t is the independent variable and y is the dependent variable, i.e., y is the function you actually want to solve for. If the variables were called q and x instead of y and t, for example, this ODE would still be linear.) A first-order ODE is called separable if it can be put into the form dt = f (y)g(t) for some functions f (y) and g(t). (Again, it does not matter that the variables are called y and t in this definition; all that is important is that t is the independent variable and y is the dependent variable.) This semester we will almost exclusively focus on ODEs; usually you don t start to work significantly with PDEs until you take a second semester of differential equations. The general tendency that we will see over the semester is that linear ODEs are much, much easier to solve than nonlinear ODEs. Separable ODEs are also very approachable, and they are the first type of ODE that we will stu. Date: September 205.
2 ANDREW SALCH Example.2. = xy is a first-order, linear, separable ODE. = x2 y is a first-order, linear, separable ODE. = x2 y + is a first-order linear nonseparable ODE. (It is linear because you can write it as x2 y =. It is nonseparable because you cannot write x 2 y + as a product of a function of x with a function of y.) = xy2 is a first-order nonlinear ODE. It is nonlinear because we have y 2 appearing in it; even if we subtract xy 2 from both sides to get xy2 = 0, we still can t write xy 2 as some function of x times y; it would have to be a function of x times y 2, or a function of both x and y, times y. = (sin x)(sin y) is a first-order nonlinear separable ODE. = (sin(xy)) is a first-order nonlinear nonseparable ODE. (It is nonseparable because you cannot write sin(xy) as a product of a function of x with a function of y. The function sin(xy) is definitely not equal to (sin x)(sin y), for example, and with a little bit of thought you can prove it isn t equal to f (x)g(y) for any functions f (x) and g(y) whatsoever.) x d2 y 2 + + y = 0 is a second-order linear ODE. (In a few weeks, we will be stuing this one, and others like it; this one describes the motion of a container on a spring which is being loaded with additional mass while it is bouncing on the spring, for example, a truck which is moving up and down on its suspension while it is being loaded.)
DIFFERENTIAL EQUATIONS COURSE NOTES, LECTURE 2: TYPES OF DIFFERENTIAL EQUATIONS, SOLVING SEPARABLE ODES.3 x d2 y 2 + y + y = 0 is a second-order nonlinear ODE. (It is nonlinear because of the term y, which you cannot write as y times a function of x, and which you cannot write as a times a function of x either.) ( du d 2 ) dt c u d2 u 2 d2 u = 0, 2 dz 2 where c is a constant, is a second-order PDE. (This is an important one: it is called the heat equation, since if u(x, y, z, t) is the temperature of a material at time t and at spatial position (x, y, z), then u is (for most materials) a solution to the heat equation.) Remark.3. How can you tell that an ODE isn t separable? It s very plain that = (sin x)(sin y) is separable, but how can we be sure that = (sin(xy)) isn t separable, i.e., that the function sin(xy) can t be written as f (x)g(y) for some functions f (x) and g(y), using some exotic trigonometric tricks that aren t obvious? The answer is as follows: suppose that sin(xy) = f (x)g(y) for some functions f (x) and g(y). Then plug in for x to get that sin(y) = f ()g(y), i.e., g(y) = sin y f (). Plug in for y to get that f (x) = sin x g(). Consequently, sin(xy) = f (x)g(y) = Now plug in x = π = y to get 0 = sin(π) = (sin π)(sin π) f ()g() (sin x)(sin y). f ()g() = (sin π) 2 f ()g(), which is impossible, no matter what the constant f ()g() is, since π is not an integer multiple of π, hence the angle π in the unit circle does not sit exactly on the horizontal axis, hence sin π is nonzero, hence (sin π) 2 cannot be zero. So sin(xy) = f (x)g(y) is impossible, no matter what the functions f (x) and g(y) are chosen to be. Another example from Example.2 was = x2 y +. How can we be sure that x 2 y + cannot be written as f (x)g(y) for some functions f (x) and g(y)? Let s try to do similar things to what we just did for sin(xy): suppose that x 2 y + = f (x)g(y), and let s try to solve for f (x) and g(y). Again, plug in x = to get that y + = f ()g(y), so g(y) = y+ f (), and plug in y = to get that x 2 + = f (x)g(), so f (x) = x2 + g(). Hence: x 2 y + = f (x)g(y) = (x2 + )(y + ). f ()g()
4 ANDREW SALCH Now plug in x = 0 = y to get i.e., f ()g() =, and hence = f ()g(), x 2 y + = (x 2 + )(y + ) = x 2 y + y + x 2 +, hence y + x 2 = 0, which is plainly untrue, the function y + x 2 is not the zero function (it is nonzero when y = and x =, for example, or for most other choices of x and y as well). So it cannot possibly be true that x 2 y + = f (x)g(y) for any functions f (x) and g(y), since if it were true, it implies something we alrea know to be false. (This is called a proof by contrapositive in mathematics.) 2. Solving separable ODEs. Here is how to solve the separable ODE = f (x)g(y). First, multiply by (see Remark 2. if this makes you uneasy) and divide by g(y) to get the expression = f (x), g(y) then integrate: g(y) = f (x). Now you have to compute the antiderivatives g(y) and f (x), and then solve for y in terms of x. As you know, computing antiderivatives can be trivially easy, or it can be an utter nightmare, so this method for solving separable ODEs is simple in spirit but can be anywhere from trivially easy to impossibly hard to actually do in practice, depending on the separable ODE in question. Remark 2.. You should be asking why the expression = f (x) g(y) makes any sense at all (what is sitting on its own like that? What does it even mean?), and why we are justified in then putting an integral sign on each side to get g(y) = f (x). Your textbook (at the end of section 2.) gives you one explanation of why this method is actually justified, i.e., why = f (x)g(y) implies that g(y) = f (x). But there s a more conceptually satisfying answer, which unfortunately is beyond the scope of this course, it would be too long of a detour to really go into this material: expressions like and f(x) actually make sense, these are actually well-defined mathematical objects which you can manipulate, set equal to one another, integrate, and so on. They are called differential -forms and their natural home is called the de Rham complex. If you had a sufficiently thorough vector calculus course, you have alrea seen differential forms, and might have even heard mention of the de Rham complex. You are welcome to
DIFFERENTIAL EQUATIONS COURSE NOTES, LECTURE 2: TYPES OF DIFFERENTIAL EQUATIONS, SOLVING SEPARABLE ODES.5 read more (there is a Wikipedia page on differential forms, for example, which is a good place to start if you re curious) and/or ask me more about these things if you re interested. The upshot of all of this is that there is a place in which an algebraic manipulation like multiply by actually makes sense, is well-defined, and that s where you are actually working when you use this method to solve separable ODEs. Of course, you don t need to know what the de Rham complex actually is to use this method to solve separable ODEs! Example 2.2. Let s solve the separable ODE = xy. Using the steps described above, we get y = x, ln y = 2 x2 + c, y = e 2 x2 +c y = ±e 2 x2 +c = (±e c )e 2 x2. Here are some things to note about these steps: I only kept track of one of the constants of integration c when I took the two integrals. That s because, even if I had written down a constant on each side, I would have immediately just subtracted the constant on one side from the constant on the other, to combine them and just have a single constant on one side. So taking both of these integrals at once really only requires that you keep track of a single constant of integration, not two different ones. At the end, I get the solution y = e c e 2 x2 to the original ODE. Note that, since c is a constant, ±e c is also a constant, and note that ±e c could be any number whatsoever, except zero: e x never takes the value zero (that s why ln 0 isn t defined). And yet y = 0e 2 x2 = 0 is definitely a solution to the ODE = xy, since the derivative of 0 is 0, and x times 0 is 0. So what happened? Why do we seem to be missing the solution y = 0 to our ODE when we get around to y = (±e c )e 2 x2? The answer is in the step when we multiplied by and divided by y: when we divided by y, we were assuming that y is not the zero function so that we could divide by it! This is typical when solving separable ODEs: right at the start, you often have to divide by something, and then are sometimes missing a solution (often y = 0) from your answer, corresponding to the case where what you divided by is equal to zero. So it s worth being careful about this, to avoid missing a solution! Now let s solve the separable ODE = (cos x)y2, and let s throw in a twist: suppose we want to find a solution y such that y(0) is some prescribed number, say, y(0) = 7. This is called an initial value problem.
6 ANDREW SALCH To solve an initial value problem, first you work out the general solution to the ODE as usual: = (cos x)y2, y = cos x, 2 y = (sin x) + c, y = (sin x) + c. Now, just for fun and just to be careful, let s check and make sure we didn t make a mistake: let s make sure that this function y = really is a solution to the ODE = (cos x)y2. So let s compute : = d ( ) (sin x) + c = d ( ) ((sin x) + c) = ((sin x) + c) 2 (cos x) ( = (cos x) (sin x) + c ) 2, (sin x)+c exactly as we wanted! Now let s handle the initial value y(0) = 7. We just plug it into our solution and solve for the constant c: 7 = y(0) = (sin 0) + c = c, so c = 7. So the function y satisfying = (cos x)y2 and also satisfying y(0) = 7 is the function y =. (sin x) 7 Now here s an example of a separable ODE where trouble arises when we try to solve it. Let s solve the separable ODE = x + y. 2
DIFFERENTIAL EQUATIONS COURSE NOTES, LECTURE 2: TYPES OF DIFFERENTIAL EQUATIONS, SOLVING SEPARABLE ODES.7 We go through the usual steps: = x + y 2 ( + y 2 ) = x y + 3 y3 = 2 x2 + c. Suddenly we re in trouble: how do you solve y + 3 y3 = 2 x2 + c for y in terms of x? This is impossible to do globally and can only be done piecewise (just like how, when you solve y 2 = x 2 for y, you get the two solutions y = x 2 and y = x 2, not just a single solution), and even solving for those piecewise solutions is a nasty algebraic problem. This is not unusual when solving separable ODEs. However, once you have reduced the problem of solving the ODEs to the purely algebraic problem of solving some expression for y in terms of x, you have boiled all the differential equations and calculus out of the problem, and reduced it to a pure algebra problem; so from the point of view of this course, your work is done, and this semester you are welcome to leave your solutions in a form like y + 3 y3 = 2 x2 + c instead of trying to solve for y in terms of x. People sometimes say that y + 3 y3 = 2 x2 + c is an implicit solution to the ODE = x, and all this +y 2 semester, whenever you encounter a problem where it is very difficult to solve an implicit solution for y in terms of x, you are welcome to leave your answer as an implicit solution. Here is another example of a separable ODE where trouble arises, in a different way, when we try to solve it. Let s solve the separable ODE = x(). We go through the usual steps: = x() = x. Now x = 2 x2 + c, of course, but is more problematic. You can try all the integration techniques you know of integration by substitution, integration by parts, trigonometric tricks, etc. but you will find that none of them work on the integral. This is because, while the function exists, it is not expressible in terms of elementary functions: there is no way to take a sum, product, or composite of any number of polynomials, trig functions, inverse trig functions, exponential functions, and logarithms in order to get the function. (It is indeed possible to prove this, but proofs of facts like this are quite difficult, and definitely beyond the scope of this course.) To describe, the best you can do is to give a Taylor series expansion of (and that much, at least, is actually doable). What this means is that the separable ODEs you will solve in your textbook and in our class will all be chosen to avoid this phenomenon, so that you can always
8 ANDREW SALCH use the integration methods you know to get the necessary antiderivatives. Of course, you re taking this class because you re going to use differential equations in practice in your work in mathematics/chemistry/engineering/whatever else, and real life is often not nice enough to make sure it only gives you problems involving integrals you know how to solve. When you encounter a separable ODE in nature which leads to an antiderivative f (x) that you find you are unable to solve using the usual integration methods, write out the Taylor series for f (x) centered at some reasonable point x = a (often x = 0 is a reasonable choice), and then integrate the Taylor series, using the power series integration methods you learned in your second semester of calculus. Then you at least have the Taylor series of f (x), which you can work with. We will not ever do exactly that in this class, but we will be working with power series a lot when we get close to the end of the semester.