10
$\begingroup$

There is a simple differential equation $ y''(x) + (\varepsilon - x^2) y(x) = 0 $. If one uses the new variable $ x^2 = s $, using the chain rule, this differential equation becomes $ 4 s y''(s) + 2 y'(s) + (\varepsilon - s) y(s) = 0 $. Now, I want to do it in Mathematica. I define the differential equatrion as

diff[x_] := y''[x] + (ε - x^2) y[x];

Simplify[diff[x] /. x^2 -> s]

But, it does not work. How can I figure it out?

$\endgroup$
9
$\begingroup$
deq = y''[x] + (epsilon - x^2) y[x];

deq /. {y -> (y[#^2] &)} /. x -> Sqrt[s]
(*(epsilon - s) y[s] + 4 s y''[s] + 2 y'[s]*)
|improve this answer|||||
$\endgroup$
8
$\begingroup$

Another option is to use the package MoreCalculus by Kuba

<< MoreCalculus`
diff[x_] := y''[x] + (epsilon - x^2) y[x] == 0;
DChange[diff[x], {x^2 == s}, {x}, {s}, y[x]]

$$ \epsilon y(s)+4 s y''(s)+2 y'(s)=s y(s) $$

|improve this answer|||||
$\endgroup$
  • $\begingroup$ Worth mentioning that DChange is the only function contained in that package at the moment. $\endgroup$ – probably_someone Feb 25 at 21:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.