# PDE- inhomogenous differentialequations

Currently I'm working on this problem:

$$\frac{\partial u(x,t)}{\partial t}- \frac{\partial ^2u(x,t)}{\partial ^2x}=f(x,t)$$

$$u(0,t)=u(\pi,t)=0$$

$$u(x,0)=g(x)$$

I realize that because of my boundary conditions the solutions should be on this form:

$$u(x,t)=\sum_{k=1}^{\infty}u_k(t)\sin(kx)$$

But then they say, for the function f and g I can put them like:

$$f(x,t) =\sum_{k=1}^{\infty}f_k(t)\sin(kx)$$ $$g(x) =\sum_{k=1}^{\infty}g_k \sin(kx)$$

I don't understand the last part, why can I put $g$ and $f$ like that? Thanks in advance!

• Sorry, fixed that – A.Maine Feb 15 '17 at 12:50
• If $u$ is given by the sum, then you can differentiate the sum according to your PDE. Then substitute these differentiated sums back into the PDE. This will give you the form of $f$. Then, looking at the $u$ sum, evaluating at $t = 0$ gives you the form of $g$. – Mattos Feb 15 '17 at 12:51
• I think I understand what you mean, the constant k^2 that I will get from the differentation, will that be a problem? – A.Maine Feb 15 '17 at 12:57
• No it won't, you'll just get that $f_{k}(t) = u_{k}'(t) - k^{2}$. Similarly, $g_{k} = u_{k}(0)$. – Mattos Feb 15 '17 at 13:15
• Note that any$^*$ function can be expanded in a Fourier sine series on $[0,\pi]$ - and that is all that's needed here. A function that depends on another variable like $t$ has such a series expansion for each value of $t$, thus the whole function can be written on that form with time-dependent coefficients. – Winther Feb 15 '17 at 13:31