MathGroup Archive 2005

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

Search the Archive

Re: variable substitution in differential eqns


Joseph Fagan wrote:
> For Calculus of Variations, I need to make some hairy variable
> substitutions.
> 
> A simple substitution example is shown here in the first few lines.
> 
> See
> http://mathworld.wolfram.com/Second-OrderOrdinaryDifferentialEquation.html
> 
> If I make the substitution x=1/z how can I get Mathematica to give
> me eqn (2)
> and eqn (5)
> and, being greedy, eqn (6)?
> or point me to where to begin.
> 
> Thanks
> Joe 
> 

The question is how to convert y''[x] to the appropriate expression when 
x -> 1/z. One idea is to use Composition:

In[23]:=
y''[x] /. y->Composition[y,1/#&] /. x->1/z

Out[23]=
    3          4
2 z  y'[z] + z  y''[z]

The equation to be transformed has the left hand side:

lhs = y''[x] + P[x]y'[x] + Q[x]y[x]

Using the Composition rule, we find:

In[25]:=
lhs /. y->Composition[y,1/#&] /. x->1/z

Out[25]=
   1            3          2   1           4
Q[-] y[z] + 2 z  y'[z] - z  P[-] y'[z] + z  y''[z]
   z                           z

If we want to have Q and P transformed as well, we should include 
Composition rules for them too:

In[26]:=
lhs /. h_ /; MemberQ[{P,Q,y},h] -> Composition[h,1/#&] /. x->1/z

Out[26]=
                3          2               4
Q[z] y[z] + 2 z  y'[z] - z  P[z] y'[z] + z  y''[z]

This agrees with equation (6) from the MathWorld link.

Carl Woll
Wolfram Research


  • Prev by Date: Re: Removed[$$Failure] in Integrate
  • Next by Date: Re: Cell execution dependence
  • Previous by thread: variable substitution in differential eqns
  • Next by thread: Re: Re: variable substitution in differential eqns