The Student Room Group

Simpsons Method - help

Hi, I have a question which asks me to evaluate 0π21(12Cos(x)2)dx \displaystyle\int^\frac{\pi}{2} _0 \dfrac{1}{\sqrt(1-2Cos(x)^2)} dx

Using Simpson's rule 40 times. (Using mathematica)

I have a = 0 0 ; b = Π2\frac{\Pi}{2}, n = 40 40 , h = ba2n \frac{b-a}{2n}

I have notices though, that I should have x = a +ih for i = 0, ... , 2n

But even for i = 0, I have:

f[x] = 1(12Cos(0)2)=1(12)=i \dfrac{1}{\sqrt(1-2Cos(0)^2)} = \dfrac{1}{\sqrt(1-2)} = -i

I'm not sure where I'm going wrong.

My mathematica seems to have decided that dividing by 0 is too much to handle, and has crashed :frown:

Any help would be appreciated
(edited 11 years ago)
Original post by ekudamram

Any help would be appreciated


Well 12cos2θcos2θ1-2\cos^2\theta\equiv -\cos2\theta and is going to be negative in the interval [0,π/4) [ 0,\pi/4).

So, I don't see how you can apply Simpson's rule to this.

Are you sure the function/limts are correct?
Reply 2
Original post by ghostwalker
Well 12cos2θcos2θ1-2\cos^2\theta\equiv -\cos2\theta and is going to be negative in the interval [0,π/4) [ 0,\pi/4).

So, I don't see how you can apply Simpson's rule to this.

Are you sure the function/limts are correct?


Yeah, I've written down exactly what he gave in the question.

The only thing I can think of is that he's written it down wrong, as if it was

f(x)=1(1+2Cos(x)2)dx f(x) = \dfrac{1}{\sqrt(1+2Cos(x)^2)} dx

Then this gives 0π2f(x)dx1.171420084 \displaystyle\int^\frac{\pi}{2} _0 f(x) dx \approx 1.171420084
Original post by ekudamram
Yeah, I've written down exactly what he gave in the question.

The only thing I can think of is that he's written it down wrong, as if it was

f(x)=1(1+2Cos(x)2)dx f(x) = \dfrac{1}{\sqrt(1+2Cos(x)^2)} dx

Then this gives 0π2f(x)dx1.171420084 \displaystyle\int^\frac{\pi}{2} _0 f(x) dx \approx 1.171420084


I'd check back with the person who gave you the question, if that's possible.

Failing that others on the course.

Failing that go with what you think it should be - as per your previous post.
Reply 4
Original post by ghostwalker
I'd check back with the person who gave you the question, if that's possible.

Failing that others on the course.

Failing that go with what you think it should be - as per your previous post.


Yeah, I have emailed him, but I'm not expecting any reply until at least tuesday, so I will ask someone on my course.
Although the only person I really know is celebrating her anniversary with her boyfriend today, so I'll leave it for tonight.

But yeah, I think it must be written down wrong, although I've spent all day today trying to work around it, so that's 8 hours wasted :frown:

Thank you for helping though :smile:
(edited 11 years ago)

Quick Reply

Latest