Boundary value problem $u_t-u_{xx}=\cosh(x), \ 00.$ (PDE) So I want to solve the problem:

\begin{align} u_t-u_{xx}&=\cosh(x), \quad 0<x<4, \quad
 t>0\\u(x,0)&=v(x),\\u(0,t)&=0,\\u(4,t)&=0. \end{align}

The inhomogeneous part is easy. Due to the $t$-inhomogeneity we want to find a function $f(x)$ such that it solves $-f''(x)=\cosh(x)$. Thus a solution is given by
$$f(x)=-\cosh(x)+ax+b.$$
The initial condition $u(0,t)=0\implies f(0)=0$ which gives $b=1$. The other initial condition $u(4,t)=0\implies f(4)=0$ gives $a=\frac{\cosh(4)-1}{4}.$ This means that
$$f(x)=-\cosh(x)+\frac{\cosh(4)-1}{4}x+1.$$
From here, this is what the prof says:

Now we need to solve the homogeneous part. Observe that we have to modify our initial condition, cause when we add  the  steady  state  solution,  if  we don’t modify the IC, then the steady state solution part will screw it up. So, we solve the problem:
\begin{align} u_t-u_{xx}&=0, \quad 0<x<4, \quad
 t>0\\u(x,0)&=v(x)-f(x),\\u(0,t)&=0,\\u(4,t)&=0. \end{align}
Our full solution will be equal to $u(x,t)+f(x).$

Question: I don't understand why we need to do this modification of the IC on this particular boundary value problem. Can someone shed some light on this?
 A: Update: Let $u(x,t)$ be the solution of
\begin{align} u_t-u_{xx}&=0, \quad 0<x<4, \quad
 t>0\\u(x,0)&=v(x)-f(x),\\u(0,t)&=0,\\u(4,t)&=0. \end{align}
First note that $f''(x)=-\cosh(x)$. Let $w(x,t)=u(x,t)+f(x)$. Then
$$ w_t-w_{xx}=u_t-u_xx-f''(x)=\cosh(x), \quad 0<x<4, t>0 $$
and 
$$ w(x,0)=u(x,0)+f(x)=v(x), w(0,t)=u(0,t)+f(0)=0,  w(4,t)=u(4,t)+f(4)=0. $$
Namely, $w(x,t)$ is the full solution of the original equation.
Note that $\{\sin(\frac{n\pi x}{4})\}$ is dense in $L=\{u\in L^2([0,4]): u(0)=u(4)=0\}$. Let the solution have the form
$$ u(x,t)=\sum_{n=1}^\infty a_n(t)\sin(\frac{n\pi x}{4}). $$
Then setting $u_t-u_{xx}=0$ gives
$$ \sum_{n=1}^\infty \bigg[a_n'(t)+\frac{n^2\pi^2}{16}a_n(t)\bigg]\sin(\frac{n\pi x}{4}) =0 $$
and hence
$$ a_n'(t)+\frac{n^2\pi^2}{16}a_n(t)=0, n=1,2,\cdots. \tag{1}$$
(1) has the general solution
$$ a_n(t)=C_ne^{-\frac{n^2\pi^2}{16}t}.$$
So
$$ u(x,t)=\sum_{n=1}^\infty C_ne^{-\frac{n^2\pi^2}{16}t}\sin(\frac{n\pi x}{4}). $$
But $u(x,0)=v(x)-f(x)$ gives
$$ \sum_{n=1}^\infty C_n\sin(\frac{n\pi x}{4})=v(x)-f(x). $$
Using
$$ \frac1{\sqrt{2}}\int_0^4\sin(\frac{m\pi x}{4})\sin(\frac{n\pi x}{4})dx=\delta_{mn} $$
one has
$$ C_n=\sqrt2\int_0^4(v(x)-f(x))\sin(\frac{n\pi x}{4})dx. $$
A: The given solution was confusing since they used the same symbol for the actual solution and the homogeneous solution. So let's write
$$ u(x,t) = f(x) + \bar u(x,t) $$
where $f(x)$ is the function you just found, and $\bar u$ is the "remainder". Plug this form into the PDE to get
$$ u_t - u_{xx} = \bar u_t - \bar u_{xx} - f''(x) = \cosh(x) $$
But we already have $-f''(x) = \cosh x$, therefore it remains the $\bar u$ must be homogeneous
$$ \bar u_t - \bar u_{xx} = 0 $$
Finding the initial condition works the same way
$$ u(x,0) = f(x) + \bar u(x,0) = v(x) \implies \bar u(x,0) = v(x) - f(x) $$
And we have a new BVP in $\bar u$
\begin{cases}
\bar u_t - \bar u_{xx} = 0 \\
\bar u(x,0) = v(x) - f(x) \\
\bar u(0,t) = \bar u(4,t) = 0
\end{cases}
Is this clear?
