Find a linear, homogeneous differential equation with constant coefficients, such that $y(x)=(x+\cos(x))\cos(x)$ is one of its solutions

ordinary differential equations

I am trying to find a linear and homogeneous differential equation, with constant coefficients, such that: $y(x)=(x+\cos(x))\cos(x)$ is one of its solutions. The trick here, is that I'm trying to find an equation with the lowest order possible.

I tried to formulate a general equation, say: $y''+Ay'+By=0$ (it would be best if the coefficient of the highest-order derivative term would be $1$) and then plug the solution, but the problem is I can't make the equation be equal to zero for all $x$.

What I also tried, is to manipulate the Wronskian. Problem is that the coefficients I get are not constant, so that might not be the way.

I would be very glad and appreciative for your help.

Thanks!

Best Answer

You can write your solution as

$$y(x)=(x+\cos x)\cos x=x\cos x+\cos^2 x=x\cos x+\frac{1}{2}+\frac{1}{2}\cos 2x$$

Then, an equation which characteristic polynomial contain factors $(x^2+1)^2$, $x$ and $x^2+4$ will be your answer. For example $p(x)=x(x^2+1)^2(x^2+4)$ and your ODE

$$ \boxed{y^{(7)}(x)+6y^{(5)}(x)+9y^{'''}(x)+4y'(x)=0}$$