On Apr 10, 2009, at 11:19 AM, davidp wrote:

>
> The following seems like odd behavior to me.
>
> Dave
>
> I. No problem:
> sage: integral(log(x)/x^(1.002),x)
> 500*(-log(x)/x^(1/500) - 500/x^(1/500))
> sage: s(10)-s(1)
> 500*(-log(10)/10^(1/500) - 500/10^(1/500)) + 250000
> sage: n(_)
> 2.64282437870861
>
> II. Problem:
> sage: integral(log(x)/x^(1.002),x,1,10)

...

> III.  Problem:
> sage: numerical_integral(log(x)/x^(1.002),x,1,10)


It doesn't take the variable of integration (as there can be only one  
unbound variable). The fact that it doesn't is probably a bug, for  
consistency the notation

         numerical_integral(f, (x, a, b))

should be accepted. See the docstring:

sage: numerical_integral?

Type:           builtin_function_or_method
Base Class:     <type 'builtin_function_or_method'>
String Form:    <built-in function numerical_integral>
Namespace:      Interactive
Docstring:

        Returns the numerical integral of the function on the interval
        from a to b and an error bound.

        EXAMPLES:
           To integrate the function x^2 from 0 to 1, we do
               sage: numerical_integral(x^2, 0, 1, max_points=100)
               (0.33333333333333331, 3.7007434154171879e-15)


sage: numerical_integral(log(x)/x^(1.002),1,10)
(2.6428243786881045, 2.9341244752602076e-14)

- Robert


--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to