I would like to prove that $$\left(\int\_{0}^{\infty} e^{-t}\cos\theta (t)\,\text{d}t \right)^2 \leq \int\_{0}^{\infty} e^{-t}\cos^2\theta(t)\,\text{d}t,$$ where $\theta(t):[0,\,\infty)\to\mathbb{R}$ is some continuous function. (This is all that is known about $\theta$.) My first approach was to apply the Cauchy-Schwarz inequality, but that doesn't seem to be of any use. I then thought that there was a general rule stating that $$\left(\int\_{0}^{\infty} f(t)\,\text{d}t \right)^2 \leq \int\_{0}^{\infty} f(t)^2\,\text{d}t$$ if the integrals exist and $f$ is non-negative, but this turned out to be an incorrect version of Jensen's inequality, which doesn't seem to work for improper integrals because it involves a factor of $b-a$, where $a$ and $b$ are the integral bounds. So now I'm not sure where to turn. The inequality looks obvious and I am assured that it is true, but I don't know how to prove it. Is there a generally accepted approach to such a question?