Is it possible to integrate a continuous function that is the sum of discontinuous ones without summing up the integral each continuous part?

51 Views Asked by At

For example, if one wanted to integrate a function where

Let $t(x) = \frac{x}{|x|}\\ c(x) = \frac{x+1}{2}\\ m(x) = c(t( 0.5 - \lfloor x \rfloor \bmod 2))\\ g(a.b) = c(t(\lfloor a - b \bmod 1 \rfloor - \lfloor b \rfloor + 0.5))\\ o(x) = (a*b) \bmod 2\\ n(a,b) = (o(a,b) - 1)\bmod 2\\ A(a,b) = n(n(a,b),n(a,b)) \bmod 2\\ B(x,a,b) = A(g(x,a),g(b,x))\\ f(x) = \begin {cases} \frac{(x \bmod 1 - 0.5)}{x^{1/3}}, & A(m(x,2),B(x,-1,1)-1) = 1\\ -\frac{(x \bmod 1 - 0.5)}{x^{1/3}} - 0.5, & A(m(x+1,2),B(x,-1,1)-1) = 1\\ (x - 0.5)^2, &0 ≤ x ≤ 1\\ -(x-0.5)^2 + 0.5, &-1≤x<0 \end{cases}$

aka

$y = \frac{(x \bmod 1 - 0.5)}{x^{1/3}}, \lfloor x \rfloor \bmod 2 = 0 $ and ($ x > 1$ or $x < -1)$
$y = -\frac{(x \bmod 1 - 0.5)}{x^{1/3}} - 0.5, \lfloor x \rfloor \bmod 2 = 1 $ and $(x > 1$ or $x < -1)$
$y = (x - 0.5)^2, 0 ≤ x ≤ 1$

$y = -(x-0.5)^2 + 0.5, -1≤x<0$

Here, if one were to integrate f(x) from, for example, $x = -1.21$ to $x = 1024.51$, summing up the integrals of each of the continuous parts of the functions that make up the function where $-1.21≤x≤1024.51$, it would require summing up over a thousand integrals. Is there a way to integrate f(x) without summing up thousands of integrals (and get an exact answer, not an approximation)?

Link to function on desmos: https://www.desmos.com/calculator/zwpjbolicq