| Author |
Comment/Response |
Randy Silvers
|
11/03/08 2:48pm
Sure; user-defined functions have most of the same properties as the built-in functions.
Suppose you have y[x_]:=x^2 and z[x_]:=2x+Log[x]
Then,
L[x_]:=y[x]+z[x]
so that
L[e] returns
e^2+2e+1
If you want to differentiate,
D[L[u],u] returns 2+1/u+2u
Note that "x" is a local variable when defining functions, so you could have defined L using any name, and thus call on it using any other name. That name gets passed to the functions y and z as the argument of those functions.
URL: sirandol@deakin.edu.au, |
|