ODE never ends. It's implied on day one of Calc-I, and it doesn't finish until you are cold in the ground. The big pile of integration techniques you learn in Calc-II is the first real hint something mean is skulking in the shadows, although the term "differential equation" usually only officially appears somewhere in Calc-III. And Calc-IV is really just another name for A First Course in Ordinary Differential Equations or at least it was in my undergrad, which I seem to recall was also the title of the terrible terrible $200 textbook required for the course. Written by one of the math department faculty who retired early, presumably to go play naked in his big pile of required textbook money.
If you still haven't had enough, you might have then taken an upper-division ODE course (ours was taught out of Braun, which I wasn't thrilled with generally, although it does have a nice collection of interesting applications such as the Van Meergeren art forgeries and Lanchestrian combat models). After that comes numerical methods, and perhaps a course in PDE, the latter forever the Rodney Dangerfield of mathematics ever since finite element escaped from the lab. Of course, you were also seeing ODE in your other coursework, at least occasionally, with pretty much every problem in physics and engineering a mass-spring system in disguise.
The whole thing is such a never-ending forest that it's hard to remember all the trees, or at least a path through them. And whether on a job interview or just making small talk with the barmaid, how silly will you feel after eight semesters and six-figures of tuition if you sit speechless when they bust out some basic ODE for you to solve?
Answer: pretty darn silly.
Well, LabKitty is here to help. I've distilled years of ODE training into a pert collection of Things to Try if and when you stumble across an ODE in the wild. A handy plan-of-attack for you to carry around in your back pocket. It's not going to make you invincible -- there may always be some clever trick required to solve a given problem that eludes you regardless of your skill level. Nor is this going to make much sense unless you have already sat through a real course. Our goal here is big picture. Our goal here is flow-chart knowledge. Our goal here is retainment. Think of it as an ODE app for your brain. The free version, except without all the cloying advertisements.
In this our first installment: first-order equations. Equations of the form
dy/dx + P(x,y) = Q(x,y)
You should be able to at least grapple with a first order, at least bloody its nose, even if eventually it stomps you to death. Heck, first order ODE are the Sudoku of differential equations, providing hours of Saturday night entertainment in lieu of dating. In a future installment we might take a swing at higher-order equations (and we will find our options for fun are much more limited). But that is a story for another time.
First off, a handy mnemonic: SMs/EMe
Rolls off the tongue, it does. Expanding: Separable / Make it separable. Exact / Make it exact.
Given any first-order ODE, ask four questions in the following order:
1) Is the ODE separable?
2) If not, can it be made separable?
3) If not, is it exact?
4) If not, can it be made exact?
We now consider sample problems showing how the patented LabKitty ODE Mnemonic system (tm) works.
1) Is it SEPARABLE?
In a first-order ODE you can treat the derivative as a fraction and rearrange it algebraically however you like. This is calculus heresy (the derivative is not a "fraction"), but it's heresy that gives the right answer (important: this trick doesn't work for higher-order derivatives nor any-order partial derivative). This also means a first-order ODE might be given in the form N(x,y) dx + M(x,y) dy = wawa from the get-go. FYI.
Example: dy/dx = (1 + y2 ) / (1 + x2)
dy / (1 + y2 ) = dx / (1 + x2)
∫ 1 / (1 + y2 ) dy = ∫ 1 / (1 + x2) dx
arctan(y) = arctan(x) + C
Solving for y
y = tan(arctan(x) + C) = (x + arctan(C)) / (1 – x ⋅ arctan(C)) = (x + C) / (1 – xC)
Footnote: Setting C = arctan(C) is constant-of-integration abuse typical of ODE solutions. You would solve for C to satisfy the initial condition, if I had bothered to supply one, which I did not here and neither will subsequently. Also, this solution makes use of tan(foo + bar) = [ tan(foo) + tan(bar) ] / [ 1 – tan(foo) ⋅ tan(bar) ]. Trig identities are your friend. The more you remember, the easier your calculus life will be.
2) The ODE is not separable as given. Can it be MADE separable?
Try substituting: y = vx (mini-mnemonic: vx nerve gas) and dy = v dx + x dv. Now is it separable?
This will work for an ODE of the form N(x,y) dx + M(x,y) dy if M and N are homogeneous to the same order (homogeneous in the sense: f(λx,λy) = λn f(x,y) not homogeneous in the RHS = 0 sense -- yes, there's two different meanings of the term).
Example: 2xy dy/dx − x2 + y2 = 0
2xy dy = (x2 − y2) dx
2x(vx) (v dx + x dv) = (x2 – v2x2) dx
2v dv / (1 − 3v2) = dx / x
Solution continues as a separable equation. Note N and M were both homogeneous of degree two.
3) The ODE is not separable. Is it EXACT?
Recall that if F(x,y) = C, then dF = ∂F/∂x dx + ∂F/∂y dy = 0. If you can massage your equation into this form, you can simply write down the answer F(x,y) = C. (F is called a potential function. FYI). Solve for C using the initial condition, if given.
The classic signature this might work is that the equation contains: x dy + y dx. But formally, an equation N(x,y) dx + M(x,y) dy is exact if ∂N/∂y = ∂M/∂x.
Example: x dy/dx + y = 0
x dy + y dx = 0
d(xy) = 0
xy = C
Footnote: We could have written out the integration here explicitly as ∫ x dy + y dx = ∫ 0 dx (the dx on the RHS is because we multiplied through by dx. We usually don't write this out when the RHS is zero). The LHS in this expression is technically a path integral. You could do a path integral, which nobody does, or you could just remember x dy + y dx = d(xy) and ∫ d(wawa) = wawa + C ∀ wawa. Let's redo the example writing all this out to make a point about constants of integration nobody seems to ever tell you:
Example (again): x dy/dx + y = 0
x dy + y dx = 0 dx
d(xy) = 0 dx
∫ d(xy) = ∫ 0 dx
xy + C1 = C2
xy = C
Note how we merge the two integration constants into a single constant at the end. This is typical constant-of-integration abuse that happens in differential equations (we saw another example of constant abuse back in the very first example). In fact, you are probably so used to doing this sort of thing you don't even give it a second thought anymore (most people would not bother introducing two integration constants to begin with, since we know a first-order ODE solution contains one and only one constant). Still, this was always something that bugged me when I was first learning ODE. Just thought someone should point it out for once.
If that confused the heck out of you, then just remember: if d(wawa) = 0 then wawa = C.
Let's move on.
Sometimes only part of the ODE is exact. In these cases, try to isolate the troublesome stuff on one side of the equation.
Example: (x2 – y) dx + (y3 – x) dy = 0
x2 dx – y dx + y3 dy – x dy = 0
x2 dx + y3 dy = x dy + y dx
∫ x2 dx + ∫ y3 dy = ∫ (x dy + y dx)
x3/3 + y4/4 = xy + C
x3/3 + y4/4 – xy = C
Here I've skipped the step of introducing a constant of integration on each side only to merge it at the end.
4) The ODE is not exact as given. Can it be MADE exact?
Informally: Multiply/divide by something clever, recognize the result as exact. Solve. Formally: we seek an integrating factor. This is usually presented in the context of first-order linear equations -- stay tuned -- but it is in fact a general ODE technique. For first-order linear equations, there is a formula for generating the integrating factor. Alas, finding an integrating factor in the general case is as much an art as it is a science. The key is recognizing sneaky hidden differentials.
Example: x dy + y dx = 2x2y dx
Divide through by xy:
1/y dy + 1/x dx = 2x dx
d(ln | xy |) = 2x dx
∫ d(ln | xy |) = ∫ 2x dx
ln | xy | = x2 + C
SPECIAL CASE: dy/dx + P(x) y = Q(x)
The classic first-order linear equation (i.e., P and Q are functions of x only). This always has integrating factor: exp( ∫ P dx )
Example: dy/dx – xy = x
The equation is of the form: dy/dx + P(x)y = Q(x) w/ P(x) = –x and Q(x) = x. Noting ∫ P dx = ∫ –x dx = –x2/ 2, so an integrating factor is exp(–x2/ 2). Multiplying both side the integrating factor:
exp(–x2/ 2) dy – xy exp(–x2/ 2) dx = x exp(–x2/ 2) dx
d(y exp(–x2/ 2)) = x exp(–x2/ 2) dx
∫ d(y exp(–x2/ 2)) = ∫ x exp(–x2/ 2) dx
y exp(–x2/ 2) = –exp(–x2/ 2) + C
y = C exp(–x2/ 2) – 1
Footnote: Equations of this form are fairly common. For example, a first-order linear equation describes exponential and logistic population growth. Obviously, solution requires you can do the integration to obtain the integrating factor and also do the integration of the RHS, if the RHS is non-zero. You may need to work on your integration skills if they have become rusty. For example, the derivation of the logistic equation leads to integration by partial fractions. If you remember partial fractions, the solution is pretty straightforward. If you don't, you'll probably get stuck.
SPECIAL CASE: dy/dx + P(x) y = Q(x) yn
This is a slightly more general form of the previous special case, in which the RHS now has the form a function-of-x times a power-of-y. It's not that this comes up frequently; it's just one of the few special cases with a fairly easy solution (if you know the trick)
Trick: Substitute z = y1–n. Mini-mnemonic: if you divide through by yn, the term multiplying P becomes y1–n ( = z). Okay, that's not much of a mnemonic -- I'm kinda stuck here.
Example: dy/dx + y = xy2
Divide through by y2:
1/y2 dy/dx + 1/y = x
Substitute z = 1/y (so dz/dx = –1/y2 dy/dx):
–dz/dx + z = x or dz/dx – z = –x
which is first-order linear in z with P(x) = –1 and Q(x) = –x. Solve (integrating factor is exp(–x) and unsub to get:
1/y = x + 1 + Cex
Take Home Message
And there it is. SMs/EMe. To recapitulate, in the following order, we ask:
1. Is the ODE separable?
2. If not, can it be made separable?
3. If not, is it exact?
4. If not, can it be made exact?
SMs/EMe. Plus a couple of special cases.
It won't solve everything. Heck, it won't solve most things. But it will give you a fighting chance.
If you still haven't had enough, you might have then taken an upper-division ODE course (ours was taught out of Braun, which I wasn't thrilled with generally, although it does have a nice collection of interesting applications such as the Van Meergeren art forgeries and Lanchestrian combat models). After that comes numerical methods, and perhaps a course in PDE, the latter forever the Rodney Dangerfield of mathematics ever since finite element escaped from the lab. Of course, you were also seeing ODE in your other coursework, at least occasionally, with pretty much every problem in physics and engineering a mass-spring system in disguise.
The whole thing is such a never-ending forest that it's hard to remember all the trees, or at least a path through them. And whether on a job interview or just making small talk with the barmaid, how silly will you feel after eight semesters and six-figures of tuition if you sit speechless when they bust out some basic ODE for you to solve?
Answer: pretty darn silly.
Well, LabKitty is here to help. I've distilled years of ODE training into a pert collection of Things to Try if and when you stumble across an ODE in the wild. A handy plan-of-attack for you to carry around in your back pocket. It's not going to make you invincible -- there may always be some clever trick required to solve a given problem that eludes you regardless of your skill level. Nor is this going to make much sense unless you have already sat through a real course. Our goal here is big picture. Our goal here is flow-chart knowledge. Our goal here is retainment. Think of it as an ODE app for your brain. The free version, except without all the cloying advertisements.
In this our first installment: first-order equations. Equations of the form
dy/dx + P(x,y) = Q(x,y)
You should be able to at least grapple with a first order, at least bloody its nose, even if eventually it stomps you to death. Heck, first order ODE are the Sudoku of differential equations, providing hours of Saturday night entertainment in lieu of dating. In a future installment we might take a swing at higher-order equations (and we will find our options for fun are much more limited). But that is a story for another time.
First off, a handy mnemonic: SMs/EMe
Rolls off the tongue, it does. Expanding: Separable / Make it separable. Exact / Make it exact.
Given any first-order ODE, ask four questions in the following order:
1) Is the ODE separable?
2) If not, can it be made separable?
3) If not, is it exact?
4) If not, can it be made exact?
We now consider sample problems showing how the patented LabKitty ODE Mnemonic system (tm) works.
1) Is it SEPARABLE?
In a first-order ODE you can treat the derivative as a fraction and rearrange it algebraically however you like. This is calculus heresy (the derivative is not a "fraction"), but it's heresy that gives the right answer (important: this trick doesn't work for higher-order derivatives nor any-order partial derivative). This also means a first-order ODE might be given in the form N(x,y) dx + M(x,y) dy = wawa from the get-go. FYI.
Example: dy/dx = (1 + y2 ) / (1 + x2)
dy / (1 + y2 ) = dx / (1 + x2)
∫ 1 / (1 + y2 ) dy = ∫ 1 / (1 + x2) dx
arctan(y) = arctan(x) + C
Solving for y
y = tan(arctan(x) + C) = (x + arctan(C)) / (1 – x ⋅ arctan(C)) = (x + C) / (1 – xC)
Footnote: Setting C = arctan(C) is constant-of-integration abuse typical of ODE solutions. You would solve for C to satisfy the initial condition, if I had bothered to supply one, which I did not here and neither will subsequently. Also, this solution makes use of tan(foo + bar) = [ tan(foo) + tan(bar) ] / [ 1 – tan(foo) ⋅ tan(bar) ]. Trig identities are your friend. The more you remember, the easier your calculus life will be.
2) The ODE is not separable as given. Can it be MADE separable?
Try substituting: y = vx (mini-mnemonic: vx nerve gas) and dy = v dx + x dv. Now is it separable?
This will work for an ODE of the form N(x,y) dx + M(x,y) dy if M and N are homogeneous to the same order (homogeneous in the sense: f(λx,λy) = λn f(x,y) not homogeneous in the RHS = 0 sense -- yes, there's two different meanings of the term).
Example: 2xy dy/dx − x2 + y2 = 0
2xy dy = (x2 − y2) dx
2x(vx) (v dx + x dv) = (x2 – v2x2) dx
2v dv / (1 − 3v2) = dx / x
Solution continues as a separable equation. Note N and M were both homogeneous of degree two.
3) The ODE is not separable. Is it EXACT?
Recall that if F(x,y) = C, then dF = ∂F/∂x dx + ∂F/∂y dy = 0. If you can massage your equation into this form, you can simply write down the answer F(x,y) = C. (F is called a potential function. FYI). Solve for C using the initial condition, if given.
The classic signature this might work is that the equation contains: x dy + y dx. But formally, an equation N(x,y) dx + M(x,y) dy is exact if ∂N/∂y = ∂M/∂x.
Example: x dy/dx + y = 0
x dy + y dx = 0
d(xy) = 0
xy = C
Footnote: We could have written out the integration here explicitly as ∫ x dy + y dx = ∫ 0 dx (the dx on the RHS is because we multiplied through by dx. We usually don't write this out when the RHS is zero). The LHS in this expression is technically a path integral. You could do a path integral, which nobody does, or you could just remember x dy + y dx = d(xy) and ∫ d(wawa) = wawa + C ∀ wawa. Let's redo the example writing all this out to make a point about constants of integration nobody seems to ever tell you:
Example (again): x dy/dx + y = 0
x dy + y dx = 0 dx
d(xy) = 0 dx
∫ d(xy) = ∫ 0 dx
xy + C1 = C2
xy = C
Note how we merge the two integration constants into a single constant at the end. This is typical constant-of-integration abuse that happens in differential equations (we saw another example of constant abuse back in the very first example). In fact, you are probably so used to doing this sort of thing you don't even give it a second thought anymore (most people would not bother introducing two integration constants to begin with, since we know a first-order ODE solution contains one and only one constant). Still, this was always something that bugged me when I was first learning ODE. Just thought someone should point it out for once.
If that confused the heck out of you, then just remember: if d(wawa) = 0 then wawa = C.
Let's move on.
Sometimes only part of the ODE is exact. In these cases, try to isolate the troublesome stuff on one side of the equation.
Example: (x2 – y) dx + (y3 – x) dy = 0
x2 dx – y dx + y3 dy – x dy = 0
x2 dx + y3 dy = x dy + y dx
∫ x2 dx + ∫ y3 dy = ∫ (x dy + y dx)
x3/3 + y4/4 = xy + C
x3/3 + y4/4 – xy = C
Here I've skipped the step of introducing a constant of integration on each side only to merge it at the end.
4) The ODE is not exact as given. Can it be MADE exact?
Informally: Multiply/divide by something clever, recognize the result as exact. Solve. Formally: we seek an integrating factor. This is usually presented in the context of first-order linear equations -- stay tuned -- but it is in fact a general ODE technique. For first-order linear equations, there is a formula for generating the integrating factor. Alas, finding an integrating factor in the general case is as much an art as it is a science. The key is recognizing sneaky hidden differentials.
Example: x dy + y dx = 2x2y dx
Divide through by xy:
1/y dy + 1/x dx = 2x dx
d(ln | xy |) = 2x dx
∫ d(ln | xy |) = ∫ 2x dx
ln | xy | = x2 + C
SPECIAL CASE: dy/dx + P(x) y = Q(x)
The classic first-order linear equation (i.e., P and Q are functions of x only). This always has integrating factor: exp( ∫ P dx )
Example: dy/dx – xy = x
The equation is of the form: dy/dx + P(x)y = Q(x) w/ P(x) = –x and Q(x) = x. Noting ∫ P dx = ∫ –x dx = –x2/ 2, so an integrating factor is exp(–x2/ 2). Multiplying both side the integrating factor:
exp(–x2/ 2) dy – xy exp(–x2/ 2) dx = x exp(–x2/ 2) dx
d(y exp(–x2/ 2)) = x exp(–x2/ 2) dx
∫ d(y exp(–x2/ 2)) = ∫ x exp(–x2/ 2) dx
y exp(–x2/ 2) = –exp(–x2/ 2) + C
y = C exp(–x2/ 2) – 1
Footnote: Equations of this form are fairly common. For example, a first-order linear equation describes exponential and logistic population growth. Obviously, solution requires you can do the integration to obtain the integrating factor and also do the integration of the RHS, if the RHS is non-zero. You may need to work on your integration skills if they have become rusty. For example, the derivation of the logistic equation leads to integration by partial fractions. If you remember partial fractions, the solution is pretty straightforward. If you don't, you'll probably get stuck.
SPECIAL CASE: dy/dx + P(x) y = Q(x) yn
This is a slightly more general form of the previous special case, in which the RHS now has the form a function-of-x times a power-of-y. It's not that this comes up frequently; it's just one of the few special cases with a fairly easy solution (if you know the trick)
Trick: Substitute z = y1–n. Mini-mnemonic: if you divide through by yn, the term multiplying P becomes y1–n ( = z). Okay, that's not much of a mnemonic -- I'm kinda stuck here.
Example: dy/dx + y = xy2
Divide through by y2:
1/y2 dy/dx + 1/y = x
Substitute z = 1/y (so dz/dx = –1/y2 dy/dx):
–dz/dx + z = x or dz/dx – z = –x
which is first-order linear in z with P(x) = –1 and Q(x) = –x. Solve (integrating factor is exp(–x) and unsub to get:
1/y = x + 1 + Cex
Take Home Message
And there it is. SMs/EMe. To recapitulate, in the following order, we ask:
1. Is the ODE separable?
2. If not, can it be made separable?
3. If not, is it exact?
4. If not, can it be made exact?
SMs/EMe. Plus a couple of special cases.
It won't solve everything. Heck, it won't solve most things. But it will give you a fighting chance.
No comments:
Post a Comment