http://www.mathworks.com/matlabcentral/newsreader/view_thread/240941
MATLAB Central Newsreader  int in R2008b, same integral?
Feed for thread: int in R2008b, same integral?
enus
©19942014 by MathWorks, Inc.
webmaster@mathworks.com
MATLAB Central Newsreader
http://blogs.law.harvard.edu/tech/rss
60
MathWorks
http://www.mathworks.com/images/membrane_icon.gif

Mon, 16 Feb 2009 10:24:01 +0000
Re: int in R2008b, same integral?
http://www.mathworks.com/matlabcentral/newsreader/view_thread/240941#628561
Christopher Creutzig
"Joerg Buchholz" <buchholz@hsbremen.de> wrote in message <gknm31$sf6$1@fred.mathworks.com>...<br>
> The bug has not been fixed in R2009a.<br>
<br>
Correction: The enhancement is not in the 2009a prerelease. Please check again when the final release is available.<br>
<br>
<br>
Christopher

Fri, 12 Dec 2008 22:10:17 +0000
int in R2008b, same integral?
http://www.mathworks.com/matlabcentral/newsreader/view_thread/240941#616723
Joerg Buchholz
Is there a mathematical reason, why R2008b can solve:<br>
<br>
>> int ('1/sqrt(1x^2)')<br>
<br>
ans =<br>
<br>
asin(x)<br>
<br>
but cannot solve: <br>
<br>
>> int ('sqrt(1/(1x^2))')<br>
Warning: Explicit integral could not be found. <br>
> In sym.int at 64<br>
In char.int at 9<br>
<br>
ans =<br>
<br>
int((1/(x^2  1))^(1/2), x)<br>
<br>
Is there a way to make R2008b simplify 'sqrt(1/(1x^2))' to '1/sqrt(1x^2)'?

Sat, 13 Dec 2008 01:17:02 +0000
Re: int in R2008b, same integral?
http://www.mathworks.com/matlabcentral/newsreader/view_thread/240941#616740
Georgios
"Joerg Buchholz" <buchholz@hsbremen.de> wrote in message <ghung9$3as$1@fred.mathworks.com>...<br>
> Is there a mathematical reason, why R2008b can solve:<br>
> <br>
> >> int ('1/sqrt(1x^2)')<br>
> <br>
> ans =<br>
> <br>
> asin(x)<br>
> <br>
> but cannot solve: <br>
> <br>
> >> int ('sqrt(1/(1x^2))')<br>
> Warning: Explicit integral could not be found. <br>
> > In sym.int at 64<br>
> In char.int at 9<br>
> <br>
> ans =<br>
> <br>
> int((1/(x^2  1))^(1/2), x)<br>
> <br>
> Is there a way to make R2008b simplify 'sqrt(1/(1x^2))' to '1/sqrt(1x^2)'?<br>
<br>
No. These are equivalent only over the range 1..1. Outside of that range they are not equivalent, that is why you get a closed form answer for the first integral and not for the second. Without integrating, try plugging in some numbers greater that 1 into both functions, and see what happens. For example, using a value of x=1.3333, the first function yields 1.133899898*I while the second one yields 1.133899899*I. If you integrate using a bounded range, say 1..1, then you should get an answer of pi for both. Once the range goes beyond this, the answers will differ with a sign change with respect to the imaginary variable.<br>
<br>
Regards,<br>
Georgios

Sat, 13 Dec 2008 02:11:05 +0000
Re: int in R2008b, same integral?
http://www.mathworks.com/matlabcentral/newsreader/view_thread/240941#616744
Roger Stafford
"Georgios" <gkokovid@yahoo.com> wrote in message <ghv2ee$h15$1@fred.mathworks.com>...<br>
> "Joerg Buchholz" <buchholz@hsbremen.de> wrote in message <ghung9$3as$1@fred.mathworks.com>...<br>
> > .......<br>
> > Is there a way to make R2008b simplify 'sqrt(1/(1x^2))' to '1/sqrt(1x^2)'?<br>
> <br>
> No. These are equivalent only over the range 1..1. Outside of that range they are not equivalent, that is why you get a closed form answer for the first integral and not for the second. Without integrating, try plugging in some numbers greater that 1 into both functions, and see what happens. For example, using a value of x=1.3333, the first function yields 1.133899898*I while the second one yields 1.133899899*I. If you integrate using a bounded range, say 1..1, then you should get an answer of pi for both. Once the range goes beyond this, the answers will differ with a sign change with respect to the imaginary variable.<br>
> <br>
> Regards,<br>
> Georgios<br>
<br>
Well, that might be a reason, but in my opinion it's not a very good reason. The square root function in the complex plane has two branches. If one integrates half way around the singularity at z = 1 in a semicircle, a different answer is obtained for a counterclockwise route than a clockwise one. However, that is no reason for 'int' to misbehave itself for z restricted to the real interval (1,+1). The log(z) function has infinitely many branches about its z = 0 singularity but that would be no reason for 'int' to fail to furnish accurate answers for z restricted to positive reals.<br>
<br>
Roger Stafford

Sat, 13 Dec 2008 05:21:02 +0000
Re: int in R2008b, same integral?
http://www.mathworks.com/matlabcentral/newsreader/view_thread/240941#616755
Georgios
"Roger Stafford" <ellieandrogerxyzzy@mindspring.com.invalid> wrote in message <ghv5jp$71n$1@fred.mathworks.com>...<br>
> "Georgios" <gkokovid@yahoo.com> wrote in message <ghv2ee$h15$1@fred.mathworks.com>...<br>
> > "Joerg Buchholz" <buchholz@hsbremen.de> wrote in message <ghung9$3as$1@fred.mathworks.com>...<br>
> > > .......<br>
> > > Is there a way to make R2008b simplify 'sqrt(1/(1x^2))' to '1/sqrt(1x^2)'?<br>
> > <br>
> > No. These are equivalent only over the range 1..1. Outside of that range they are not equivalent, that is why you get a closed form answer for the first integral and not for the second. Without integrating, try plugging in some numbers greater that 1 into both functions, and see what happens. For example, using a value of x=1.3333, the first function yields 1.133899898*I while the second one yields 1.133899899*I. If you integrate using a bounded range, say 1..1, then you should get an answer of pi for both. Once the range goes beyond this, the answers will differ with a sign change with respect to the imaginary variable.<br>
> > <br>
> > Regards,<br>
> > Georgios<br>
> <br>
> Well, that might be a reason, but in my opinion it's not a very good reason. The square root function in the complex plane has two branches. If one integrates half way around the singularity at z = 1 in a semicircle, a different answer is obtained for a counterclockwise route than a clockwise one. However, that is no reason for 'int' to misbehave itself for z restricted to the real interval (1,+1). The log(z) function has infinitely many branches about its z = 0 singularity but that would be no reason for 'int' to fail to furnish accurate answers for z restricted to positive reals.<br>
> <br>
> Roger Stafford<br>
<br>
Some symbolic engines handle branch cuts better than others. I'm assuming that R2008b is using MuPad for this. I tried the above in native Maple, and got the same result; i.e. the answers were not the same. But Maxima returns arcsin(x) for both functions. I have no way of evaluating this in Matlab because I do not use the symbolic toolbox. <br>
<br>
Regards,<br>
Georgios

Sat, 13 Dec 2008 12:46:02 +0000
Re: int in R2008b, same integral?
http://www.mathworks.com/matlabcentral/newsreader/view_thread/240941#616792
Joerg Buchholz
"Georgios" <br>
> If you integrate using a bounded range, say 1..1, then you should get an answer of pi for both. <br>
<br>
<br>
Unfortunately, this is not the case:<br>
<br>
>> int ('sqrt(1/(1x^2))', 1, 1)<br>
Warning: Explicit integral could not be found. <br>
> In sym.int at 64<br>
In char.int at 9<br>
<br>
ans =<br>
<br>
int((1/(x^2  1))^(1/2), x = 1..1)<br>
<br>
Even explicitely restricting the range of x does not help:<br>
<br>
>> evalin (symengine, 'assume (x<1)');<br>
>> evalin (symengine, 'assumeAlso (x>1)');<br>
>> evalin (symengine, 'getprop(x)')<br>
<br>
ans =<br>
<br>
(1, 1)<br>
<br>
>> int ('sqrt(1/(1x^2))', 1, 1)<br>
Warning: Explicit integral could not be found. <br>
> In sym.int at 64<br>
In char.int at 9<br>
<br>
ans =<br>
<br>
int((1/(x^2  1))^(1/2), x = 1..1)

Thu, 15 Jan 2009 15:52:01 +0000
Re: int in R2008b, same integral?
http://www.mathworks.com/matlabcentral/newsreader/view_thread/240941#621838
Joerg Buchholz
The bug has not been fixed in R2009a.<br>
<br>
"Joerg Buchholz" <buchholz@hsbremen.de> wrote in message <gi0aqa$e0u$1@fred.mathworks.com>...<br>
> "Georgios" <br>
> > If you integrate using a bounded range, say 1..1, then you should get an answer of pi for both. <br>
> <br>
> <br>
> Unfortunately, this is not the case:<br>
> <br>
> >> int ('sqrt(1/(1x^2))', 1, 1)<br>
> Warning: Explicit integral could not be found. <br>
> > In sym.int at 64<br>
> In char.int at 9<br>
> <br>
> ans =<br>
> <br>
> int((1/(x^2  1))^(1/2), x = 1..1)<br>
> <br>
> Even explicitely restricting the range of x does not help:<br>
> <br>
> >> evalin (symengine, 'assume (x<1)');<br>
> >> evalin (symengine, 'assumeAlso (x>1)');<br>
> >> evalin (symengine, 'getprop(x)')<br>
> <br>
> ans =<br>
> <br>
> (1, 1)<br>
> <br>
> >> int ('sqrt(1/(1x^2))', 1, 1)<br>
> Warning: Explicit integral could not be found. <br>
> > In sym.int at 64<br>
> In char.int at 9<br>
> <br>
> ans =<br>
> <br>
> int((1/(x^2  1))^(1/2), x = 1..1)