$ |f''(x)+2xf'(x)+(x^2+1)f(x)|\leq1 $ for all $x$. Prove $ \lim_{x\rightarrow\infty }f(x)=0$ Let $f(x):(0, \infty)\rightarrow \mathbb{R} $ be a twice continuously  differentiable function 
such that
| $ f''(x)+2xf'(x)+(x^2+1)f(x) |\leq1 $ for all $x$. Prove $  \lim_{x\rightarrow\infty }f(x)=0$
I think this can be solved by applying  L'Hospital  rule twice on $\frac{e^{x^2}f(x)}{e^{x^2}}$. My problem is, Is it possible to apply the rule without knowing about numerator . Also I like to see different types of proofs
 A: Let $g(x)=e^{x^2/2}f(x)$. Then we have:
$$ \left| g''(x)\right| \leq e^{x^2/2} \tag{1}$$
$$ |g'(y)|\leq |g'(0)|+\int_{0}^{|y|}e^{t^2/2}\,dt \tag{2}$$
$$\begin{eqnarray*} |g(x)|&\leq& |g(0)|+|g'(0)||x|+\int_{0}^{|x|}\int_{0}^{|y|}e^{t^2/2}\,dt\,dy\\&\leq&C\sqrt{1+x^2}+\int_{0}^{1}\frac{-1+e^{x^2 t^2/2}}{t^2}\,dt \tag{3}\end{eqnarray*}$$
and now it is possible to exploit convexity or some variant of the Laplace's method to prove that the last quantity, when multiplied by $e^{-x^2/2}$, goes to zero as long as $|x|\to +\infty$.
A: We have that
$$\lvert f''(x)+2xf'(x)+(x^{2}+1)f(x)\rvert\le1$$
Consider the function $g(x)=e^{\frac{x^2}{2}}f(x)$ then
$$\begin{align}
g'(x)&=xe^{\frac{x^2}{2}}f(x)+e^{\frac{x^2}{2}}f'(x)\\
g''(x)&=e^{\frac{x^2}{2}}f(x)+x^2e^{\frac{x^2}{2}}f(x)+xe^{\frac{x^2}{2}}f'(x)+xe^{\frac{x^2}{2}}f'(x)+e^{\frac{x^2}{2}}f''(x)\\
&=e^{\frac{x^2}{2}}(f''(x)+2xf'(x)+(x^2+1)f(x))
\end{align}$$
So we have that:
$$\left\lvert\frac{d^{2}}{dx^{2}}\left(e^{\frac{x^2}{2}}f(x)\right)\right\rvert\le e^{\frac{x^2}{2}}=\left((x^2+1)e^{\frac{x^2}{2}}\right)\frac{1}{x^2+1}=\frac{1}{x^2+1}\cdot\frac{d^2}{dx^2}\left(e^{\frac{x^2}{2}}\right)$$
So
$$\left\lvert\frac{\frac{d^2}{dx^2}\left(e^{\frac{x^2}{2}}f(x)\right)}{\frac{d^2}{dx^2}\left(e^{\frac{x^2}{2}}\right)}\right\rvert\le\frac{1}{x^2+1}\to0 \text{ as }x\to \infty$$
Now use the general form of L'hopital's rule  (proved using the Stolz-Cesaro Theorem) to conclude that
$$\lim_{x\to\infty}\frac{\frac{d}{dx}\left(e^{\frac{x^2}{2}}f(x)\right)}{\frac{d}{dx}\left(e^{\frac{x^2}{2}}\right)}=\lim_{x\to\infty}\frac{\frac{d^2}{dx^2}\left(e^{\frac{x^2}{2}}f(x)\right)}{\frac{d^2}{dx^2}\left(e^{\frac{x^2}{2}}\right)}=0$$
Since $\frac{d}{dx}\left(e^{\frac{x^2}{2}}\right)=xe^{\frac{x^2}{2}}\to\infty$ as $x\to\infty$, applying the previous discussion again we conclude that:
$$\lim_{x\to\infty}f(x)=\lim_{x\to\infty}\frac{e^{\frac{x^2}{2}}f(x)}{e^{\frac{x^2}{2}}}=\lim_{x\to\infty}\frac{\frac{d}{dx}\left(e^{\frac{x^2}{2}}f(x)\right)}{\frac{d}{dx}\left(e^{\frac{x^2}{2}}\right)}=0$$
