I'm trying to find the solution to(I don't need to find the coefficient):
$v_t = kv_{x x} , 0 < x < l, 0 < t < ∞$
$v(0, t) = 0$
$v_x(l, t) = 0$
$v(x, 0) = −U$
Where U is a constant
This the answer that I get:
$$v(x, t) = \sum_{n=0}^{\infty}A_n e^{-(\frac{n\pi}{l})^2kt} sin(\frac{nπx}{l})$$ which comes directly from separating the variables of $v(x,t)$ But the correct answer is this:
$$v(x, t) = \sum_{n=0}^{\infty}A_n e^{-(\frac{(n+1/2)\pi}{l})^2kt} sin(\frac{(n + 1/2)πx}{l})$$
why do I have to add the $\frac{1}{2}$ to $n$?
Your solution doesn't satisfy the second boundary condition. Your solution satisfies the boundary conditions $$v(0,t) = 0 \,\,\,\,\, \text{ and } \,\,\,\,\, v(l,t) = 0, $$ whereas you need it to satisfy $$v(0,t) = 0 \,\,\,\,\, \text{ and } \,\,\,\,\, \frac{dv}{dx}(l,t) = 0.$$ Adding the $1/2$ accomplishes that.