Multiply $(40)$ by $u_t$ and integrate: $$\int_{\mathbb{R}^N}u_t(u_t)_t-\int_{\mathbb{R}^N}u_t\Delta u_t=\int_{\mathbb{R}^N}f_tu_t.\tag{1}$$
Use integration by parts in $(1)$ combined with $(u_t^2)_t/2=u_t(u_t)_t$ to conclude that $$\frac{1}{2}\int_{\mathbb{R}^N} (u_t^2)_t+\int_{\mathbb{R}^N} |Du_t|^2=\int_{\mathbb{R}^N} f_tu_t. \tag{2}$$
Now integrate $(2)$ from $0$ to $T$ to get
\begin{eqnarray}
\int_0^T\int_{\mathbb{R}^N} |Du_t|^2 &=& \int_0^T\int_{\mathbb{R}^N}f_tu_t+\frac{1}{2}\left(\int_{\mathbb{R}^N}u_t^2(\cdot, 0)-\int_{\mathbb{R}^N}u_t^2(\cdot,T)\right) \nonumber \\
&=& \int_0^T\int_{\mathbb{R}^N}f_tu_t+\frac{1}{2}\left(\int_{\mathbb{R}^N}(f(\cdot, 0)+\Delta g)^2-\int_{\mathbb{R}^N}u_t^2(\cdot,T)\right). \tag{3}\end{eqnarray}
From $(3)$ $$\sup_{s\in[0,T]}\int_{\mathbb{R}^N}|u_t(\cdot,s)|^2+\int_0^T\int_{\mathbb{R}^N} |Du_t|^2=\sup_{s\in[0,T]}\int_{\mathbb{R}^N}|u_t(\cdot,s)|^2+\int_0^T\int_{\mathbb{R}^N}f_tu_t+\frac{1}{2}\left(\int_{\mathbb{R}^N}(f(\cdot, 0)+\Delta g)^2-\int_{\mathbb{R}^N}u_t^2(\cdot,T)\right).\tag{T}$$
From here you can proceed as follows. We combine $(2)$ with inequality $2ab\le a^2+b^2$ to obtain $$\int_{\mathbb{R}^N} (u_t^2)_t\le \int_{\mathbb{R}^N}(f_t^2+u_t^2). \tag{4}$$
Let $$\eta(s)=\int_{\mathbb{R}^N} u_t^2(x,s)dx,\ \ \phi(s)=\int_{\mathbb{R}^N}f_t^2(x,s),\ s\in [0,T],$$
and note that from $(4)$ $$\eta'(s)\le \eta(s)+\phi(s).$$
Now apply Gronwall inequality and use $(T)$ to conclude.
We have the pde
$$
u_t+x^2u_x+2xu=0\\
u(x,0)=1
$$
which we examine along a characteristic curve $(t,x(t))$ which we require to satisfy the convenient conditions
$$
x'(t)=x^2\\
\frac{d}{dt}u(t,x(t))=u_t+x'(t)u_x=-2x(t)u(t,x(t))
$$
So let's solve the odes. First we find
$$
x(t)=\frac{1}{\frac{1}{x_0}-t}
$$
then
$$
u'(t,x(t))=-2x(t)u(t)=\frac{2}{t-\frac{1}{x_0}}u(t)\\
\implies u(t)=A(t-1/x_0)^2
$$
Now we impose that $u(0)=1$ to find $A=x_0^2$, yielding
$$
u(t,x(t))=x_0^2(t-1/x_0)^2
$$
at which point we need to solve for $x_0$, which after all was just a dummy initial condition. We want our solution to be valid for any initial condition $x_0$. So we solve for $x_0$ in terms of $x$ to find
$$
x_0=\frac{tx+1}{x}
$$
which then yields the solution
$$
u(t,x)=\frac{x^2}{(tx+1)^2}\frac{1}{x^2}=\frac{1}{(tx+1)^2}
$$
edit: How $x'(t)=x^2$ is solved. Separate variables to find
$$
\frac{dx}{x^2}=\mathrm dt\implies -\frac{1}{x}=t+c
$$
for some $c$ which we will solve for in terms of initial condition $x(0)=x_0$, plug in $t=0$ and find
$$
-\frac{1}{x_0}=c
$$
yielding
$$
-\frac{1}{x}=t-\frac{1}{x_0}\implies x=\frac{1}{\frac{1}{x_0}-t}
$$
as we found before.
edit 2 explicitly solving other ode:
$$
\frac{du}{u}=2(t-1/x_0)^{-1}\stackrel{\text{integrate both sides}}{\implies} \ln|u|=2\ln(t-1/x_0)+C=\ln(t-1/x_0)^2+C\\
\stackrel{\text{exponentiate both sides}}{\implies}u(x,t)=A(t-1/x_0)^2
$$
Best Answer
$$u_t+cu_x=g(t,x)$$ Charpit-Lagrange system of characteristic ODEs : $$\frac{dt}{1}=\frac{dx}{c}=\frac{du}{g(t,x)}$$ First characteristic equation from $\frac{dt}{1}=\frac{dx}{c}$: $$x-ct=C_1$$ Second characteristic equation from $\frac{dt}{1}=\frac{du}{g(t,x)}=\frac{du}{g(t,(C_1+ct))}$
$$u=\int g(t,(C_1+ct))dt+\text{constant}$$ $$u=\int_0^t g(s,(C_1+cs))ds+C_2$$
The general solution of the PDE on the form of implicit equation $C_2=F(C_1)$ leads to : $$\boxed{u(t,x)=\int_0^t g(s,(x-ct+cs))ds+F(x-ct)}$$ $F$ is an arbitrary function to be determined according to the condition $u(T,x)=h(x)$ : $$h(x)=\int_0^T g(s,(x-cT+cs))ds+F(x-cT)$$ Change of variable : $\quad X=x-cT\quad\implies\quad x=X+cT$ $$h(X+cT)=\int_0^T g(s,(X+cs))ds+F(X)$$ $$F(X)=h(X+cT)-\int_0^T g(s,(X+cs))ds$$ Now the function $F(X)$ is known.
We put it into the above general solution where $X=x-ct$ thus $F(x-ct)=h(x-ct+cT)-\int_0^T g(s,(x-ct+cs))ds$ :
$u(t,x)=\int_0^t g(s,(x-ct+cs))ds+h(x-ct+cT)-\int_0^T g(s,(x-ct+cs))ds$
$$\boxed{u(t,x)=h(x-ct+cT)-\int_t^T g(s,(x-ct+cs))ds}$$
Of course it was possible to get the result without solving the whole from the begining to the end. One could use the known solution in the case of given initial condition and directly transforming it to the case of given final condition.