Boundary value problem $u_t-u_{xx}=\cosh(x), \ 0<x0.$ (PDE)

boundary value problempartial differential equations

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?

Best Answer

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. $$

Related Question