# From f[g[x,t]] to f[g]

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

• If you are only dealing with a single example with the same variables, the easiest way is to just use Find and Replace. – kickert Aug 8 '19 at 14:22

f[g[x,t],t] /. g[___]->g

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]*)