Mathematica 9 is now available
Student Support Forum
-----
Student Support Forum: 'Help with changing variables' topicStudent Support Forum > General > Archives > "Help with changing variables"

< Previous CommentHelp | Reply To Comment | Reply To Topic
Author Comment/Response
Adam
08/30/12 12:32pm

In Response To 'Re: Help with changing variables'
---------
Thanks. I don't think this is quite what I want to do, which is more along the lines of this:

In[1]:= exp1[r_] := D[b[r], r] + D[n[r], r]

In[2]:= exp1[r] /. {b -> Function[r, b[1/r]], r -> 1/x}
Out[2]:= -x^2 b′[x]+n′[1/x]

Except in this case I've only done the transformation to b[r]. I'd like to be able to apply it to all functions in this expression, including n[r] and any other functions which may be there, without transforming each one individually. So I figure I should be able to do some sort of pattern-matching, but I can't figure out how to do that.

For clarification, I'm looking for the simplest way of changing variables in a differential expression or equation in Mathematica. I'd think that wouldn't be a tough thing to do. This method of replacing b -> Function[r, b[1/r]], r -> 1/x may not be that way, but it's one that I've found which works somewhat.

URL: ,

Subject (listing for 'Help with changing variables')
Author Date Posted
Help with changing variables Adam 08/27/12 10:22pm
Re: Help with changing variables Bill Simpson 08/28/12 5:04pm
Re: Re: Help with changing variables Adam 08/30/12 12:32pm
< Previous CommentHelp | Reply To Comment | Reply To Topic