bugGNU Octave - Bugs: bug #60705, [octave forge] (symbolic) int (x *...

 
 

bug #60705: [octave forge] (symbolic) int (x * sqrt (abs (x)) on [-1, 1] gives wrong result

Submitter:  None
Submitted:  Sun 30 May 2021 05:16:21 PM UTC
   
 
Category:  Octave Package Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  Fixed Assigned to:  None
Originator Name:  Mihai Originator Email:  -email is unavailable-
Open/Closed:  * Closed Release:  * dev
Operating System:  * Any Fixed Release:  None
Planned Release:  None
* Mandatory Fields

Post a Comment

Add a New Comment Rich Markup
   

Discussion

Mon 12 Sep 2022 12:36:20 PM UTC, comment #3: 

the initial comment #0 code now also produces the expected output of 0 with symbolic 3.0.1.  closing as fixed.

Nicholas Jankowski <nrjank>
Group Member
Mon 12 Sep 2022 12:06:52 AM UTC, comment #2: 
Anonymous
Sun 30 May 2021 08:46:05 PM UTC, comment #1: 

Confirmed on Debian. This is actually a bug in upstream SymPy, so it needs to be fixed there for this to be fixed in Octave symbolic.

Here is the equivalent Python that produces the same wrong result:


from sympy import integrate, sqrt
from sympy.abc import x
f = x * sqrt(abs(x))
y = integrate(f, (x, -1, 1))


I believe this case is covered by this upstream bug report: https://github.co ... ympy/issues/20982

The workaround suggested there works in this case as well (but of course this workaround is not exposed using the symbolic package):


y = integrate(f, (x, -1, 1), manual=True)


Mike Miller <mtmiller>
Group Member
Sun 30 May 2021 05:16:21 PM UTC, original submission:  

int(x*sqrt(abs(x)),x,-1,1), where x is symbolic, returns  the wrong value 4/5. The correct value is 0 (the function is odd on [-1,1]). Similarly, for any positive integer power of x integrated with the weight function sqrt(abs(x)) on [-1,1].

Anonymous

 

Attached Files

This item currently has no attached files.

(Note: upload size limit is set to 4.0MiB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

 

Dependencies

This item does not depend on any other items.

No items depend on this one.

 

Mail Notification Carbon-Copy List

Carbon-Copy List
  • -email is unavailable- added by nrjank (Posted a comment)
  • -email is unavailable- added by None (Submitted the item)
  •  

    Votes

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    History

    Follow 7 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2022-09-12 nrjank StatusConfirmed Fixed
        Open/ClosedOpen Closed
    2021-05-30 mtmiller CategoryOctave Function Octave Package
        StatusNone Confirmed
        Release6.2.0 dev
        Operating SystemMicrosoft Windows Any
        Summarysym int x*sqrt(abs(x)) on [-1,1] gives 4/5, instead of 0. [octave forge] (symbolic) int (x * sqrt (abs (x)) on [-1, 1] gives wrong result

    Back to the top

    Powered by Savane 3.16-ed84.
    Corresponding source code