Find the General solution $u(t,x)$ to the partial differential equation $u_x+tu=0$. Find the General solution $u(t,x)$ to the partial differential equation $u_x+tu=0$.
Here is what I've tried.  I feel like this should be easy, but I'm not catching on to something here.
$$u_x+tu=0\implies -u_x=tu$$
Ansatz...$u=\frac{1}{t}e^{-xt}$ and $u_x=-e^{-xt}$
Thus: $\int_{0}^x -e^{-st}ds=\int_{0}^x\frac{1}{t}e^{-st}ds$
$\implies te^{-xt}-(-1)=\frac{1}{t^2}e^{-xt}-\frac{1}{t^2}$
Solving for $\frac{1}{t}e^{-xt}$
$\implies u(t,x)=\frac{1}{t}e^{-xt}=t^2e^{-xt}+t+\frac{1}{t}$
As I type all of this it occurs to me that my ansatz worked without all the other work.  (that appears to not work.)
Is it ok to just stick with the ansatz and say $u(t,x)=\frac{1}{t}e^{-xt}=f(t)e^{-xt}$?
Please help me understand where my thinking goes astray.
Any Guidance would be greatly apppreciated.

$$\frac{du}{dx}+tu=0$$
$$\frac{du}{u}=-t\:dx$$
Since $t$ is supposed to be not function of $x$ one can integrate wrt $x$.
$$\ln|u|=-t\:x+f(t)\quad \text{because}\quad \frac{df(t)}{dx}=0$$
$f$ is any function.
$$u=e^{-t\:x+f(t)}$$
Let $\quad e^{f(t)}=F(t)\quad ;\quad F$ is any function.
$$u(x,t)=F(t)e^{-t\:x}$$
