Wave function of a free particle

I’m trying to write a function of a free particle in momentum space that includes a nested function which has a momentum dependency. However I do not know how to tell mathematica to treat this as a nested function, g[p], within the outer function f[p,t].

f[p_, t_] := g Exp[(-I* p^2*t)/(m *\[HBar])], 
Assumptions -> m > 0 && \[HBar] > 0 && g[p_];

any help would be greatly appreciated!

Cheers,
Dev

Edit:
here’s what the function is supposed to look like:

Capture.PNG

I am intending to perform multiple linear operations on it and would like to have it well-defined function so I dont have to type it out each time.

What does it mean for a function to be “a nested function g[p], within the outer function f[p,t]”.

In my experience, when people ask questions like this, they are mixing two very different things:

  • How we describe math to each other
  • How programming languages evaluate code

These are different and you not only have to understand both, but be able to translate between them.

In the code you posted, you have tried to attach a set of assumptions to a function definition. You cannot do this.

Do you want a function that returns a function? Do you want a function that takes a function like “g” as an argument?

You can try with

\[Phi][p_, t_] := 
  Subscript[\[Phi], 0][p] Exp[(-I*p^2*t)/(2 m*\[HBar])];
$Assumptions = m > 0 && \[HBar] > 0;

I want to set this function up so that mathematica can take mulitple derivatives of it with respect to p. This function happens to include an unknown function that is also dependent on p so I want to explicitly state this somehow so that mathematica understands that when i want to perform derivatives or any linear operations on it to treat this unknown function as a function of p.

You can take any symbolic derivative you want:

\[Phi][p_, t_] := 
  Subscript[\[Phi], 0][p] Exp[(-I*p^2*t)/(2 m*\[HBar])];
D[\[Phi][p, t], {p, 3}]
% // Simplify