Find a particular integral for $y''+y'+y = 2+x+\cos(x)$ If it were merely $y''+y'+y = \cos(x)$, then I know that I would try $a\cos(kx) + b\sin(kx)$, but with the added $2 + x$, I am not entirely sure.
 A: You simply have to add $ax+b$ for the part $2+x$ of the right side. So a particular solution would be of the form $ax+b+c\cos(x)+d\sin(x)$. 
A: You can also treat this kind of equations ($y"+y'+y=f(x)+g(x)$) the following way:
Find the solution $y_1$ for $y"+y'+y=f(x)$ and the solution $y_2$ for $y"+y'+y=g(x)$.
Then your solution is $y=y_1+y_2$
Beware! This does not mean this is always the best way to solve such an equation... But since you are dealing with LINEAR equations, you can use that fact!
A: You can solve for every term independently.
For $2$ you obviously have $2''+2'+2=2$.
For $x$, try $x$ itself, which gives $x''+x'+x=1+x\ne x$. But the fix is easy: $x-1$ yields $(x-1)''+(x-1)'+(x-1)=x$. (More generally, for a given polynomial of degree $d$, try an arbitrary polynomial of degree $d$.)
For the cosine, it is convenient to use the complex representation and consider the real part of $e^{ix}$.
We have $(e^{ix})''+(e^{ix})'+e^{ix}=(i^2+i+1)e^{ix}=ie^{ix}$ so that the solution is the real part of $-ie^{ix}$ or $\sin x$.
Hence
$$x+1+\sin x.$$
A: $$y''+y'+y = 2+x+\cos(x)$$
The characteristic polynomial is
$$r^2+r+1=0 \implies  r=\frac {-1\pm i\sqrt 3}2$$
$$\implies y=e^{-1/2}(c_1 \cos(\sqrt 3 x/2)+c_2 \sin(\sqrt 3x/2))$$ 
So  for $\cos(x)$ try $a\cos(x)+b\sin(x)$ it gives $\sin(x)$
And $ax+b$ for $x+1$
$$a+ax+b=x+2 \implies (a,b)=(1,1)$$
Therefore 
 $$\implies y=e^{-1/2}(c_1 \cos( \frac {\sqrt 3}2x)+c_2 \sin( \frac {\sqrt 3}2x)+x+1+\sin(x)$$ 
