# 2nd order differential equation with limits

Solve the differential equation $\frac{d^2y}{dx^2}-2\frac{dy}{dx}-3y=2e^{-x}$ given that $y\rightarrow0$ as $x\rightarrow \infty$ and that $\frac{dy}{dx}=-3$ when $x=0$

My attempt,

I've already solved the equation which is $y=Ae^{3x}+Be^{-x}-\frac{1}{2}xe^{-x}$ So, when $y$ approaches infinity. $A$ will become 0. Then, when $\frac{dy}{dx}=-3$ and $x=0$, I got $B=3$

But the given answer is $\frac{5}{2}e^{-x}-\frac{1}{2}xe^{-x}$. Why?

• Because your calculation was incorrect. – Qiyu Wen Jun 24 '16 at 13:49
• Hope you can correct me @QiyuWen – Mathxx Jun 24 '16 at 13:55

$$\frac{dy}{dx}=3Ae^{3x}-B e^{-x} - \frac{e^{-x}}{2} + \frac{1}{2}xe^{-x}$$
If $A=0$ and we evaluate $y'(0)=-3$, we obtain
$$-B-\frac{1}{2}=-3$$
Thus $B=5/2$.