<s>[INST] Finding a differential equation. Find a homogenous linear differential equation of order two of which $$y=e^x$$ and $$y=x+x^2$$ are two independent solutions. All I can think of is trial and error, how do I go backwards from these two equations to the DE?
 [/INST] The equation is of the form $y''+ay'+by=0$.
Plugging $e^x$, $e^x+ae^x+be^x=0$, i.e. $1+a+b=0$.
Plugging $x+x^2$, $2+a(1+2x)+b(x+x^2)=0$.
Solving for $a$ and $b$,
$$a=\frac{-x^2-x+2}{x^2-x-1}\\b=\frac{2x-1}{x^2-x-1}.$$
Answer:
$$(x^2-x-1)y''+(-x^2-x+2)y'+(2x-1)y=0.$$
</s>