# Solving linear inhomogeneous differential equation

I wanted to solve $$y''-2y'-3y=4e^{-x}+1$$ for which I got the homogeneous solution $$y_h=C_1e^{-x}+C_2e^{3x}, \quad C_1,C_2 \in \mathbb R.$$

Then by plugging particular solution of the form $$y_p=Ae^{-x}+Bx^2+Cx+D$$ and it's derivatives into my differential equation I get $$Ae^{-x}+2B+2Ae^{-x}-4Bx-2C-3Ae^{-x}-3Bx^2-3Cx-3D=4e^{-x}+1$$ which reduces to $$-3Bx^2-x(4B+3C)+2B-2C-3D=4e^{-x}+1$$ which could never hold true since the $$A$$ terms vanished. What did I do wrong?

• You already have $e^{-x}$ in the homogeneous solution. Then ... – Claude Leibovici Jun 22 '19 at 13:48
• Are you sure about the DE having the third derivative $y'''$? – user10354138 Jun 22 '19 at 13:49
• @user10354138 thanks, typo – Tesla Jun 22 '19 at 13:59

## 4 Answers

Hint: Compute the complementary solution by the ansatz $$y=e^{\lambda x}$$ The solution is given by $$y=C_1e^{-x}+C_2e^{3x}$$. For the particular solution make the ansatz $$y_P=a_1+a_2xe^{-x}$$ A possible solution is given by $$y_p=-e^{-x}x-\frac{1}{3}$$

• The OP has already found the complementary solution. – amd Jun 22 '19 at 19:10

First off, I presume you mean $$y''$$ instead of $$y'''.$$ Next, you must modify your guess because both your homogeneous solution and the right-hand side of your ODE contain $$e^{-x}$$. Instead, try to guess $$A+Bxe^{-x}$$ for the particular solution.

$$y''-2y'-3y=4e^{-x}+1$$ You have going your $$y_h$$ correctly.

For your $$y_p$$ you need to consider $$y_p=Axe^{-x}+B$$ and find $$A$$ and $$B$$

I found $$A=-1$$ and $$B=-1/3$$

$$y_p=-xe^{-x}-1/3$$

$$y''-2y'-3y=4e^{-x}+1\implies (D^2-2D-3)y=4e^{-x}+1\qquad \text{where}\quad D\equiv \frac{dy}{dx}$$

Another approach for P.I.

P.I.$$\quad = \frac{1}{D^2-2D-3}(4e^{-x}+1)$$

$$=4\frac{1}{D^2-2D-3}e^{-x}+\frac{1}{D^2-2D-3}\cdot 1=4e^{-x}\frac{1}{(D-1)^2-2(D-1)-3}\cdot 1-\frac{1}{3}(1+\frac{2}{3}D-\frac{1}{3}D^2)^{-1}\cdot1$$

$$=4e^{-x}\frac{1}{D^2-4D}\cdot 1-\frac{1}{3}$$

$$=-e^{-x}\frac{1}{D}(1-\frac{D}{4})^{-1}\cdot 1 -\frac{1}{3}$$

$$=-e^{-x}\frac{1}{D} \cdot 1 -\frac{1}{3}$$

$$=-xe^{-x}-\frac{1}{3}$$

Consider a differential equation of the form $$f(D)y=X$$

If $$X=e^{ax}$$, then

$$1.$$ P.I.$$\quad = \frac{1}{f(D)}e^{ax}=\frac{e^{ax}}{f(a)}$$, if $$f(a)\neq 0$$

$$2.$$ P.I.$$\quad =\frac{1}{f(D)}e^{ax}=e^{ax} \frac{1}{f(D+a)}\cdot 1$$, if $$f(a)= 0$$