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
Another approach would be the annihilator method.
We are given:
(1) $\displaystyle y''(x)-y'(x)+y(x)=x+e^x$
Observe that $\displaystyle D^2$ annihilates $\displaystyle x$ and $\displaystyle (D-1)$ annihilates $\displaystyle e^x$ and so define:
$\displaystyle A\equiv D^2(D-1)$
Applying $\displaystyle A$ to both sides of the ODE we get:
$\displaystyle A\left[y''-y'+y \right]=A\left[x+e^x \right]$
(2) $\displaystyle D^2(D-1)(D^2-D+1)=0$
Thus, the auxiliary equation is:
$\displaystyle r^2(r-1)(r^2-r+1)=0$
The roots are:
$\displaystyle r=0\text{ multiplicity 2},\,1,\,\frac{1\pm i\sqrt{3}}{2}$
Thus, a general solution to (1) is:
(3) $\displaystyle 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 $\displaystyle y(x)=y_h(x)+y_p(x)$. Since every solution to (1) is also a solution to (2), then $\displaystyle y(x)$ must have the form displayed on the right-hand side of (3). But, we recognize that:
$\displaystyle 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:
$\displaystyle y_p(x)=c_1+c_2x+c_3e^x$
In order to substitute this into (1), we must first compute:
$\displaystyle y_p'(x)=c_2+c_3e^x$
$\displaystyle y_p''(x)=c_3e^x$
and so we find:
$\displaystyle (c_3e^x)-(c_2+c_3e^x)+(c_1+c_2x+c_3e^x)=x+e^x$
$\displaystyle (c_1-c_2)+(c_2)x+(c_3)e^x=0+1\cdot x+1\cdot e^2$
Equating coefficients, we find:
$\displaystyle c_1-c_2=0$
$\displaystyle c_2=1$
$\displaystyle c_3=1$
and so:
$\displaystyle y_p(x)=1+x+e^x$ and we have the solution:
$\displaystyle 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)$