MathGroup Archive 2001

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

Search the Archive

Re: simple Problem: D[ ]


I see no reason why it doesn't work.

In[1]:=
f[x] = x^2;

In[2]:=
D[f[x], x]
Out[2]=
2 x

I suggest you define your f using the SetDelayed feature of Mathematica and
a pattern as formal parameter. E.g.

In[3]:=
g[x_] := x^2;

In[4]:=
D[g[x], x]
Out[4]=
2 x

This way you can use your function in a more general way. For example, you
cannot change the name of your variable with f, since Mathematica has no way
of knowing its meaning:

In[5]:=
D[f[y], y]
Out[5]=
f'[y]


whereas g can be handled normally:

In[6]:=
D[g[y], y]
Out[6]=
2 y

Tomas Garza
Mexico City

----- Original Message -----
From: "Christian Maier" <maier1 at sbox.tu-graz.ac.at>
To: mathgroup at smc.vnet.net
Subject: [mg27349] [mg27310] simple Problem: D[ ]


>
> I use mathmatica the first time and have a problem with a deriviation:
>
> in a simple problem:
>
> f[x]=x^2
> abl=D[f[x],x]
>
> then Mathematica puts out f[x]'    , but not 2 x
>
> How does it work correctly?
> Thank aou in advance!
>
> Christian Maier
>
>
>



  • Prev by Date: Re: page breaks ?
  • Next by Date: Re: UnitStep[] Problem.
  • Previous by thread: Re: simple Problem: D[ ]
  • Next by thread: Re: simple Problem: D[ ]