Menu

#3309 foursimp evaluates expressions of the form 0/0 incorrectly

None
open
nobody
5
2017-05-05
2017-05-05
No

currently (Mx V5.38), foursimp does not correctly treat terms of the form 0/0, which may appear in the output of fourier. Minimal example:
fourier(sin(x),x,%pi) ->
(%t11) a[0]=0
(%t12) a[n]=0
(%t13) b[n]=(2(sin(%pin)/(2n+2)-sin(%pin)/(2*n-2)))/%pi
(%o13) [%t11,%t12,%t13]

foursimp(%t13) ->
(%t31) a[0]=0
(%t32) a[n]=0
(%t33) b[n]=0
(%o33) [%t31,%t32,%t33]

%t33 is incorrect: -sin(%pin)/(2n-2) takes the form 0/0 for n=1, and is correctly evaluated by limit:
limit(-sin(%pin)/(2n-2),n,1) -> (%o15) %pi/2 , which together with the factor of 2/%pi outside the parentheses yields the correct result b[1]=1. For this example, the output of foursimp should imho look like:
a[0]=0
a[n]=0
b[1]=1
b[2]=0
b[n]=0

regards
Schorsch

Discussion


Log in to post a comment.