# Solving a Diffrential Equation by Taking Derivative

Taking a derivative of a differential equation and solving it is one approach to solving a differential equation. However, for some reason I can't get this method to work in cases where there is an interaction term.

Let's consider the differential equation:

$$y'+yx=0$$

Derived with respect to x we have:

$$y''+y'x+x'y = 0$$

$$\rightarrow y'' +y'x+y=0$$

If the differential equation is solved the answer is different for the equations above. Is there something that I am missing when taking the derivative of the equation?

• Hey. Let me check, if I understand your question correctly. You have the equations $y'+yx = 0$ and $y'' + y'x + y = 0$, and you expect them to have the same solution, because one equation is just the derivative of the other. Is this correct? Can you include in your post what different solutions you get for the two equations and how? – Mankind Dec 12 '15 at 20:42
• @HowDoIMath Yes, you have it right. It is possible that the approach is erroneous, but it seemed to work at least for equations with no interaction term. I will post the solutions. – Dole Dec 12 '15 at 20:45
• Both equations have the solution $y=Ae^{-x^2/2}$. The second equation has another linearly independent solution, $y = Be^{-x^2/2}erf(x/\sqrt{2})$ that was introduced in the differentiation. – rogerl Dec 12 '15 at 20:51

if the D.E is $y'+xy=0$, the solution is $$y=c_1e^{\frac{-x^2}{2}}$$
if the D.E is $y''+xy'+y=0$, the solution is $$y=c_1e^{\frac{-x^2}{2}}+\sqrt{\frac{\pi}{2}}c_2e^{\frac{-x^2}{2}}erfi(\frac{x}{\sqrt{2}})$$ so that $erfi(x)$=imaginary error function
to find the $c_2$ $$y'=-c_1xe^{\frac{-x^2}{2}}-x\sqrt{\frac{\pi}{2}}c_2e^{\frac{-x^2}{2}}erfi(\frac{x}{\sqrt{2}})+\sqrt{\frac{\pi}{2}}c_2e^{\frac{-x^2}{2}}\sqrt{\frac{2}{\pi}}e^{\frac{x^2}{2}}$$ $$y'=-c_1xe^{\frac{-x^2}{2}}-x\sqrt{\frac{\pi}{2}}c_2e^{\frac{-x^2}{2}}erfi(\frac{x}{\sqrt{2}})+c_2$$ substitute it in $y'+xy=0$, to get $$c_2=0$$ so the solution will stay without any change