Putnam 1997, Problem B-2

Let $f$ be a twice-differentiable real-valued function satisfying
$$f(x) + f''(x) = -xg(x)f'(x),$$
where $g(x) \geq 0$ for all real $x$. Prove that $|f(x)|$ is bounded.

Solution:
It suffices to show that \( |f(x)| \) is bounded for \( x \geq 0 \), since \( f(-x) \) satisfies the same equation as \( f(x) \). But then  
\[
\frac{d}{dx} \left( (f(x))^2 + (f'(x))^2 \right) = 2f'(x)(f(x) + f''(x)) = -2x g(x) (f'(x))^2 \leq 0,
\]  
so that \( (f(x))^2 \leq (f(0))^2 + (f'(0))^2 \) for \( x \geq 0 \).