Solve by separation of variables $$\frac{\partial u}{\partial t}=k\frac{\partial^2 u}{\partial x^2}$$ given intitial conditions:
$$\frac{\partial u}{\partial x}=0 \text{ at } x=a \text{ and } x=-a, \forall t\geq 0;$$ $$u \text{ is bounded for }-a\leq x\leq a\text{ as }t\rightarrow\infty;$$ $$u=|x|\text{ for }-a\leq x\leq a\text{ at }t=0.$$
So I've been stuck on this problem for a few days now. I've tried a bunch of different things but I'm unsure of how to properly approach the problem. I have the answer, but it's unclear on how to get there. I originally thought that I could start with the general solution of the heat equation which is already known. $$u(x,t)=X(x)T(t)=(A\cos{wx}+B\sin{wx})Ce^{-w^2kt}$$ I started to play with initial conditions using this solution and ultimately I got with $B^*=BC, A^*=AC$ that $B^*=A^*\tan{wa}$ which lead to a weird $u$ that was defined on an interval using the boundary conditions. I couldn't gather much information.
After reviewing notes and the text, "Geoff Stephenson - PDE's for Scientists & Engineers, Ch. 4.3". I thought it would be wise to assume a solution of the form $u(x,t)=v(x)+w(x,t)$ where $\frac{\partial^2 v}{\partial x^2}=0$ and $w(x,t)=X(x)T(t)$. Using boundary conditions, this lead me to $$u(x,0)=|x|\implies |x|=v(x)+w(x,0)\implies v(x)=|x|-w(x,0)$$ From this can I then say $u(x,t)=|x|-w(x,0)+w(x,t)$?
I can't figure this stuff out for the life of me.
The basic separated solutions $u(x,t)=X(x)\,T(t)$ that satisfy the given boundary conditions $u_x(\pm a,t)=0$ (or $X'(\pm a)=0$, in other words) are $$ u(x,t) = 1 $$ and $$ u(x,t) = \sin(\omega x) \, e^{-k \omega^2 x} ,\quad\text{where}\quad \omega a \in \left\{ \frac{\pi}{2}, \frac{3\pi}{2}, \frac{5\pi}{2}, \ldots \right\} , $$ and $$ u(x,t) = \cos(\omega x) \, e^{-k \omega^2 x} ,\quad\text{where}\quad \omega a \in \bigl\{ \pi, 2\pi, 3\pi, \ldots \bigr\} , $$ and what you have to do is to find a linear combination of all these (i.e., a Fourier-type series) which satisfies the initial condition $u(x,0)=|x|$ for $|x|\le a$. Since $|x|$ is an even function, there will be no sine terms, so you'll get a solution of the form $$ u(x,t) = C + \sum_{n=1}^{\infty} A_n \cos\left(\frac{n \pi x}{a}\right) \, e^{-k (n^2 \pi^2 /a^2) \, t} $$ where the coefficients $C$ and $A_n$ ($n=1,2,3,\ldots$) are such that $$ |x| = C + \sum_{n=1}^{\infty} A_n \cos\left(\frac{n \pi x}{a}\right) ,\quad |x|\le a. $$ Can you take it from there?