MathGroup Archive 2001

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Bug in Integrate?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg28775] Re: [mg28744] Bug in Integrate?
  • From: BobHanlon at aol.com
  • Date: Sat, 12 May 2001 01:36:42 -0400 (EDT)
  • Sender: owner-wri-mathgroup at wolfram.com

There is a problem.  Use numerical integration

f[x_] := Abs[x^4 - 4x^3 + 2x^2 + 1];

Plot[f[x], {x, 0, 4}];

NIntegrate[f[x], {x, 0, 4}]

\!\(\*FormBox[
  RowBox[{\(NIntegrate::"ncvb"\), \(\(:\)\(\ \)\), "\<\"NIntegrate failed to \
converge to prescribed accuracy after \\!\\(TraditionalForm\\`7\\) recursive \
bisections in \\!\\(TraditionalForm\\`x\\) near \\!\\(TraditionalForm\\`x\\) \
= \\!\\(TraditionalForm\\`3.390625`\\).\"\>"}], TraditionalForm]\)

23.529273252933095

lim = Partition[
      Flatten[{0, 
          Select[x /. Simplify[Solve[x^4 - 4x^3 + 2x^2 + 1 == 0, x]], 
            Element[#, Reals] && 0<=#<=4&], 4}], 2, 1];

Plus @@ (NIntegrate[f[x], {x, #[[1]], #[[2]]}]& /@ lim)

23.529273034761246


Bob Hanlon

In a message dated 2001/5/11 8:18:14 PM, rcwil at win.tue.nl writes:

>I am a very enthusiastic Mathematica user.
>Mathematica has become faster, but what I like more is reliable integration.
>In Mathematica 4.1 evaluating the expression
>
>Integrate[Abs[x^4 - 4x^3 + 2x^2 + 1], {x, 0, 4}]
>
>gives me -14/5 as the result, what of course can not be correct.
>Or am I overlooking something?
>


  • Prev by Date: Re: Replacing Parts of a List
  • Next by Date: Re: Peculiar behavior of DiscreteDelta
  • Previous by thread: Bug in Integrate?
  • Next by thread: Re: Bug in Integrate?