Well, after full simplification fra1() no longer equals {x}: sage: ex=fra1(x).full_simplify() sage: ex x
It is more interesting to me how Maple finds the correct integral with {x}. Played with int_a^b f(x,{x}) =? int_a^b f(x,fra1(x)) Whenever Maple could compute the definite integral, it equals Wolfram alpha integral of f(x,frac(x)) [there are similar other definitions of {x}] Is it sound to expect that this approach for integrals of {x} works? (Possibly $\mod 1$). This can be generalized to converting sums to definite integrals: floor(x) = int1(x) = x - fra1(x). Modulo branches, \sum_{x=a}^b f(x) = \int_a^b f(int1(x)) dx Maple again computed correctly several infinite complicated sums via \int. So far have only one failing? testcase in Maple - can't find the definite integral, found the indefinite integral but the limits are "undefined". -- Georgi On Sat, Aug 24, 2013 at 03:07:14PM -0700, JamesHDavenport wrote: > Well, the derivative of the fractional part is indeed 1 where it is > defined, as > lim((fra(x+eps)-fra(x))/eps)=lim(eps/eps)=1 unless adding eps crosses a > boundary, > which it won't do for eps small enough. > Maxima (5.29) returns (4 pi log 2 + i log(-1) +pi)/(4 pi). > Depending on the value of log(-1), this is either log(2) or log(2)+1/2, > which I must confess I don't understand. > I conjecture Sage is getting log(2) from taking the "conventional" > log(-1)=i pi in Maxima's result. > > On Saturday, 24 August 2013 12:59:41 UTC+1, Georgi Guninski wrote: > > > > Don't claim this is a bug, but don't understand this. > > > > Define {x} the fractional part of x by (source mathworld): > > > > def fra1(x): > > """ > > fractional part > > """ > > return 1/2+I/(2*pi)*log(-exp(-2*pi*I*x)) > > > > > > sage: var('x') > > x > > sage: ii=integrate(fra1(1/x),x,1/2,1);ii > > log(2) > > > > According to Maple and mathworld this integral equals > > -1/2 + ln(2) > > > > Part of the problem is log() is multivalued, but I suppose > > for all branches of log(), fra1() should be correct $\mod 1$, > > yet the result is not correct $\mod 1$. > > > > Probably this is related: > > sage: diff(fra1(x),x) > > 1 > > > > Why so? > > > -- You received this message because you are subscribed to the Google Groups "sage-support" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-support+unsubscr...@googlegroups.com. To post to this group, send email to sage-support@googlegroups.com. Visit this group at http://groups.google.com/group/sage-support. For more options, visit https://groups.google.com/groups/opt_out.