Hi everyone,(adsbygoogle = window.adsbygoogle || []).push({});

I am writing a simple code using Numerical Recipes (that bible of numerical method) to

integrate using trapezoid rule the following integral

int_pi/2_inf {sin(x)/x^2} dx

I first make variable change y = 1/x to change limit of integration so that now the integral

becomes int_0_2/pi sin(1/y) dy

I ever took analysis and this function has very special properties because of its extremely rapid

oscillation near x=0. Also, it has a special name, I forgot what it is. Anybody knows what

function sin(1/x) is commonly called in analysis?

Because of this rapid oscillation, one must use much finer sampling density when employing

trapezid rule to get accurate answer.What do you think further simple analytic transformation

that I can make to improve the convergence of this numerical integration using trapezoid rule?

Suggestions would be highly appreciated.

Urkel

**Physics Forums | Science Articles, Homework Help, Discussion**

Dismiss Notice

Join Physics Forums Today!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# Numerical Integration of sin(1/x)

**Physics Forums | Science Articles, Homework Help, Discussion**