BTW : ``` sage: a, b = var("a, b") sage: f(x) = floor(x)^2 sage: F(x) = f(x).integrate(x) ; F x |--> x*floor(x)^2 sage: def G(x): return numerical_integral(f, 0, x)[0] sage: plot([F, G], (0, 3)) Launched png viewer for Graphics object consisting of 2 graphics primitives ```
[image: tmp_7n_jxgco.png] Giac's "antiderivative" implicitly adds `heaviside(x-u)^2` terms... Again, this is wrong... Le vendredi 3 février 2023 à 10:31:17 UTC+1, Emmanuel Charpentier a écrit : > BTW : > > ``` > sage: a, b = var("a, b") > sage: f(x) = floor(x)^2 > sage: f(x).integrate(x, a, b) > // Giac share root-directory:/usr/local/sage-9/local/share/giac/ > // Giac share root-directory:/usr/local/sage-9/local/share/giac/ > Added 0 synonyms > No checks were made for singular points of antiderivative > floor(sageVARa)^2*sageVARx for definite integration in [sageVARa,sageVARb] > -a*floor(a)^2 + b*floor(a)^2 > ``` > > Even accepting `x*floor(x)^2` as an antiderivative of `floor(x)`, this > *definite* integral is wrong, *wrong*, **wrong**. One could expect : > > ``` > sage: F(x) = f(x).integrate(x) ; F > x |--> x*floor(x)^2 > sage: F(b) - F(a) > -a*floor(a)^2 + b*floor(b)^2 > ``` > > Something is amiss in Giac's definite integration. Is thois already known ? > > > Le vendredi 20 janvier 2023 à 18:17:52 UTC+1, Georgi Guninski a écrit : > >> I have theoretical reasons to doubt the correctness >> of integrals involving `floor`. >> >> The smallest testcases: >> >> sage: integrate(floor(x)^2,x) >> // Giac share root-directory:/usr/share/giac/ >> // Giac share root-directory:/usr/share/giac/ >> Added 0 synonyms >> x*floor(x)^2 >> >> sage: integrate(2**floor(x),x) >> 2^floor(x)*x >> >> Would someone check with another CAS or prove/disprove by hand? >> > -- You received this message because you are subscribed to the Google Groups "sage-devel" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/sage-devel/6bdb9f9a-b237-418a-946a-ce4428f6e1adn%40googlegroups.com.