## 80 Reputation

18 years, 116 days

## MaplePrimes Activity

### These are replies submitted by ynakamura

Thanks, I think this is a perfect answer.

Thanks, I think this is a perfect answer.

## Still confusing......

Thank you for your comment. I think one of the good examples of difference between sum and add is as follows.
```sum(i^2, i=1..n);
3          2
(n + 1)    (n + 1)
-------- - -------- + n/6 + 1/6
3          2
```
However, I am still confusing about your example. I tried the followin two examples. Why does sum return 14 ? Example 1: I carried out in order, not in procedure.
```restart;
y:=i^2;
2
y := i
[14, 14]

```
Example 2. I replace y:=i^2 to y:=i->i^2
```proc()
local y,i;
y := i -> i^2;
return [add, sum](y(i), i = 1..3);
end proc();
[14, 14]
```
Yasuyuki NAKAMURA

## Still confusing......

Thank you for your comment. I think one of the good examples of difference between sum and add is as follows.
```sum(i^2, i=1..n);
3          2
(n + 1)    (n + 1)
-------- - -------- + n/6 + 1/6
3          2
```
However, I am still confusing about your example. I tried the followin two examples. Why does sum return 14 ? Example 1: I carried out in order, not in procedure.
```restart;
y:=i^2;
2
y := i
[14, 14]

```
Example 2. I replace y:=i^2 to y:=i->i^2
```proc()
local y,i;
y := i -> i^2;
return [add, sum](y(i), i = 1..3);
end proc();
[14, 14]
```
Yasuyuki NAKAMURA

## Yes, yes...

Yes, I completely agree with you. That's easiest way.

## Solution y(x) is substituted in deq2...

If you uncomment, the solution y(x) is substituded in deq2, because deq2 is defined using y(x). You can just replace y(x) with z(x), then you will get correct answer. Y. Nakamura
 1 2 Page 2 of 2
﻿