Mathematica 9 is now available
Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2008

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

Search the Archive

Re: SetDelayed

  • To: mathgroup at smc.vnet.net
  • Subject: [mg92884] Re: SetDelayed
  • From: Szabolcs Horvát <szhorvat at gmail.com>
  • Date: Fri, 17 Oct 2008 05:21:49 -0400 (EDT)
  • Organization: University of Bergen
  • References: <gd7068$iba$1@smc.vnet.net>

Itzhak wrote:
> Why does Mathematica reply with:
> 
> ..."Integrand [(x-Cos[y])/(1+x^2-2*x*Cos[y])^1.5 is not numerical at {y}={1.5708}", to the following:
> 
> Clear[f]
> f[x_]:=NIntegrate[(x-Cos[y])/(1+x^2-2*x*Cos[y])^1.5,{y,0,Pi}];
> Plot[Evaluate[f[x],{x,0,2}]
> 

Because you used Evaluate, and x is a symbol.

f[x_?NumericQ]:=NIntegrate[(x-Cos[y])/(1+x^2-2*x*Cos[y])^1.5,{y,0,Pi}];
Plot[f[x],{x,0,2}]


  • Prev by Date: Re: Export as PDF without " for strings
  • Next by Date: Hubble's Constant
  • Previous by thread: SetDelayed
  • Next by thread: Re: SetDelayed