MathGroup Archive 2005

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

Search the Archive

Re: assigning functions

  • To: mathgroup at smc.vnet.net
  • Subject: [mg56238] Re: [mg56204] assigning functions
  • From: "Christoph Lhotka" <lhotka at astro.univie.ac.at>
  • Date: Wed, 20 Apr 2005 05:30:13 -0400 (EDT)
  • Sender: owner-wri-mathgroup at wolfram.com

Hi!

In[1]:=  f[x_]:= x^2
In[2]:=fprime[x0_]:=D[f[x],x]/.x->x0

In[3]:= f[8]
Out[3]:= 64

In[4]:= fprime[8]
Out[4]:= 16

with kind regards...

On Tue, 19 Apr 2005 04:55:01 -0400 (EDT)
 juejung <juejung at indiana.edu> wrote:
> dear all,
> 
> i would like to do the following.
> assign a function:
> f[x_] := x^2;
> 
> take its derivate:
> D[f[x], x]
> 
> and assign the result of this to a new function, like fprime[x]:
> fprime[x_] := D[f[x], x]
> 
> unfortunately that doesn't work.
> when i try to evaluate fprime[2] i get an error message.
> 
> can somebody please help, this haunts me for a while now.
> 
> thanks and all the best
> 
> juergen
> 


-- Christoph Lhotka --
University of Vienna
Institute for Astronomy
Tuerkenschanzstr. 17 
1180 Vienna, Austria
fon. +43.1.4277.518.41
mail. lhotka at astro.univie.ac.at


  • Prev by Date: Re: Eigensystem Bug? OS-X
  • Next by Date: Re: plot on condition
  • Previous by thread: Re: assigning functions
  • Next by thread: Re: assigning functions