You are Here: Home >< Maths

1. It's not a big problem but I'm stuck and can't seem to find the mistake.

> simpson:=proc(g,N,a,b)
local h, f, F: h:=(b-a)/(N):
f:=unapply(g,x):
if type(N,odd) =true, then:
print ("Error:-N must be even"):
else: F:=(h/(3))*(f(a)+f(b)+4*(sum(f(a+2*i*h-h) , i=1..(N/(2))))+2*(sum(f(a+2*j*h) ,j=1..(N/(2))-1)));
end proc
Error, unterminated procedure
2. Adding fi: before end proc gives me the error: invalid sequence with type(N,odd)=true, then: as the highlighted part.
3. Ignore this, managed to work it out (I think)

TSR Support Team

We have a brilliant team of more than 60 Support Team members looking after discussions on The Student Room, helping to make it a fun, safe and useful place to hang out.

This forum is supported by:
Updated: December 15, 2010
Today on TSR

### Cambridge interview invitations

Has yours come through yet?

### Official Oxford interview invite list

Discussions on TSR

• Latest
• ## See more of what you like on The Student Room

You can personalise what you see on TSR. Tell us a little about yourself to get started.

• Useful resources

### Maths Forum posting guidelines

Not sure where to post? Read the updated guidelines here

### How to use LaTex

Writing equations the easy way

### Study habits of A* students

Top tips from students who have already aced their exams

## Groups associated with this forum:

View associated groups
Discussions on TSR

• Latest
• ## See more of what you like on The Student Room

You can personalise what you see on TSR. Tell us a little about yourself to get started.

• The Student Room, Get Revising and Marked by Teachers are trading names of The Student Room Group Ltd.

Register Number: 04666380 (England and Wales), VAT No. 806 8067 22 Registered Office: International House, Queens Road, Brighton, BN1 3XE

Reputation gems: You get these gems as you gain rep from other members for making good contributions and giving helpful advice.