Hi I am looking for the general solution of the following problem:
$$ \frac{\partial u}{\partial t} = \frac{\partial^2 u}{\partial x^2}$$ Initial condition: $u(x,0) = -x $ and $u(0,t) = 0 $ and $u(1,t) = 0 $
I tried to separate the function $u$ like this $u(x,t) = f(x)g(t)$ to find a basis of solutions.
$$ \frac{g'}{g}(t) = \frac{f''}{f}(x)$$
gives me that both ratio are equal to the same constant $\kappa$ for all $x$ and $t$. $\kappa = -\lambda^2 <0$ otherwise the solution explodes or is 0.
$g(t)=ae^{-\kappa^2 t}$ and $f(x)=be^{\kappa x } + ce^{-x\kappa }$
$u(x,t)=ae^{-\kappa^2 t}(be^{\kappa x} + ce^{-\kappa x})$
$u(0,t) = 0 $ gives $b = -c$
From that I can not find any solution but the null function.
Could you help me find the general solution? Thank you
Note that:
This problem is obtained from that one: $$ \frac{\partial v}{\partial t} = \frac{\partial^2 v}{\partial x^2}$$ Initial condition: $v(x,0) = 0 $ and $v(0,t) = 0 $ and $v(1,t) = 1 $
where I substracted the stationnary solution $u = v - v_{\infty}$ with $v_{\infty}(x)=x$
Your solution is not right. If
$$ \frac{g'}{g} = \frac{f''}{f} = -\kappa^2 $$
Then, equivalently
\begin{align} g'(t) &= -\kappa^2 g(t) \\ f''(x) &= -\kappa^2f(x) \end{align}
The solution is
\begin{align} g(t) &= ae^{-\kappa^2t} \\ f(x) &= b\sin(\kappa x) + c\cos(\kappa x) \end{align}
and
$$ u(x,t) = e^{-\kappa^2t}\big(B\sin(\kappa x) + C\cos(\kappa x) \big) $$
where I've combined the constants: $B = ab$, $C = ac$
The boundary condition $u(0,t) = 0$ gives $C = 0$
$$ u(x,t) = Be^{-\kappa^2t}\sin(\kappa t) $$
The boudnary condition $u(1,t) = 0$ gives
$$ \sin(\kappa) = 0 \implies \kappa = n\pi $$
where $n$ is an integer.
Since every value of $n$ will satisfy the equation, we can use the law of superposition to write the full solution in series form
$$ u(x,t) = \sum_{n=1}^\infty B_n e^{-n^2\pi^2t}\sin(n\pi x) $$
The last step is to apply the initial condition and find the corresponding Fourier series. Can you take it from here?