Another Symbolic Integral that MATLAB 2008b can’t do

November 8th, 2008 | Categories: math software, matlab | Tags:

As more and more people start upgrading to MATLAB 2008b they are uncovering problems with the new Mupad symbolic engine. The latest one was sent to me by Robert in the comments section of my review of the new symbolic toolbox. In the old version of MATLAB (2008a and below) the symbolic toolbox has no problems at all with the following integral
 syms x int((sin(x))^2/x,x)

ans =
1/2*log(x)-1/2*cosint(2*x)

but the new version using the Mupad engine simply cannot do anything with it:
 Warning: Explicit integral could not be found. > In sym.int at 64 

Strictly speaking, this isn’t a bug at all but it does expose a limitation of the new system. I have filed an incident report with The Mathworks just in case they are not aware of this issue so hopefully it will be improved in a future version. Thanks to Robert for letting me know about this one.

If you are a user of MATLAB (or any other piece of mathematical software for that matter) then feel free to let me know if you discover any more issues like this. I will always inform the vendor once I have confirmed the problem but I am happy to keep your name to myself if that is what you prefer.

1. Thanks, Mike, for pinging the Mathworks on this problem. I’ve had several email exchanges with them on the deficiencies of mupad vis a vis Maple. Summary: Mathworks tried to find a work-around, but in the end acknowledged that they need to fix it.

The real integral I need to solve is int((sinc(x)*sin(a*x))^2/f^n,x,0,inf), n = 0,1,2
Mathematica solves this handily, I learned by downloading a trial version.
Maple probably does, too, but unfortunately their toolbox for Matlab requires a full Maple installation, which I don’t have.

2. Curiously, I tried this problem directly into MuPad Pro version 4.0 that MATLAB could not do with the new MuPad toolbox:

int((sin(x))^2/x,x)

and got this answer in nice graphical form:

1/2*ln(x) – 1/2*Ci(2*x)

I do not have access to the new MuPad notebook GUI in MATLAB, but if it works like the MuPad notebook in the original product by SciFace, then editing and preparing final documents is now infinitely better! The GUI in MuPad is far, far better than MATLAB’s command line interface.

3. Hi James

Thanks for that. I launched the mupad 5.1 notebook from matlab and tried evaluating the integral in that – working on the assumption that maybe something was going wrong with the communication between muPad and MATLAB.

Unfortunatley it simply returns the integral unevaluated – it is very nicely formatted though ;)

I have to agree with you concerning MuPad’s interface – it is very nice indeed. These minor problems with integrals and suchlike aside – I think that the move to Mupad is a positive one and I look forward to learning more about its capabilities.

4. The new version of symbolic toolbox seems to not know any delay rules for integral transforms. For example
transform::fourier(sin(x-1),x,s) just returns unevaluated expression. Same for any other delay in the function e.g. exp(-abs(x-1)) and in Laplace transform as well. Maple did this easily even in version 4 which was the version 10 years ago.

5. While not perfect, this integral is doable from the mupad 5.1 gui with 2008b
simplify(sin(x)^2/x,sin)
int(%,x) evaluates the result properly. Again, this is not a problem for older toolbox.

6. Hi Yakov

Thanks for your comments – I have passed your workaround for the integral to mathworks in the the hope that it will help them debug the issue.

7. One more R2008b failure:
syms x, int((x-1)^2*exp(-x^2),x,0,inf)

Previous versions evaluate to 3/4*pi^(1/2)-1

8. Hello again Robert

Thanks for letting me know – I’ll be sending another bug report to Mathworks later today. Keep em coming :)

Best Wishes,
Mike

9. I had a the same problem with the new matlab (don’t know if the old one does work, don’t have it installed) but i don’t see anything wrong in:
clear all
syms x n
for n=1:50
int((sin(x^(1/(100+n))))/(1+sqrt(x)),0,1)
end

but i keep getting the error:
Warning: Explicit integral could not be found.
> In sym.int at 64
In I2Eopd20 at 4

10. I had a longer integration with the error:

Warning: Explicit integral could not be found.

then i wrote: double(int(…))

Matlab solved the problem but I am not sure how big the mistake is in the solution?
Does anybody know how this command influence the solution?

thx