~~I will update my answers as I finish working through them.~~ All of my answers are now uploaded.

(a) We consider the energy as given in the problem: \begin{equation}

E(t) = \int_{J} u^2(x,t)dx

\end{equation}

Now, take the time derivative to yield: \begin{equation}

\frac{\partial}{\partial t}E(t) = \int_{J} \frac{\partial}{\partial t}u^2(x,t)dx = \int_{J} 2uu_tdx \end{equation}

Replacing $u_t$ with $ku_{xx}$ as per the heat equation, we get: \begin{equation}

\int_J 2kuu_{xx}dx \end{equation}

Now, using integration by parts, we will get: \begin{equation}

2k\Big[uu_x|_{-\infty}^{\infty} - \int_{-\infty}^{\infty} u_x^2dx\Big] \end{equation}

Here I assume that the function is fast-decaying, so the first term goes to 0 *(professor, is this a valid assumption?)* This will leave me with just: \begin{equation}

-2k\int_{-\infty}^{\infty} u_x^2dx \label{eq:integral}\end{equation}

Now consider \ref{eq:integral}. Since the integrand is positive (since it is $u_x^2$) and k is positive (by the definition of the heat equation we assume this), then this equation is $\leq 0$.

If $u(x,t) = $ const., then the integrand will be zero (indeed, $\frac{d}{dx}C = 0$).

In all other cases, this is < 0. Therefore $E(t)$ does not increase; further, it decreases unless $u(x,t) = $ const.

(b) This part proceeds in the same way up to the integration by parts (except with J defined as the range from 0 to L rather than negative to positive infinity), so I will not type all of those steps again. Just recall that: \begin{equation}

\frac{\partial}{\partial t}E(t) = 2k\Big[uu_x|_0^L - \int_0^Lu_x^2dx\Big] \label{eq:newint} \end{equation}

We consider the cases of both Dirichlet and Neumann boundary conditions. First, let's think about Dirichlet. This condition says that: \begin{equation}

u|_{x=0} = u|_{x=L} = 0 \end{equation}

Therefore the first term in \ref{eq:newint} goes to zero by the Dirichlet boundary condition on $u$.

Now let's consider the Neumann boundary condition. It says that: \begin{equation}

u_x|_{x=0} = u_x|_{x=L} = 0. \end{equation}

Again, the first term in \ref{eq:newint} will go to zero, this time by the Neumann boundary condition on $u_x$.

In both cases, we see that the end result is: \begin{equation}

\frac{\partial}{\partial t}E(t) = -2k\int_0^Lu_x^2dx \end{equation}

We proceed as in part (a), showing that $E(t)$ decreases unless $U(x,t) = $ const because the integrand and the constant k are both positive.

(c) This problem is identical to (a) and (b) up to the integration by parts (where J is defined as the region from 0 to L, as in part (b)), so I won't type up the first few steps again. We arrive at: \begin{equation}

\frac{\partial}{\partial t}E(t) = 2k\Big[uu_x|_0^L - \int_0^Lu_x^2dx\Big]

\label{eq:c}

\end{equation}

This time, we have Robin boundary conditions. They are: \begin{equation}

\begin{cases}

u_x(0,t) - a_0u(0,t) = 0 \\

u_x(L,t) + a_Lu(L,t) = 0

\end{cases}

\end{equation}

The first boundary condition says that at $x=0$, $u=\frac{u_x}{a_0}$. The second says that at $x=L$, $u=\frac{u_x}{-a_L}$. So now let's consider the first term in the integral in \ref{eq:c}: \begin{equation}

uu_x|_0^L = u_x(L,t)\frac{u_x(L,t)}{-a_L} - u_x(0,t)\frac{u_x(0,t)}{a_0} = \frac{u_x^2}{-a_L} - \frac{u_x^2}{a_0} = -\Big(\frac{u_x^2(L,t)}{a_L} + \frac{u_x^2(0,t)}{a_0}\Big)

\end{equation}

So, now let's put this back into \ref{eq:c} to yield: \begin{equation}

\frac{\partial}{\partial t}E(t) = -2k\Big[\Big(\frac{u_x^2(L,t)}{a_L} + \frac{u_x^2(0,t)}{a_0}\Big) + \int_0^Lu_x^2dx\Big]

\end{equation}

Since all functions and the integrand are to the power of 2, they are all positive; all constants ($a_L$, $a_0$, and k) are also defined to be positive. This implies that overall, \begin{equation}

-2k\Big[\Big(\frac{u_x^2(L,t)}{a_L} + \frac{u_x^2(0,t)}{a_0}\Big) + \int_0^Lu_x^2dx\Big] \leq 0

\end{equation}

Therefore the energy is decreasing or zero, and in fact the endpoints contribute to this decrease. Note that in this case the Robin boundary condition prevents a constant solution from being possible, since for $C\neq0$: \begin{equation}

\frac{d}{dx}C -a_0C = 0 - a_0C = -a_0C\neq 0 \end{equation}

(And likewise for the other condition).

The only case where a constant solution is valid is the trivial solution $u(x,t) = 0$. In this case only will the equality to zero occur.

Therefore the endpoints contribute to the decrease of $E(t)$.