Solving the partial differential equation using the method of characteristic to find the general solution The question is solve the following partial differential equation using the method of characteristic 
$\frac{\partial{u}}{\partial{x}}-\frac{\partial{u}}{\partial{t}}=2t$, with the  condition $u=u(x,t)$ subject to $u(x,2x+1)=e^{x}$. 
My attempt: 
I first calclated that $t=c-x$ where $c$ is a constant, then i rearranged to find that $c=t+x$ then let $\zeta=x$ and $\eta=t+x$, then calculated that $\frac{\partial{u}}{\partial{x}}=\frac{\partial{u}}{\partial{\zeta}}+\frac{\partial{u}}{\partial{\eta}}$ and that $\frac{\partial{u}}{\partial{t}}=\frac{\partial{u}}{\partial{\eta}}$, i then proceeded to substitute these into the pde to get that $\frac{\partial{u}}{\partial{\zeta}}=2t$, and then wrote that $\frac{\partial{u}}{\partial{\zeta}}=2(\eta+\zeta)$ since $t=\eta+\zeta$ i then intergrated to get that $u=2\eta\zeta+\zeta^{2}+f(\eta)$ which implies that  $ u=2(t+x)(x)+x^{2}+k(t+x)$
Now the boundary condition given was that $u(x,2x+1)=e^{x}$ so $e^{x}=2((2x+1)+x)x+x^{2}+k(3x+1)=7x^{2}+2x+k(3x+1)$ then I let $z=3x+1$ and then tried to rearrange for $k(z)$ but i dont think this is correct, could someone please help me with this last bit? Thank you for taking the time to read through the post.
 A: Using the method of characteristic, we see that
\begin{align}
\frac{d}{dt} u(t, x(t)) = \frac{\partial u}{\partial t}+\frac{\partial u}{\partial x}\frac{d x}{d t} = \frac{\partial u}{\partial t}-\frac{\partial u}{\partial x} = -2t
\end{align}
where $dx/dt = -1$. Hence we have the ode problem
\begin{align}
\frac{dx}{dt} = -1, \ \ \ x(2x_0+1) = x_0.
\end{align}
Solving the ode gives us
\begin{align}
x(t) = -t+C \ \ \implies&\  \ \ x(2 x_0+1) = -(2x_0+1) +C = x_0\\
 \ \ \implies&\ \  \ C= 3x_0+1 \\
\implies &\ x(t) = -t+(3x_0+1).
\end{align}
Now, we see that
\begin{align}
u(t, x(t)) = -t^2+D  \ \ \implies \ \ u(t, -t+3x_0+1) = -t^2+D.
\end{align}
Set $t= 2x_0+1$ and use the hypothesis, we get that
\begin{align}
u(2x_0+1, x_0) = - (2x_0+1)^2+D =  e^{x_0} \ \ \implies \ \ \ D = e^{x_0} + (2x_0+1)^2.
\end{align}
Finally, since 
\begin{align}
x_0 = \frac{x+t-1}{3}
\end{align}
then we have that
\begin{align}
u(t, x) = - t^2 + \exp\left( \frac{x+t-1}{3}\right)+ \left( \frac{2x+2t+1}{3}\right)^2.
\end{align}
A: $$\frac{\partial{u}}{\partial{x}}-\frac{\partial{u}}{\partial{t}}=2t$$
System of characteristic differential equations : $\quad \frac{dx}{1}=\frac{dt}{-1}=\frac{du}{2t}$
First family of characteristic curves from $\quad\frac{dx}{1}=\frac{dt}{-1}\quad\to\quad x+t=c_1$ 
Second family of characteristic curves from $\quad\frac{dt}{-1}=\frac{du}{2t} \quad\to\quad u+t^2=c_2$
General solution of the PDE : $\quad u+t^2=F(x+t)$
$F(X)$ is any differentiable function, where $X=x+t$.
$$u(x,t)=-t^2+F(x+t)$$
Condition : 
$u\left(x,t=(2x+1)\right)=e^{x}= -(2x+1)^2+F\left(x+(2x+1)\right)$
$e^{x}= -(2x+1)^2+F(X)$ with $X=3x+1 \quad\to\quad x=\frac{X-1}{3}$
$e^{\frac{X-1}{3}}= -\left(2\frac{X-1}{3}+1\right)^2+F(X) \quad\to\quad F(X)=e^{\frac{X-1}{3}}+\left(\frac{2X+1}{3}\right)^2$
So, the function $F$ is determined. Putting it into the general solution with $X=x+t$ leads to the particular solution fitting the specified condition : $u(x,t)=-t^2+e^{\frac{(x+t)-1}{3}}+\left(\frac{2(x+t)+1}{3}\right)^2$
$$u(x,t)=-t^2+e^{\frac{x+t-1}{3}}+\left(\frac{2x+2t+1}{3}\right)^2$$
