3
$\begingroup$

How can you change

f[g[x,t],t]

to

f[g,t]

?

I have differential equations

Derivative[1,0][f][g[x,t],t]== f[g[x,t],t]*t+Derivative[2,0]f[g[x,t],t]

And

f'[g[x,t]]== f[g[x,t]]*t+f''[g[x,t]]

And I'd like to use DSolve with $g$ as an independant variable, meaning :

DSolve[Derivative[1,0][f][g,t]== f[g,t]*t+Derivative[2,0]f[g,t],f,{g,t}]

I tried :

(f'[g[x,t]]== f[g[x,t]]*t+f''[g[x,t]])/.g[x,t]-> g

but it failed

$\endgroup$
  • $\begingroup$ If you are only dealing with a single example with the same variables, the easiest way is to just use Find and Replace. $\endgroup$ – kickert Aug 8 at 14:22
6
$\begingroup$
f[g[x,t],t] /. g[___]->g
(*    f[g, t]    *)
$\endgroup$
2
$\begingroup$

put bracket around f in the Derivative-commands f -> [f]:

Derivative[1, 0][f][g[x, t], t] ==f[g[x, t], t]*t + Derivative[2, 0][f][g[x, t], t]
(*\!\(\*SuperscriptBox[\(f\), TagBox[RowBox[{"(", RowBox[{"1", ",", "0"}], ")"}],Derivative],MultilineFunction->None]\)[g, t] == t f[g, t] + \!(\*SuperscriptBox[\(f\), TagBox[RowBox[{"(", RowBox[{"2", ",", "0"}], ")"}],Derivative],MultilineFunction->None]\)[g, t]*)
$\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.