MathGroup Archive 2005

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

Search the Archive

Re: Two related question. Question 1


Vlad,

f = #1^2 + #2 &;
c = #^2 &;

cf = Composition[c, f];(a^2 + b)^2
cf[a, b]
(a^2 + b)^2


Since f and cf are functions with two arguments, you need to use two
arguments in the Derivative statement.

Derivative[1, 0][f][a, b]
2 a

Derivative[0, 1][f][a, b]
1

Derivative[1, 0][cf][a, b]
4*a*(a^2 + b)

David Park
djmp at earthlink.net
http://home.earthlink.net/~djmp/


From: Kazimir [mailto:kazimir04 at yahoo.co.uk]
To: mathgroup at smc.vnet.net


I have two related question. Let me introduce a pure function

f = #1^2 + #2 &

Now. I want to make an operation over the function, for example to
find its square and to call the result (the expected function f = (#1^2
+ #2)^2 & ) c:

c=f^2

However, I do not obtain this, as

c[a,b]

does not evaluate to (a+b)^2. Can anybody advise me how to obtain
such a function without long substitutions. I would like to obtain
something which is made for derivatives :

In[11]:=
Derivative[1][f]

Out[11]=
2 #1&

In[12]:=
Derivative[2][f]

Out[12]=
2&

Regards

Vlad





  • Prev by Date: opposite of partition
  • Next by Date: Re: sum the elements of a list
  • Previous by thread: Re: Two related question. Question 1
  • Next by thread: Re: Two related question. Question 1