# Finding a differential equation from a known solution?

If $y = 6 + 3xe^x - \cos x$ is a particular solution of some homogenous differential equation, how we can find the corresponding differential equation?

I know how to find the roots; for example $-\cos x$ means that $\beta = 1$ and $\alpha =0$. But for the $6$, can we just say that it comes from a zero root?

Thanks for any help.

-
Are you told the order of the differential equation? – JohnD Jan 2 '13 at 20:45
Use the annihilator method. – Mhenni Benghorbal Jan 2 '13 at 21:00

• the 6 term comes from a solution term of the form $c_1e^{0x}$, so $r=0$ is a root of the characteristic equation
• the $3xe^{x}$ term comes from a solution term of the form $c_2e^{x}+c_3xe^x$, so $r=1$ is a double root of the characteristic equation
• the $-\cos x$ term comes from a solution term of the form $c_4\sin x+c_5\cos x$ so $r=\pm i$ are roots of the characteristic equation
Thus a suitable characteristic equation would be $$r(r-1)^2(r-i)(r+i)=r^5-2 r^4+2 r^3-2 r^2+r,$$ from which we conclude that a suitable linear, homogeneous ODE would be $$y^{(5)}-2 y^{(4)}+2 y^{(3)}-2 y''+y'=0.\tag{1}$$
You can check that $y(x)=6+3xe^x-\cos x$ is indeed a solution of (1).