# Solving ODE with conditions

I was reading some of my notes and I was not sure how the following works:

$\frac{d^2y}{dx^2} + \frac{dy}{dx} = 0$

Solve the above with the condition $y(0)=0$

$\Rightarrow y(x) = A(1-e^{-x})$ with $A$ an arbitrary constant.

I was just wondering how do you solve the above to get $y(x) = A(1-e^{-x})$? Because when I tried it, I got: $y=A + Be^{-x}$, and using the condition $y(0)=0$, I got $A+B =0$.

-

If $A+B=0$ then we have $B=-A$; plug this in and you have $y=A-Ae^{-x}=A(1-e^{-x})$.

-
Thanks! Assuming I substituted $B$ into the equation, and I got $y = -B + Be^{-x} = B(-1 + e^{-x})$, would the answer be "the same"? – Heijden Mar 15 '12 at 19:40
@Heijden: Yes, because $B(-1+e^{-x})=(-A)(-1+e^{-x})=A(1-e^{-x})$. – anon Mar 15 '12 at 19:43
Okay, thanks anon, appreciated. – Heijden Mar 15 '12 at 19:52

Well the above answer is correct. which is $y=A(1-e^{-x})$

If you are interested in knowing how you solve a second order differential equation.

I suggest you check http://www.math.ucsd.edu/~yuz009/File%201.pdf for instance (there might be many other resources). But this one on page 3 gives a clear example, First you have to get an auxiliary equation, and in this case it is $r^2+r=0 \Rightarrow r(r+1)=0 \Rightarrow r=0,-1$, therefore the answer is $y=Ae^{0}+Be^{-x}$ and then applying the initial condition $y(0)=0$, you get $0=A+B$ and therefore $B=-A$, thus the solution $y=A(1-e^{-x})$.

-
Ok thanks for your help, and for the pdf link. It will prove useful. :) – Heijden Mar 15 '12 at 19:51