Evaluate a limit of series using Riemann integral

Let $$\lim_{n\to\infty} n\cdot \sum_{j=1}^n \frac{\cos\left(\frac{n}{j}\right)f\left(\frac{n}{j}\right)}{j^2}$$

Where $f$ is $C^\infty$ and monotonically decreasing: $\lim_{x\to\infty} f(x) = 0$.

I need to evaluate the limit. Riemann integral should be used. I guess there should be some algebraic moves to reach that, and the integrand (my guess) should be $f(x)\cos(x)$.

Could you help me please connect the dots?

Define $g(x)=\frac{\cos\left(\frac{1}{x}\right)f\left(\frac{1}{x}\right)}{x^2}$, and write the above as:

$$\sum_{j=1}^{n} \frac{1}{n}g\left(\frac{j}{n}\right)$$

Which is a Reimann sum, which has, as a limit:

$$\int_{0}^1 g(x)\,dx$$

That's gonna depend on $g$. In particular, it might be an improper integral, depending on whether you can make $g$ continuous at $0$.

Then $g\left(\frac{1}u\right)=u^2f(u)\cos u$

Substituting $x=\frac{1}{u}$ so $dx=\frac{-du}{u^2}$ you get: $$\int_1^{\infty} f(u)\cos u \,du$$

• I get: $$\sum_{j=1}^n \frac{\cos(\frac{n}{j})f(\frac{n}{j})}{\frac{j}{n^2}} = n\cdot \sum_{j=1}^n \frac{\cos(\frac{n}{j})f(\frac{n}{j})}{\frac{j}{n}}$$ Jan 16 '15 at 20:05
• Whoops, missed the square. Just a second. Jan 16 '15 at 20:06
• Could you also comment about your intuition about how to figure out what's the integral is? Jan 16 '15 at 20:07
• As a general rule, when I see a lot of $j/n$ in a sum, I try to replace them by $x$ to get a function for which it is a Reimann sum. Usually a guess. Jan 16 '15 at 20:09
• The answer should be fixed. @AlonAlon Jan 16 '15 at 20:10