On Tue, Apr 08, 2008 at 07:10:53AM -0500, maxima-request at math.utexas.edu wrote:
>
> Dear list,
>
> I would like to obtain a numerical value for the variation of the
> third function at
>
> http://en.wikipedia.org/wiki/Bounded_variation#Examples
>
> namely, the one with x^2*sin(1/x).
>
> I would like to do this using Maxima. The integral I need to
> calculate is
>
> (%i8) integrate(abs(2*x*sin(x)-cos(1/x)), x, 0, 2/%pi);
> 2
> ---
> %pi
> /
> [ ! 1 !
> (%o8) I !2 x sin(x) - cos(-)! dx
> ] ! x !
> /
> 0
Oops... I now noticed that I've made a typo... this explains why
some people's result deviated quite from what I expected... the
integral should have been:
(%i77) integrate(abs(2*x*sin(1/x)-cos(1/x)), x, 0, 2/%pi);
2
---
%pi
/
[ ! 1 1 !
(%o77) I !2 sin(-) x - cos(-)! dx
] ! x x !
/
0
In the mean while, using quad_qag, i have a solution which is correct
for about 3 or 4 digits and that satisfies my needs.
However, being enthousiastic about this problem and while learning to
use Maxima, I am now also trying to write a maxima script that
integrates between the roots of this function. I'm using find_root, but
being quite a maxima newbee, I'm struggling a bit with the syntax... but
anyway... just give me some time and maybe I'll get there :-)
Regards,
Bart
--
"Share what you know. Learn what you don't."