1. ## A second grade differential equation

Hey,

I'm stuck on this one and it's due tomorrow so I'd love some help.

Solve y''-y'+y=x+e^x

2. ## Re: A second grade differential equation

Ok first take the characteristic equition x^2-x+1=0 and solve that first.

3. ## Re: A second grade differential equation

Another approach would be the annihilator method.

We are given:

(1) $y''(x)-y'(x)+y(x)=x+e^x$

Observe that $D^2$ annihilates $x$ and $(D-1)$ annihilates $e^x$ and so define:

$A\equiv D^2(D-1)$

Applying $A$ to both sides of the ODE we get:

$A\left[y''-y'+y \right]=A\left[x+e^x \right]$

(2) $D^2(D-1)(D^2-D+1)=0$

Thus, the auxiliary equation is:

$r^2(r-1)(r^2-r+1)=0$

The roots are:

$r=0\text{ multiplicity 2},\,1,\,\frac{1\pm i\sqrt{3}}{2}$

Thus, a general solution to (1) is:

(3) $y(x)=c_1+c_2x+c_3e^x+c_4e^{ \frac{x}{2}}\cos\left( \frac{ \sqrt{3}}{2}x \right)+c_5e^{ \frac{x}{2}}\sin\left( \frac{\sqrt{3}}{2}x \right)$

Now, recall that a general solution to (1) is of the form $y(x)=y_h(x)+y_p(x)$. Since every solution to (1) is also a solution to (2), then $y(x)$ must have the form displayed on the right-hand side of (3). But, we recognize that:

$y_h(x)=c_6e^{ \frac{x}{2}}\cos\left( \frac{ \sqrt{3}}{2}x \right)+c_7e^{ \frac{x}{2}}\sin\left( \frac{\sqrt{3}}{2}x \right)$

and so there must exist a particular solution of the form:

$y_p(x)=c_1+c_2x+c_3e^x$

In order to substitute this into (1), we must first compute:

$y_p'(x)=c_2+c_3e^x$

$y_p''(x)=c_3e^x$

and so we find:

$(c_3e^x)-(c_2+c_3e^x)+(c_1+c_2x+c_3e^x)=x+e^x$

$(c_1-c_2)+(c_2)x+(c_3)e^x=0+1\cdot x+1\cdot e^2$

Equating coefficients, we find:

$c_1-c_2=0$

$c_2=1$

$c_3=1$

and so:

$y_p(x)=1+x+e^x$ and we have the solution:

$y(x)=1+x+e^x+c_1e^{ \frac{x}{2}}\cos\left( \frac{ \sqrt{3}}{2}x \right)+c_2e^{ \frac{x}{2}}\sin\left( \frac {\sqrt{3}}{2}x \right)$