# Ordinary Differential Equation Strategy

In one of the examples in the Differential Equations for Dummies Workbook (Holzner), you are asked to use an integrating factor to solve $$\frac{dy}{dx} +2y =4$$

My question is, is this the most efficient way to solve it? Can't I also solve it by separating the $y$, turning the equation into $\frac{1}{2-y}\frac{dy}{dx} = 2$. Are there other ways? How do you quickly determine what will be the quickest way?

-

The quickest way to solve this is to note $\lambda+2=0$ gives $\lambda=-2$ hence $y_h = e^{-2x}$ and eyeballin-it shows $y_p = 2$ hence $y = c_1e^{-2x}+2$.

-
Can you please explain that further? What does λ represent? – CodyBugstein Oct 4 '12 at 17:36
Sure, when we solve a constant coefficient ode we can solve it by looking at the characteristic equation. For example, $y''-y=0$ gives $\lambda^2-1=0$ hence $\lambda = \pm 1$ which tells me $y = c_1e^t+c_2e^{-t}$. Perhaps you will study this soon in your course. The other part $y_p$ is called the particular solution. If you haven't studied these yet then separation of variables is probably better, or the integrating factor method for more complicated linear odes. – James S. Cook Oct 4 '12 at 17:41
I just found math.stackexchange.com/questions/30812/second-order-des maybe these help explain without me reinventing the wheel here... – James S. Cook Oct 4 '12 at 17:44
Or, math.stackexchange.com/questions/161421/… also seems relevant. Usually people don't emphasize the utility of the method for the first order ODEs, but it applies for the constant coefficient case $ay'+by=g$ but finding $y_p$ to produce $g$ is tough in general (well, it's an integral). – James S. Cook Oct 4 '12 at 17:47
Awesome thanks! I'm reading up on it now... – CodyBugstein Oct 4 '12 at 17:59

Another to solve it would be to use the characterstic equation which is what the above answer used:

z^2 + 2z - 4 = 0.

You can factor this equation and the general solution is would by using the general formula provided in any ODE text.

However, integrating factors do not require you to remember a formula and in most situations this technique is more elegant and quick.

-
That characteristic equation is wrong... – Hans Lundmark Oct 21 '12 at 11:16

You can separate variables, thus: $$\frac{dy}{dx} = 4-2y$$ $$\frac{dy}{2-y} = 2\,dx$$ $$-\log|2-y| = 2x+\text{constant}$$ $$|2-y|=e^{-2x-\text{constant}} = (e^{-2x}\cdot(\text{positive constant}))$$ $$2-y = e^{-2x}\cdot\text{constant}$$ $$y = 2-(e^{-2x}\cdot\text{constant})$$

As for integrating factors, notice that you have $y'+2y$ and after multiplying by some factor---call it $w$---you have $wy'+(2w)y$ and you want $wy'+w'y$, so that it becomes $(wy)'$. So you need $w'=2w$. That's a differential equation, one of whose solutions is $w=e^{2x}$. And you only need one of its solutions.

-