So when you transform the second with a change of variables you get something like $$v_t=v_{xx} \\ v(0,t)=0 \\ v(\pi, t)=0 \\ v(x,0)=\int \int f(x) dx - Ax - B$$. Solving for this problem $v$ isn't too difficult, but when you transform back, by doing $$u(x,t) = v(x,t)-\int \int f(x) dx + Ax +...