Want to understand differential equations...how to solve this basic differential equation?

So I put the differential equation $y' = xy$ into Wolfram Alpha and it tells me the solution is $$y(x) = c_1\,e^\frac{x^2}{2}$$

• Can anybody explain to me how to sub this back into the original equation so as to verify it is the solution?
• And was the solution arrived at in the first place?

I really need to get a differntial equations book out of the library and go through it, which is what I plan to do at xmas when I have the time...but in the meantime I would appreciate if someone could explain this particular problem to me as it is starting to annoy me that I don't understand this stuff when doing numerical analysis (even though we can get by without knowing it).

• You must mean $y=c_1e^{\frac{x^2}{2}}$. It is easy to check that this works by differentiating. We get $y'=c_1xe^{x^2/2}$ (Chain Rule), which is indeed equal to $xy$. This is an example of a separable DE. Oct 19 '12 at 1:27
• The important thing is that, supposing $y(x)>0$ (or $<0$) in a vicinity of $x$, you can divide both sides of the ode by $y$ and use the chaing rule to write the left side as (case $y >0$) $$\frac{d}{dx} \log \big(y(x)\big)$$ and integrate both sides of the equation. Why don't you do the case $y<0$? Oct 19 '12 at 1:37

To check it's a solution: find $y'=dy/dx$, and check that it takes the value of $xy$. If it does, it's a solution.
$$\frac{dy}{dx}=xy\Leftrightarrow \frac{1}{y}\frac{dy}{dx}=x\Leftrightarrow\int\frac{1}{y}\frac{dy}{dx}{dx}=\int x\ dx$$ $$\Leftrightarrow\int \frac{dy}{y}=\frac{x^{2}}{2}+c\Leftrightarrow ln(y)=\frac{x^{2}}{2}+c$$
Then exponentiating, we get that the solution is $y=e^{x^{2}/2 + c}=Ae^{x^{2}/2}$, where the constant $A$ is $A=e^{c}$.
$\frac{dy}{dx} = xy$. $\frac{dy}{y} = xdx$. Integrating the both sides, we get log $y = \frac{x^2}{2} + c$. Hence $y = e^c e^\frac{x^2}{2}$.