I was wondering, given classical mathematical physics problem (such as heat equation or wave equation) in which there are solutions written in the form of a Fourier series. To solve these problems, I usually try to separate the variables, then derive etc. I mean, I basically suppose that the solution is regular enough to let me do such things. Then when I have finished and found the solution as Fourier series, how can I conclude that the operations done to find that are justified?
For instance, let's take $ \partial_t ^2 u- \partial_x ^2 u=0$ , a wave equation. Separating variables and summing I find $u(t,x)= \sum_{k=1}^{\infty} (a_k \cos(kt)+b_k \sin(kt)) \sin(kx)$. This is the general form, although with some conditions (for instance initial condition or border condition) it usually is simplified. If I were to prove that this solution is continuous, differentiable and basically has all the properties that I supposed it had , I would require some sort of regularity in the border/initial conditions.
I wonder: is there some way to generalise this or every problem is on its own? I mean, it kinda bothers me to do things like "yeah, let's suppose I can do this and then let's prove I could", but maybe it really is how these problem are solved.
The problem you are solving also includes endpoint conditions $u(t,0)=u(t,\pi)=0$. And $u(0,x)=f(x),u_t(0,x)=g(x)$ must be known. Then you have uniqueness. If there were two such solutions, $u,v$, then $w=u-v$ would satisfy $$ w_{tt}=w_{xx},\;\; w(0,x)=0,\;\; w_t(0,x)=0. $$ There are tricks you can use to show that $w$ must be $0$, which then proves that $u=v$. The more significant issue is knowing that functions can be expanded in trigonometric series, and then showing that the resulting series has enough regularity to apply the chosen uniqueness trick. But, once this is done, you have a solution, and you know that solution is unique among those with sufficient regularity.