<rss xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" version="2.0">
  <channel>
    <title>MaplePrimes - comments on Post, n=1..2, or n=1..N where N = 2</title>
    <link>http://www.mapleprimes.com/posts/43082-N12-Or-N1N-Where-N--2</link>
    <language>en-us</language>
    <copyright>2026 Maplesoft, A Division of Waterloo Maple Inc.</copyright>
    <generator>Maplesoft Document System</generator>
    <lastBuildDate>Thu, 11 Jun 2026 07:32:24 GMT</lastBuildDate>
    <pubDate>Thu, 11 Jun 2026 07:32:24 GMT</pubDate>
    <itunes:subtitle />
    <itunes:summary />
    <description>The latest comments added to the Post, n=1..2, or n=1..N where N = 2</description>
    <image>
      <url>http://www.mapleprimes.com/images/mapleprimeswhite.jpg</url>
      <title>MaplePrimes - comments on Post, n=1..2, or n=1..N where N = 2</title>
      <link>http://www.mapleprimes.com/posts/43082-N12-Or-N1N-Where-N--2</link>
    </image>
    <item>
      <title>Sum is another possibility</title>
      <link>http://www.mapleprimes.com/posts/43082-N12-Or-N1N-Where-N--2?ref=Feed:MaplePrimes:n=1..2, or n=1..N where N = 2:Comments#comment80088</link>
      <itunes:summary>Very interesting. Not sure why zero results.
Using Sum rather than sum in part 2 is better:

#Part 4.
restart;
N:=2;
u:=(t,x)-&gt;Sum(a[n](t)*sin(n*Pi*x),n=1..N);
u(t,x);
diff(u(t,x),t);
D[1](u)(t,x);
value(%); </itunes:summary>
      <description>The latest comments added to the Post, n=1..2, or n=1..N where N = 2</description>
      <guid>80088</guid>
      <pubDate>Fri, 10 Mar 2006 08:02:03 Z</pubDate>
      <itunes:author>dharr</itunes:author>
      <author>dharr</author>
    </item>
    <item>
      <title>fun with arrow operators and sum</title>
      <link>http://www.mapleprimes.com/posts/43082-N12-Or-N1N-Where-N--2?ref=Feed:MaplePrimes:n=1..2, or n=1..N where N = 2:Comments#comment86609</link>
      <itunes:summary>Jim,

I am not sure why you see 0 as a result either. I do see two reasons to not use the particular implementations that you have shown.
&lt;ol&gt;
&lt;li&gt;
when defining a function with an arrow operator, the rhs of the -&gt; is not evaluated at execution&lt;p&gt;
This means Maple sees the N as a local variable to the function, to have N as a true parameter in this function, you should use unapply (and not define N until after the function definition)
&lt;/li&gt;
&lt;li&gt;
sum (and Sum) are used for symbolic sums, or sums with variable numbes of terms&lt;p&gt;
Use add for adding a finite collection of terms. In your original posts, N is fixed BEFORE defining the function so add can be used. In my recommendation, below, N is not defined at the function definition so you MUST use sum (or Sum).
&lt;/li&gt;
&lt;/ol&gt;

Here is my recommendation for implementing your function:

&lt;pre&gt;
restart;
U := unapply( sum(a[n](t)*sin(n*Pi*x),n=1..N), (t,x) );
N := 2;
U(t,x);
diff( U(t,x), t );
D[1](U)(t,x);
&lt;/pre&gt;

Note that it makes no difference here if you use sum or add - so long as N is finite.

Doug

Doug
-----------------------------------------------------------------
Prof. Douglas B. Meade     Phone:  (803) 777-6183
Department of Mathematics  URL:    http://www.math.sc.edu/~meade/
USC, Columbia, SC 29208    E-mail: mailto:meade@math.sc.edu
</itunes:summary>
      <description>The latest comments added to the Post, n=1..2, or n=1..N where N = 2</description>
      <guid>86609</guid>
      <pubDate>Fri, 10 Mar 2006 22:30:45 Z</pubDate>
      <itunes:author>Doug Meade</itunes:author>
      <author>Doug Meade</author>
    </item>
    <item>
      <title>The Dreaded Evaluation Rule Strikes Again</title>
      <link>http://www.mapleprimes.com/posts/43082-N12-Or-N1N-Where-N--2?ref=Feed:MaplePrimes:n=1..2, or n=1..N where N = 2:Comments#comment90586</link>
      <itunes:summary>Hello Jim,

Just to add to the fun, try adding an extra command at the end of your Part 3 thus
&gt;convert(%,diff);

Regards,
J. Tarr</itunes:summary>
      <description>The latest comments added to the Post, n=1..2, or n=1..N where N = 2</description>
      <guid>90586</guid>
      <pubDate>Sat, 11 Mar 2006 00:55:00 Z</pubDate>
      <itunes:author>Mariner</itunes:author>
      <author>Mariner</author>
    </item>
    <item>
      <title>The Dreaded Evaluation Rule Strikes Again</title>
      <link>http://www.mapleprimes.com/posts/43082-N12-Or-N1N-Where-N--2?ref=Feed:MaplePrimes:n=1..2, or n=1..N where N = 2:Comments#comment90596</link>
      <itunes:summary>Inserting the “expand</itunes:summary>
      <description>The latest comments added to the Post, n=1..2, or n=1..N where N = 2</description>
      <guid>90596</guid>
      <pubDate>Thu, 16 Mar 2006 17:53:10 Z</pubDate>
      <itunes:author>Mariner</itunes:author>
      <author>Mariner</author>
    </item>
    <item>
      <title>workaround</title>
      <link>http://www.mapleprimes.com/posts/43082-N12-Or-N1N-Where-N--2?ref=Feed:MaplePrimes:n=1..2, or n=1..N where N = 2:Comments#comment90604</link>
      <itunes:summary>The -&gt; notation does not evaluate the formula, so it just has 'N' in it,
not 2.  The workaround causes the evaluation.  BUT that still leaves the question of why these two are different:

&lt;p &gt;&lt;strong &gt;&lt;font color="#ff0000" face="Monospaced"&gt;&gt; restart;sum(a[n](t)*b(n),n=1..N);diff(%,t);&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p &gt;&lt;center &gt;&lt;img src="http://maplenet.maplesoft.com/maplenet/primes/3750a6b04dcfc4397a4483bd7417238a.gif" alt='Maple Equation' align='absMiddle' /&gt;&lt;/center&gt;&lt;/p&gt;
&lt;p &gt;&lt;center &gt;&lt;img src="http://maplenet.maplesoft.com/maplenet/primes/f309e7cb1bebbbc1fecef6526db9e894.gif" alt='Maple Equation' align='absMiddle' /&gt;&lt;/center&gt;&lt;/p&gt;
&lt;p &gt;&lt;strong &gt;&lt;font color="#ff0000" face="Monospaced"&gt;&gt; restart;sum(a[n](t)*exp(n),n=1..N);diff(%,t);&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p &gt;&lt;center &gt;&lt;img src="http://maplenet.maplesoft.com/maplenet/primes/720ee954267606fe33da9e505a09c08c.gif" alt='Maple Equation' align='absMiddle' /&gt;&lt;/center&gt;&lt;/p&gt;
&lt;p &gt;&lt;center &gt;&lt;img src="http://maplenet.maplesoft.com/maplenet/primes/d3871640fbbce2fdeed9635249664203.gif" alt='Maple Equation' align='absMiddle' /&gt;&lt;/center&gt;&lt;/p&gt;
&lt;p&gt;This post generated using the online &lt;a href="http://beta.mapleprimes.com/mwconvert"&gt;HTML conversion tool&lt;br&gt;&lt;/a&gt; 
				&lt;a href="http://beta.mapleprimes.com/files/85_mar22.mw"&gt;Download the original worksheet&lt;/a&gt; 
				&lt;a href="http://maplenet.maplesoft.com/maplenet/worksheet/mapleprimes/85_mar22.mw"&gt;View worksheet on MapleNET&lt;/a&gt;&lt;/p&gt; 
</itunes:summary>
      <description>The latest comments added to the Post, n=1..2, or n=1..N where N = 2</description>
      <guid>90604</guid>
      <pubDate>Wed, 22 Mar 2006 18:55:51 Z</pubDate>
      <itunes:author>edgar</itunes:author>
      <author>edgar</author>
    </item>
  </channel>
</rss>