I'm interested in showing that the choice of the expression for moment generating functions $M_X(t)=E(e^{tx})$ for probability distributions is entirely fixed, in that there is no other general function which can give the desired results. This is purely a conjecture that I have, so if in fact this is false please let me know why, and if there is another similar result which constrains the choice of the function. Of course, by the name, the desired result is that $E(X^n)=M_X^{(n)}(a)$ for any $n^{th}$ moment and some $a$, i.e. $M_X$ generates all the moments. By the standard definition $a=0$ to satisfy the exponential choice, but I suppose this isn't entirely necessary in the general case, correct? Nonetheless I'll just use $a=0$ below (I'm guessing this choice is completely arbitrary and that if we change $a$ then there are other possibilities?).
If we let $M_X(t)$ instead be an arbitrary function $f(x,t)$, then by differentiating under the integral sign we have
$$ M_X^{(n)}(t)=\int_{-\infty}^\infty \left(\frac{\partial^n}{\partial t^n}f(x,t)\right)f_X(x)dx $$
I suppose that in general what we want is for $\partial_n f(x,t)=x^ng(x,t)$ for some $g(x,t)$ where $g(x,0)=1$ so indeed
$$M_X^{(n)}(0)=\int_{-\infty}^\infty x^ng(x,0)f_X(x)dx=\int_{-\infty}^\infty x^nf_X(x)dx=E(X^n)$$
If in particular we want $g=f$ (as is the case in the standard definition of $M_X$), then we are solving $\partial_nf(x,t)=x^nf(x,t)$ with $f(x,0)=0$. I put this (excluding the boundary condition) in wolfram alpha for a couple values of $n$ and looks like each general solution contains $e^{tx}$ as a particular solution (for $n=1$ this is the general solution, higher $n$ have other other particular solutions but they are all different). This is the reason I conjecture that the exponential is the only possible function, but I am unsure how to prove that $e^tx$ is the only particular solution for any $n$ in this PDE.
Of course showing this only proves the case when we choose $f=g$, but I am unsure whether we can generalize to any choice of $g$ (or any choice of $a$ as mentioned above). Any insights on how much we can say about the constraint of choosing the function for defining $M_X$ and how much we can generalize the constraint is appreciated.
Note: I'm putting this here instead of the stats stackexchange since ultimately the question is one of DEs.