Post Reply 
error in the integration of complex functions (FW10077)
05-02-2016, 02:20 PM
Post: #7
RE: error in the integration of complex functions (FW10077)
If f is entered as an algebraic function, you get the exact answer
Code:
f(x,n):=sum(cos(k*x),k,1,n);
int(f(x,ceil(x)),x,0,2);
returns 4*tan(1)/(tan(1)^4+2*tan(1)^2+1)+2*tan(1/2)/(tan(1/2)^2+1)-4*tan(1/2)/(tan(1/2)^4+2*tan(1/2)^2+1)
If f is entered as a program
Code:
f(x,n):= begin local j,y; y:=0; for j from 1 to n do y:=y+cos(j*x); end; end;
then f(x,ceiling(x)) returns an error in Xcas while returning 0.0 on the Prime. I guess it's again because an exception is not raised on the Prime. This explains why you get 0 for the integral.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: error in the integration of complex functions (FW10077) - parisse - 05-02-2016 02:20 PM



User(s) browsing this thread: 1 Guest(s)