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.

Here is my attempt at a solution.  I think I need clearer explanation for the part in bold.
$u_x+tu=0\implies u_x=tu$
Since the derivative contains the function assume exponential.
$u=e^{-xt}$; $\frac{\partial u}{\partial x}=-te^{-xt}$
Thus $u(t,x)=e^{-xt}$
since $t$ is treated as a constant with regard to the differentiation, then any function of $t$ essentially acts as a constant thus...
$u(t,x)=f(t)e^{-xt}$
