On Tue, Apr 8, 2008 at 9:54 AM, Bart Vandewoestyne
<Bart.Vandewoestyne at telenet.be>
> > (%i9) quad_qags(abs(2*x*sin(x)-cos(1/x)), x, 0, 2/%pi);
> > ***MESSAGE FROM ROUTINE DQAGS IN LIBRARY SLATEC.
> > ***INFORMATIVE MESSAGE, PROG CONTINUES, TRACEBACK REQUESTED
> > * ABNORMAL RETURN
> > * ERROR NUMBER = 1
> > *
> > ***END OF MESSAGE
> >
> > (%o9) [.5254584214118198, 2.7506663065146597e-4, 8379, 1]
There are special methods for numerical integration of highly
oscillatory integrands such as this one.
quad_qags is trying to solve this problem but it is not well-suited,
and it says so. (One of the most useful features of QUADPACK.)
Aside from trying to find or write a suitable numerical method,
breaking the integral into chunks (between roots)
is probably a winning strategy for this problem. Maybe a change
of variable u = 1/x helps (and maybe not, I didn't try it).
Good luck
Robert Dodier