Status: Accepted
Owner: smi...@gmail.com
Labels: Type-Defect Priority-Medium Integration

New issue 2310 by smi...@gmail.com: improper integral and _eval_interval
http://code.google.com/p/sympy/issues/detail?id=2310

The following gives the wrong answer:

    h[1] >>> F=1/x/(1-x)
    h[1] >>> f=F.diff(x)
    h[1] >>> integrate(f,x)
    1/x + 1/(1 - x)
    h[2] >>> integrate(f,(x,0,1))
    -oo

partly because _eval_interval is doing the wrong thing:

    h[4] >>> F._eval_interval(x,S(0),S(1))
    -oo

It evaluates F *from the right* at 0 and 1. It should at least evaluate it from within the interval (i.e. from the right at 0 and from the left at 1). If the direction issue had been implemented, it would have at least returned NaN and the doit would know to do something else to evaluate the integral as an improper integral. But I'm not sure what exists at present to handle such cases.

I think it should also watch out for the case where a bounded limit gives and unbounded value and use the limit to double check it in that case, e.g. f(x).subs(x, bounded) -> unbounded should check that the limit of f(x) as x -> bounded.

One approach to calculating this integral would be to do it symbolically in terms of a parameter and then find the limit as that parameter approaches the desired value. But when I try this (with intent of letting d -> 1) it doesn't work because the function is symmetric in the range of 0 to 1 so the value is 0:

    h[1] >>> integrate(f, (x, 1-d, d))
    0


See also issue 1116.

--
You received this message because you are subscribed to the Google Groups 
"sympy-issues" group.
To post to this group, send email to sympy-issues@googlegroups.com.
To unsubscribe from this group, send email to 
sympy-issues+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sympy-issues?hl=en.

Reply via email to