Question: Summation procedure



I would like to do the following procedure from a basic concept, but I can't figure out what I'm doing wrong (sorry for that, I'm a beginner). I have tried to look up some more information about procedures on the Help menu with no success. Here you have what I'm planning to do:

Considering the following function (which approximates the cosine function):


I would like to create a procedure which gives the same results the function gives. Here you have one of my several attempts:

local resp,i;
if n>=0 then
for i from 0 to n do
end do;
end if;
end proc;

 However, Maple doesn't accept it, so I guess something must be wrong, even though I don't know what it is. I would be grateful if you could help me with this.


Thank  you very much for your attention.


Happy New Year 2013!

Please Wait...