<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/240941</link>
    <title>MATLAB Central Newsreader - int in R2008b, same integral?</title>
    <description>Feed for thread: int in R2008b, same integral?</description>
    <language>en-us</language>
    <copyright>&amp;copy;1994-2012 by MathWorks, Inc.</copyright>
    <webmaster>webmaster@mathworks.com</webmaster>
    <generator>MATLAB Central Newsreader</generator>
    <docs>http://blogs.law.harvard.edu/tech/rss</docs>
    <ttl>60</ttl>
    <image>
      <title>MathWorks</title>
      <url>http://www.mathworks.com/images/membrane_icon.gif</url>
    </image>
    <item>
      <pubDate>Mon, 16 Feb 2009 10:24:01 -0500</pubDate>
      <title>Re: int in R2008b, same integral?</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/240941#628561</link>
      <author>Christopher Creutzig</author>
      <description>&quot;Joerg Buchholz&quot; &amp;lt;buchholz@hs-bremen.de&amp;gt; wrote in message &amp;lt;gknm31$sf6$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; The bug has not been fixed in R2009a.&lt;br&gt;
&lt;br&gt;
&amp;nbsp;Correction: The enhancement is not in the 2009a prerelease. Please check again when the final release is available.&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
Christopher</description>
    </item>
    <item>
      <pubDate>Fri, 12 Dec 2008 22:10:17 -0500</pubDate>
      <title>int in R2008b, same integral?</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/240941#616723</link>
      <author>Joerg Buchholz</author>
      <description>Is there a mathematical reason, why R2008b can solve:&lt;br&gt;
&lt;br&gt;
&amp;gt;&amp;gt; int ('1/sqrt(1-x^2)')&lt;br&gt;
&amp;nbsp;&lt;br&gt;
ans =&lt;br&gt;
&amp;nbsp;&lt;br&gt;
asin(x)&lt;br&gt;
&lt;br&gt;
but cannot solve: &lt;br&gt;
&lt;br&gt;
&amp;gt;&amp;gt; int ('sqrt(1/(1-x^2))')&lt;br&gt;
Warning: Explicit integral could not be found. &lt;br&gt;
&amp;gt; In sym.int at 64&lt;br&gt;
&amp;nbsp;&amp;nbsp;In char.int at 9&lt;br&gt;
&amp;nbsp;&lt;br&gt;
ans =&lt;br&gt;
&amp;nbsp;&lt;br&gt;
int((-1/(x^2 - 1))^(1/2), x)&lt;br&gt;
&lt;br&gt;
Is there a way to make R2008b simplify 'sqrt(1/(1-x^2))' to '1/sqrt(1-x^2)'?</description>
    </item>
    <item>
      <pubDate>Sat, 13 Dec 2008 01:17:02 -0500</pubDate>
      <title>Re: int in R2008b, same integral?</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/240941#616740</link>
      <author>Georgios </author>
      <description>&quot;Joerg Buchholz&quot; &amp;lt;buchholz@hs-bremen.de&amp;gt; wrote in message &amp;lt;ghung9$3as$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; Is there a mathematical reason, why R2008b can solve:&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; &amp;gt;&amp;gt; int ('1/sqrt(1-x^2)')&lt;br&gt;
&amp;gt;  &lt;br&gt;
&amp;gt; ans =&lt;br&gt;
&amp;gt;  &lt;br&gt;
&amp;gt; asin(x)&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; but cannot solve: &lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; &amp;gt;&amp;gt; int ('sqrt(1/(1-x^2))')&lt;br&gt;
&amp;gt; Warning: Explicit integral could not be found. &lt;br&gt;
&amp;gt; &amp;gt; In sym.int at 64&lt;br&gt;
&amp;gt;   In char.int at 9&lt;br&gt;
&amp;gt;  &lt;br&gt;
&amp;gt; ans =&lt;br&gt;
&amp;gt;  &lt;br&gt;
&amp;gt; int((-1/(x^2 - 1))^(1/2), x)&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Is there a way to make R2008b simplify 'sqrt(1/(1-x^2))' to '1/sqrt(1-x^2)'?&lt;br&gt;
&lt;br&gt;
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.&lt;br&gt;
&lt;br&gt;
Regards,&lt;br&gt;
Georgios</description>
    </item>
    <item>
      <pubDate>Sat, 13 Dec 2008 02:11:05 -0500</pubDate>
      <title>Re: int in R2008b, same integral?</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/240941#616744</link>
      <author>Roger Stafford</author>
      <description>&quot;Georgios&quot; &amp;lt;gkokovid@yahoo.com&amp;gt; wrote in message &amp;lt;ghv2ee$h15$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &quot;Joerg Buchholz&quot; &amp;lt;buchholz@hs-bremen.de&amp;gt; wrote in message &amp;lt;ghung9$3as$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &amp;gt; .......&lt;br&gt;
&amp;gt; &amp;gt; Is there a way to make R2008b simplify 'sqrt(1/(1-x^2))' to '1/sqrt(1-x^2)'?&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; 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.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Regards,&lt;br&gt;
&amp;gt; Georgios&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;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 semi-circle, 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.&lt;br&gt;
&lt;br&gt;
Roger Stafford</description>
    </item>
    <item>
      <pubDate>Sat, 13 Dec 2008 05:21:02 -0500</pubDate>
      <title>Re: int in R2008b, same integral?</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/240941#616755</link>
      <author>Georgios </author>
      <description>&quot;Roger Stafford&quot; &amp;lt;ellieandrogerxyzzy@mindspring.com.invalid&amp;gt; wrote in message &amp;lt;ghv5jp$71n$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &quot;Georgios&quot; &amp;lt;gkokovid@yahoo.com&amp;gt; wrote in message &amp;lt;ghv2ee$h15$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &amp;gt; &quot;Joerg Buchholz&quot; &amp;lt;buchholz@hs-bremen.de&amp;gt; wrote in message &amp;lt;ghung9$3as$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; .......&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; Is there a way to make R2008b simplify 'sqrt(1/(1-x^2))' to '1/sqrt(1-x^2)'?&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; 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.&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; Regards,&lt;br&gt;
&amp;gt; &amp;gt; Georgios&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt;   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 semi-circle, 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.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Roger Stafford&lt;br&gt;
&lt;br&gt;
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. &lt;br&gt;
&lt;br&gt;
Regards,&lt;br&gt;
Georgios</description>
    </item>
    <item>
      <pubDate>Sat, 13 Dec 2008 12:46:02 -0500</pubDate>
      <title>Re: int in R2008b, same integral?</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/240941#616792</link>
      <author>Joerg Buchholz</author>
      <description>&quot;Georgios&quot; &lt;br&gt;
&amp;gt; If you integrate using a bounded range, say -1..1, then you should get an answer of pi for both.  &lt;br&gt;
&lt;br&gt;
&lt;br&gt;
Unfortunately, this is not the case:&lt;br&gt;
&lt;br&gt;
&amp;gt;&amp;gt; int ('sqrt(1/(1-x^2))', -1, 1)&lt;br&gt;
Warning: Explicit integral could not be found. &lt;br&gt;
&amp;gt; In sym.int at 64&lt;br&gt;
&amp;nbsp;&amp;nbsp;In char.int at 9&lt;br&gt;
&amp;nbsp;&lt;br&gt;
ans =&lt;br&gt;
&amp;nbsp;&lt;br&gt;
int((-1/(x^2 - 1))^(1/2), x = -1..1)&lt;br&gt;
&lt;br&gt;
Even explicitely restricting the range of x does not help:&lt;br&gt;
&lt;br&gt;
&amp;gt;&amp;gt; evalin (symengine, 'assume (x&amp;lt;1)');&lt;br&gt;
&amp;gt;&amp;gt; evalin (symengine, 'assumeAlso (x&amp;gt;-1)');&lt;br&gt;
&amp;gt;&amp;gt; evalin (symengine, 'getprop(x)')&lt;br&gt;
&amp;nbsp;&lt;br&gt;
ans =&lt;br&gt;
&amp;nbsp;&lt;br&gt;
(-1, 1)&lt;br&gt;
&amp;nbsp;&lt;br&gt;
&amp;gt;&amp;gt; int ('sqrt(1/(1-x^2))', -1, 1)&lt;br&gt;
Warning: Explicit integral could not be found. &lt;br&gt;
&amp;gt; In sym.int at 64&lt;br&gt;
&amp;nbsp;&amp;nbsp;In char.int at 9&lt;br&gt;
&amp;nbsp;&lt;br&gt;
ans =&lt;br&gt;
&amp;nbsp;&lt;br&gt;
int((-1/(x^2 - 1))^(1/2), x = -1..1)</description>
    </item>
    <item>
      <pubDate>Thu, 15 Jan 2009 15:52:01 -0500</pubDate>
      <title>Re: int in R2008b, same integral?</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/240941#621838</link>
      <author>Joerg Buchholz</author>
      <description>The bug has not been fixed in R2009a.&lt;br&gt;
&lt;br&gt;
&quot;Joerg Buchholz&quot; &amp;lt;buchholz@hs-bremen.de&amp;gt; wrote in message &amp;lt;gi0aqa$e0u$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &quot;Georgios&quot; &lt;br&gt;
&amp;gt; &amp;gt; If you integrate using a bounded range, say -1..1, then you should get an answer of pi for both.  &lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Unfortunately, this is not the case:&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; &amp;gt;&amp;gt; int ('sqrt(1/(1-x^2))', -1, 1)&lt;br&gt;
&amp;gt; Warning: Explicit integral could not be found. &lt;br&gt;
&amp;gt; &amp;gt; In sym.int at 64&lt;br&gt;
&amp;gt;   In char.int at 9&lt;br&gt;
&amp;gt;  &lt;br&gt;
&amp;gt; ans =&lt;br&gt;
&amp;gt;  &lt;br&gt;
&amp;gt; int((-1/(x^2 - 1))^(1/2), x = -1..1)&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Even explicitely restricting the range of x does not help:&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; &amp;gt;&amp;gt; evalin (symengine, 'assume (x&amp;lt;1)');&lt;br&gt;
&amp;gt; &amp;gt;&amp;gt; evalin (symengine, 'assumeAlso (x&amp;gt;-1)');&lt;br&gt;
&amp;gt; &amp;gt;&amp;gt; evalin (symengine, 'getprop(x)')&lt;br&gt;
&amp;gt;  &lt;br&gt;
&amp;gt; ans =&lt;br&gt;
&amp;gt;  &lt;br&gt;
&amp;gt; (-1, 1)&lt;br&gt;
&amp;gt;  &lt;br&gt;
&amp;gt; &amp;gt;&amp;gt; int ('sqrt(1/(1-x^2))', -1, 1)&lt;br&gt;
&amp;gt; Warning: Explicit integral could not be found. &lt;br&gt;
&amp;gt; &amp;gt; In sym.int at 64&lt;br&gt;
&amp;gt;   In char.int at 9&lt;br&gt;
&amp;gt;  &lt;br&gt;
&amp;gt; ans =&lt;br&gt;
&amp;gt;  &lt;br&gt;
&amp;gt; int((-1/(x^2 - 1))^(1/2), x = -1..1)</description>
    </item>
  </channel>
</rss>

