Message Boards Message Boards

Differentiating a function with multiple variables?

Posted 8 years ago

I have problems when trying to differentite Zbeta respect to b and then defining a function with Zbeta respect to other variable which was a parameter... how's the proper way to proceed?

Attachments:
POSTED BY: tomas giud
4 Replies
Posted 8 years ago

If you point out the dependency on e to Mathematica like this

In[1]:= Z?[b_, e_] := 0.5 (Exp[-2 b e] + Exp[-b e] + 1)^2

In[2]:= L[b_, e_] := -Log[Z?[b, e]]

In[3]:= ?prom[b_, e_] := D[L[b, e], b]

In[4]:= ?prom[b, e]

Out[4]= -((2. (-2 e E^(-2 b e) - e E^(-b e)))/(1 + E^(-2 b e) + E^(-b e)))

then does everything work?

POSTED BY: Bill Simpson
Posted 8 years ago

If after the third line I ask the value of D[L[b], b] I get an expression wich has both b and e. Then why canĀ“t I define a function with argument e_ calling the latter expression on the right hand side ...if i directly write the expresion, it works! but if i call the equivalent expression it doesn't! I do know that defining functions require to have the same symbol on both sides of the definition I also know that what i said fixes my problem, but I can't understand why it's a problem in the first place. why does mathematica makes a difference

POSTED BY: tomas giud
Posted 8 years ago

If you compare

FullForm[?prom[e]]

with

FullForm[?prom[f]]

you should notice that the two are the same. You might think that one should have replaced all the "e" with "f".

I believe your problems are caused by your use of one symbol as a pattern on the left hand side of your function definition, but not having that symbol appear on the right hand side. I believe you are assuming that your "e" on the left hand side is going to leak across and through several function definitions to get to the e in the previous definitions. That doesn't appear to be happening.

From this description try writing a few other function definitions that do and do not use the same symbol name on both the left and right hand sides of a single function and see if you can begin to guess what kinds of function definition and parameter naming will work.

POSTED BY: Bill Simpson
Posted 8 years ago

I can't figure why [Epsilon]prom2[e_] := [Epsilon]prom[e] /. b -> [Beta] gives an expression appearently usefull but when evaluating epsilonprom2[3] it does nothing at all

POSTED BY: tomas giud
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract