2
$\begingroup$

Lets say I have the following PDE:

$$x^2 u_{xx} - u_{yy} + u_y = 0$$

And I have the following change of variables:

$$ s(x,y) = x e^y \, \, \, , \, \, t(x,y) = x e^{-y}$$

How can I use Mathematica to compute $u_{xx}, u_{yy},u_y$ on terms of $u_{ss},u_{tt}, u_{ts},u_t,u_s$ using the definitions and the chain rule?

$\endgroup$
  • 1
    $\begingroup$ If I understand well, closely related: 44904, possible duplicate: 9351 $\endgroup$ – Kuba Jun 15 '14 at 16:43
9
$\begingroup$
expr = x^2 D[u[x, y], {x, 2}] - D[u[x, y], {y, 2}] + D[u[x, y], y]

enter image description here

$Assumptions = {s > 0, t > 0}
expr /. u -> (u[# Exp[#2], # Exp[-#2]] &) /. {x -> Sqrt[s t],
                                              y -> Log[Sqrt[s/t]]} // Simplify

enter image description here


Second set of replacement rules is from:

Eliminate[s == x Exp[y] && t == x Exp[-y], x]
Eliminate[s == x Exp[y] && t == x Exp[-y], y]
E^(2 y) t == s
s t == x^2 && (s t)/x == x

I've forced $Assumptions so things like Sqrt[s^2] are reduced to s but keep them in mind. Sometimes it may be important.

$\endgroup$
1
$\begingroup$

Just in case someone else need it (for example, quite possibly myself in the future), this is how I've done it

(Note: In the answer a different change of variables has been used)

s[x_, y_] := Log[x] + y
t[x_, y_] := Log[x] - y
Factor@D[u[s[x, y], t[x, y]], {x, 2}]
FullSimplify@D[u[s[x, y], t[x, y]], y]
Factor@D[u[s[x, y], t[x, y]], {y, 2}]
x^2 D[u[s[x, y], t[x, y]], {x, 2}] - 
  Factor@D[u[s[x, y], t[x, y]], {y, 2}] + 
  FullSimplify@D[u[s[x, y], t[x, y]], y] // FullSimplify

Which outputs the following:

enter image description here

Reading the output is quite anoying, but it was good enough for what I needed. (I'm sure it can be improved easily)

$\endgroup$

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.