4
$\begingroup$

I'm trying to solve the differential equation $\frac{dy}{dx} = -xy$.

So far I've got:

$\frac{dy}{dx} = -xy$

$-xy\;dx = dy$

$\frac{1}{y}\;dy = -x\;dx$

$\ln(|y|) = -\frac{1}{2}x^2 + c$ (I combined both integration constants into one)

$y = e^c e^{-\frac{1}{2}x^2}$ or $y = -e^c e^{-\frac{1}{2}x^2}$

It looks correct, but I'm missing one particular case: $y = 0$.

$e^c$ is always positive, and thus is $-e^c$ always negative. Using both, I've included all solutions except $y = 0$.

For $y = 0$, the differential equation does hold though: $\frac{dy}{dx} = 0$ for any $x$, and $-xy = 0$ for any $x$ as well.

What am I missing in my computation?

  • 0
    I shall be stealing that last analogy, @Michael, if you don't mind...2011-09-10

2 Answers 2

4

A "general" solution of a differential equation often misses some particular cases, which might be obtained as limits where a parameter goes to $+\infty$ or $-\infty$. In this case you would take $c \to -\infty$ so $e^c e^{-x^2/2} \to 0$. Or you could identify $\pm e^c$ as a new parameter $A$, giving you the solution $y = A e^{-x^2/2}$ (and of course the case $A=0$ works, even though it isn't a value of $\pm e^c$).

5

The equation is y'+xy=0. Usually I don't like to divide by $y$, instead, try and make this the derivative of some function by multiplying with an exponential. In this case

e^{x^2/2}y'+xe^{x^2/2}y=0 \Leftrightarrow (e^{x^2/2}y)'=0

This means that there exists $c$ such that $e^{x^2/2}y=c$ and therefore $y=ce^{-x^2/2}$, and you didn't miss any of the cases.

Of course, the method doesn't work all the time, but this is a linear first order equation, and it is always solvable like this, and there even is a direct formula for solving y'+p(x)y=q(x) when $p,q$ are continuous:

$ \int q(x)dx \cdot e^{-\int p(x)} $

  • 0
    And how do you know what to multiply by in situations like this? The trick is to take your suspected solution -- which will involve a constant of integration $c$ -- solve for $c$, then differentiate both sides of this equation. In this case you differentiate (both sides of) the equation $c=e^{x^2/2}y$, which gives $0=e^{x^2/2}\left[\frac{dy}{dx}+xy\right]$. So multiplying across by $e^{x^2/2}$ is what works in this case. In other situations the function may not be defined at all points $x$, or might involve $y$ which may make things a little trickier.2011-09-09