Show that solution of partial differential equation has constant/nonconstant integral depending on initial conditions.

Suppose, that $u(t,x)$ is a solution to the following partial differential equation problem: $$\left\{ \begin{array}{ll} u_t = D u_{xx} - Vu_{x},&\text{where }t>0,\; x\in[0,\pi],\\ u_x(t,0) = u_x(t,\pi)= 0, & \text{for }t>0,\\ u(0,x) = u_0(x),& x \in [0,\pi].\end{array} \right.$$ Prove, that $\int_{0}^{\pi} u(t,x) dx$ is constant if $u_0 (x) = \sin (x)$ and it is not, when $u_0 (x) = \cos(x)$. I'm quite terrible at anything else than topology and measure theory, so I humbly ask for help. Thank you in advance.

EDIT: I forgot one thing, I'm terribly sorry. I forgot to mention, that $V,D$ are positive constants. But since question has been already answered, I put it here just for the information.

• An interesting fact is, that $u_0(x)=sin(x)$ contradicts with the initial conditions $u_x(t,0)=u_x(t,\pi)=0$, since $u_x(0,0)$ equals the derivative of sine in point $x=0$, which happens to be equal $1\neq 0$. If someone could at least tell me, if the solution to this problem with such initial conditions can be found, I'd be grateful. – I_Really_Want_To_Heal_Myself Dec 6 '16 at 22:49
• I am not sure to which extent it might help in getting answer, but probably adding some context might be a good thing. (For example, where does the problem come from? Is it from some textbook?) – Martin Sleziak Dec 21 '16 at 17:57
• I'd add some context if I had. In fact lack of any "phisical" interpretation makes this question even harder to answer. It's from my professor's script, which is unfortunately only in Polish and is not finished so far. Actually - I managed to solve it, and you have provided almost complete solution, I'll edit it in a few minutes. – I_Really_Want_To_Heal_Myself Dec 22 '16 at 17:40
• BTW posting answers to your own question is encouraged (see for example this meta post and other related discussions.) Which means that after you solved problem, it would have been perfectly find to post your solution as an answer. – Martin Sleziak Dec 23 '16 at 9:38

Let us denote $f(t)=\int_0^\pi u_t(t,x) \dd x$. We would like to know whether $f'(t)=0$.
Is something given in the problem about $u_\pi(x)=u(\pi,x)$?
• It is not given in the problem, but to show, that this function of variable $t$ is not constant, we just need to show, that it has non-zero derivative in at least one point. If we consider the origin, i..e. point $(0,0)$, we have that this derivative equals $-V\cdot(u(0,\pi)-u(0,0)) = -V\cdot(\cos(\pi)-\cos(0)) = 2V>0$. – I_Really_Want_To_Heal_Myself Dec 22 '16 at 17:52
• Thanks for edits and corrections. I understand that this would work if we want to show the function $f(t)$ is not constant. But the above is still enough to show $f(t)$ is constant if we are only given $u_0(x)$. – Martin Sleziak Dec 23 '16 at 9:41