rtoy / maxima

A Clone of Maxima's repo
Other
0 stars 0 forks source link

taylor can return wrong answer on sqrt(abs()) #1284

Open rtoy opened 3 months ago

rtoy commented 3 months ago

Imported from SourceForge on 2024-07-04 07:58:07 Created by hbraviner on 2010-06-27 10:39:11 Original: https://sourceforge.net/p/maxima/bugs/2021


Suppose I wish to expand sqrt(abs(r^2-1)) for large r. In the large r limit we can take r^2 -1 to be positive and abs(r^2 - 1) evaluates to r^2 - 1. I then pull out a factor of r from the sqrt() and do a Taylor expansion in negative powers of r. The series I get should be r - (1/2)*r^(-1) - (1/8) *r^(-3) + ...

To do this in maxima, I should call the function taylor(sqrt(abs(r^2-1)),[r,0,3,'asymp]). However, this returns %i*r-%i/(2*r)-%i/(8*r^3)+... I believe this is because the abs() function is evaluated at r=0 (as indeed it should be if we were taking a Taylor series in positive powers of r about 0), since expanding instead around r=2 produces the same answer regardless of whether of not abs() is present.

rtoy commented 3 months ago

Imported from SourceForge on 2024-07-04 07:58:07 Created by hbraviner on 2010-06-27 10:39:11 Original: https://sourceforge.net/p/maxima/bugs/2021/#725e


Steps to reproduce the bug described above

Attachments: