This is the theorem 7.5.8 in Durrett book.
If $u(t,x)$ is the polynomial in $x$ and $t$ with $$ \frac{\partial u}{\partial t}+\frac{1}{2}\frac{\partial^2 u}{\partial x^2}=0 $$ Then $u(t,B_t)$ is a martingale.
Proof: Let $p_t = (2\pi)^{-1/2} t^{-1/2}\exp(-(y-x)^2/2t)$ and $p_t$ satisfies the heat equation: $$ \frac{\partial p_t}{\partial t}+\frac{1}{2}\frac{\partial^2 p_t}{\partial y^2}=0 $$ Then the book proved that $E_x(t,B_t)$ is a constant by showing that $\frac{\partial}{\partial t}E_x(t,B_t)=0$. \begin{eqnarray*} \frac{\partial}{\partial t}E_x(t,B_t)&=& \int \frac{\partial}{\partial t} (p_t(x,y) u(t,y)) dy\\ &=& \int \frac{1}{2} \frac{\partial^2p_t}{\partial y^2}u(t,y)+p_t(x,y)\frac{\partial u(t,y)}{\partial t}\\ &=&0~(Integrating ~by~parts~twice) \end{eqnarray*}.
I have two questions from this proof.
i) What is the purpose to prove $E_x(t,B_t)$ is a constant?
ii) Why the boundary terms are zero while integrating by parts in the last step?
Can anyone please clarify these two points?
Durrett's book is good but full of typos and half proofs. That's why he's already at the fifth edition.
https://services.math.duke.edu/~rtd/PTE/PTE5_011119.pdf
If you look there (p. 377), it seems that the proof was completed since your copy was printed, answering both your questions.