Matlab's "buggy" symbolic integration function seems to be equivalent to the Implied Integral. Coincedence or intentional?

271 Views Asked by At

In matlab there is a function called "int(f,x)" which takes in a symbolic function and a variable and integrates it. I decided to try using it today to play around and do a few integrals and I got a pretty interesting surprise.

I integrated the following and got the following results from matlab:

$$\int floor(x) dx = x*floor(x)$$

$$\int floor(\sqrt x) dx = x*floor(\sqrt x)$$

$$\int x*floor(x) dx = \frac {x^2}2*floor(x)$$

I think you see the pattern. Matlab's integral seems to treat symbols of the form floor(f(x)) as constants. Oddly enough, I actually have a name for and use this operator in self-developed integration methods. I call it an implied integral. Is there some actual reason why matlab's integration function does implied integration or is it just a "bug" in the lack of algorithms for certain integrals? This is the first instance I've seen of anything mimicking the sort of things I've been doing over the past year or so, so if matlab has followed down the same path I am and is doing something I'm not yet aware of that would interesting to see.

On the flipside I now know of a working implied integral calculator, which is awesome.

1

There are 1 best solutions below

6
On BEST ANSWER

These are not bugs. Note that $\int f(x)\; dx$ is supposed to be an antiderivative of $f(x)$. The antiderivatives you quote are perfectly good in all intervals where $f$ is continuous. However, at points where $f$ is discontinuous there is generally no antiderivative.

Now you seem to want to choose a function that is an antiderivative where such a thing exists and additionally is continuous at the discontinuities of $f$. That turns out not to be easy to do in general. It is easy in the examples you gave, because you know exactly where the jumps occur, but it's easy to find functions where you don't know exactly where they occur.