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

Add a New Comment Rich Markup
   

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.com/sympy/sympy/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

 

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

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

    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.

     

    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.13-02a9.
    Corresponding source code