# 2nd order differential equation question

By finding a suitable particular integral, find the general solution $y$ of the differential equation $\frac{d^2y}{dx^2}+2\frac{dy}{dx}=f(x)$ when

a) $f(x)=3e^{-2x}$

b) $f(x)=1-x^2$

For part a I've done this so far and I'm pretty sure it's wrong…

$$y=De^{-2x}$$

$$\frac{dy}{dx}=-2De^{-2x}$$

$$\frac{d^2y}{dx^2}=4De^{-2x}$$

$$4De^{-2x}-4De^{-2x}=3e^{-2x}$$

• Would it help to integrate both sides first? The first problem can be easily solved directly. – Mike Jan 1 '15 at 21:45

$$\frac{d^2y}{dx^2}+2\frac{dy}{dx}=f(x)$$ by solving $\frac{d^2y}{dx^2}+2\frac{dy}{dx}=0$, The complimentary solution is obtained to be:

$$y_c=C_1+C_2e^{-2x}$$ a) $f(x)=3e^{-2x}$

solving $\frac{d^2y}{dx^2}+2\frac{dy}{dx}=3e^{-2x}$ to obtain the particular solution:

$y_p=Axe^{-2x}$ since we have $e^{-2x}$ in the complimentary solution

$\frac{dy_p}{dx}=Ae^{-2x}-2Axe^{-2x}$

$\frac{d^2y_p}{dx^2}=-4Ae^{-2x}+4Axe^{-2x}$

Substituting gives $A=-3/2$

The general solution is then $$y=C_1+C_2e^{-2x}-3/2e^{-2x}$$

b) for $f(x)=1-x^2$ you use $y_p=Ax+Bx^2+Cx^3$

• Thanks this worked. However for part b I'm getting an answer of $y=Ae^{-2x}+B-1/6x^3+1/4x^2+1/4$ But the answer is apparently $y=Ae^{-2x}+B-1/6x^3+1/4x^2+1/2$, could you check if I'm right or wrong please? – Harry Jan 1 '15 at 21:47
• You forgot $x$ in your general solution. – user137035 Jan 2 '15 at 10:38

It can't work because $-2$ is a root of the characteristic equation. Try $Dx^{-2x}$.

Concerning b), as 0 is also a root of the characteristic equation , try a cubic polynomial.

Let me explain the details: a standard form for $f(x)$ is $p(x)\mathrm e^{\,cx}$, where $p(x)$ is a polynomial of degree $d\ge 0$.

• If $c$ is not a root of the characteristic equation, a solution is $q(x)\mathrm e^{\,cx}$, where $q(x)$ is some polynomial of degree $d$.
• If $c$ is a simple root of the characteristic equation, a solution is $xq(x)\mathrm e^{\,cx}$.
• If $c$ is a double root of the characteristic equation, a solution is $x^2 q(x)\mathrm e^{\,cx}$.

Note that the case of $f(x)=p(x)\cos x$ or $f(x)=p(x)\sin x$ is covered by these cases thanks to Euler formulae.

• Using $Dx^{-2x}$ worked, but how do I know when to use that? – Harry Jan 1 '15 at 21:30
• This is standard. In my updated answer, I give some details. – Bernard Jan 1 '15 at 22:05

Hint: It should be clear that the solutions to the associated homogeneous equation are generated by $y_1 = c_1$ and $y_2 = c_2e^{-2x}$. Since your functions $f(x)$ are an exponential and a polynomial, you can do it by determining the missing coefficients, that is:

• for item a), the first guess would be $Ae^{-2x}$, but since that is spanned by $y_1$ and $y_2$, call the particular solution $y_p = Axe^{-2x}$, force this to be a solution and go for $A$.

• for item b), your $f$ is a second degree polynomial, $A + Bx + Cx^2$. Since one of the terms, $A$, is spanned by $y_1$ and $y_2$, call the particular solution $y_p = Ax+Bx^2+Cx^3$, force this to be a solution, and solve for $A,B$ and $C$.