Mathematica 9 is now available
Student Support Forum
-----
Student Support Forum: 'Integrate & NIntegrate gives two different values' topicStudent Support Forum > General > "Integrate & NIntegrate gives two different values"

Next Comment >Help | Reply To Topic
Author Comment/Response
Vijay Kumar
06/28/11 5:07pm

Hi,
I was evaluating a function with Mathematica 7 and found that using
Integrate and NIntegrate gives me two different answers. I'm not sure which
one to trust. This is the code I use:

Z=1.8751;
phi = Cosh[Z*s]-Cos[Z*s]+(Sin[Z*s]-Sinh[Z*s])*(Cosh[Z]+Cos[Z])/(Sin[Z]+Sinh[Z]
);

Integrate[phi*D[phi,{s,2}]*Integrate[Integrate[(D[phi,{s,1}])^2,{s,0,s}],{s,1,
s}],{s,0,1}]

NIntegrate[phi*D[phi,{s,2}]*Integrate[Integrate[(D[phi,{s,1}])^2,{s,0,s}],{s,
1,s}],{s,0,1}]

The first one gives an answer of -17.3646 and the second one gives -1.12795.

Which one is correct? If someone could help me figure this one out, it would
be great.

Thanks

Vijay

URL: ,

Subject (listing for 'Integrate & NIntegrate gives two different values')
Author Date Posted
Integrate & NIntegrate gives two different values Vijay Kumar 06/28/11 5:07pm
Re: Integrate & NIntegrate gives two different ... jf 06/29/11 12:44pm
Re: Integrate & NIntegrate gives two different ... Vijay Kumar 06/29/11 1:36pm
Next Comment >Help | Reply To Topic