solve this linear partial differential equation So I have this PDE:
$u_t + t u_x + u = 0.$ The initial condition is 
$$
u(0,x) = \left\{ \begin{array}{rl}
 1-x &\mbox{ if $0\leq x\leq 1$} \\
  0 &\mbox{ x > 1}
       \end{array} \right.
$$
The boundary condition is
$$
u(t,x) = \left\{ \begin{array}{rl}
 1-t &\mbox{ if $0\leq t \leq 1$} \\
  0 &\mbox{ t > 1}
       \end{array} \right.
$$
Here's what I have:
Solving for characteristics
$$
\begin{align}
\frac{dt}{1} &= \frac{dx}{t} = \frac{du}{u}\\ \textrm{gives}\\ \frac{dt}{1} &= \frac{dx}{t} and \frac{dt}{1} = \frac{du}{u}
\end{align}
$$
Solving these two ODE's gives:
$$
x = t^2/2 + c_1 \textrm{ and } |u| = c_2 e^t
$$
Was that the right step? I'm not sure what to do next.
 A: It seems that this is a linear PDE. So, using the method of characteristics we take:
$\dfrac{dt}{1}=\dfrac{dx}{t}\implies t dt = dx\implies  \dfrac{t^2}2=x+c_1\implies \boxed{c_1=\dfrac{t^2}2-x}$.
$\bullet$ We consider the following transform:
$\begin{array}{l}
\xi=\xi(x,t)=-x+\dfrac{t^2}2\\
\eta=\eta(x,t)=t
\end{array}$
We need to check the Jacobian determinant of the previous transform:
$J(\xi,\eta)=\begin{vmatrix} \dfrac{\partial \xi}{\partial x} & \dfrac{\partial \xi}{\partial t} \\ \dfrac{\partial \eta}{\partial x} & \dfrac{\partial \eta}{\partial t}\end{vmatrix}=\begin{vmatrix} -1 & t \\ 0 &1 \end{vmatrix}=-1\neq 0$.
Then we have (application of chain rule):
$\begin{array}{l}
u_x=\xi_x\cdot \bar u_\xi+\eta_x \cdot \bar u_\eta=-\bar u_\xi\\
u_t=\xi_t\cdot \bar u_\xi+\eta_t\cdot \bar u_\eta=t\cdot \bar u_\xi+\bar u_\eta
\end{array}$
We plug $u_x,u_t$ into the initial PDE  and we take:
\begin{align}
&t \cdot \bar u_\xi +\bar u_\eta +t\cdot(-\bar u_\xi)+\bar u=0\\
&\bar u_\eta=-\bar u\\
&\bar u(\xi,\eta)=f(\xi)\cdot e^{-\eta}, 
\end{align}
hence:
\begin{align}
\boxed{\bar u(\xi,\eta)=u(x,t)=f\Big(-x+\dfrac{t^2}2\Big)\cdot e^{-t}}
\end{align}
The last step is to define the function f. We do so, using the boundary and the initial conditions.
A: The solution for your PDE without the application of the initial and the boundary conditions is
$$u \left( x,t \right) =F \left( -2\,x+{t}^{2} \right) {{\rm e}^{-t}}+{
\it C}\,{{\rm e}^{-t}}
$$
where $F$ is an arbitrary function and $C$ is a constant. 
