Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
1998
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 1998

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

Search the Archive

Derivatives D[ ] as Functions inside Tables; Need Help!

  • To: mathgroup at smc.vnet.net
  • Subject: [mg13102] Derivatives D[ ] as Functions inside Tables; Need Help!
  • From: siegman at ee.stanford.edu (AES)
  • Date: Tue, 7 Jul 1998 03:44:07 -0400
  • Organization: Stanford University
  • Sender: owner-wri-mathgroup at wolfram.com

I'm trying to define a function f1[a,x] and its derivative f2[a,x], 
where from my point of view x is the independent variable and   "a" is
a parameter I'll change on different runs.  So I write, as a simple
example:

   Remove["Global`*"]

   f1[a_,x_] :=a Cos[x] + a^2 Sin[x]

   f1[a,x]

   f2[a_,x_] := D[f1[a,x],x]

   f2[a,x]

   a=2

   f1[a,x]

   f2[a,x]

   Table[{x, f1[a,x], f2[a.x]} // N, {x,0,4}] // TableForm

and everything looks fine -- except the function f2[a,x] will not
evaluate inside the Table[ ].  I don't understand this -- help in
understanding will be much appreciated.

     siegman at ee.stanford.edu


  • Prev by Date: Re: Random[Real]: How good is it? Is it better/worse than Park-Miller, etc?
  • Next by Date: Re: Fibonacci
  • Previous by thread: Re: Random[Real]: How good is it? Is it better/worse than Park-Miller, etc?
  • Next by thread: Re: Derivatives D[ ] as Functions inside Tables; Need Help!