Consider the heat equation
$$u\_t = u\_{xx}$$
for $t \ge 0$, $0 \le x \le L$, given boundary conditions 
$$u(0,t) = u(L,t) = f(t)$$ 
and an initial condition 
$$u(x,0) = g(x)$$ 
for some continuous functions $g(x)$ on $[0,T]$ and $f(t)$ on $[0,\infty)$.


Is there an explicit solution for $u$? In particular, I was wondering if $u$ can be expressed in terms of some integral involving $g$ and $f$.



One dimensional heat equation with boundary conditions
Imposing some conditions on $f$ and $g$ the solution can be represented via Green's function G:
$$
u(x,t)=\int\_0^L G(x,y,t)g(y)\,dy+\int\_0^t\partial\_y G(x,0,t-\tau)f(\tau)\,d\tau-
$$
$$
\int\_0^t\partial\_y G(x,L,t-\tau)f(\tau)\,d\tau.
$$
Green's function for the first BVP on a segment can be written out explicitly as series, see ch. 3, $\S7$ in A. Friedman, *Partial differential equations of parabolic type.* 


