# wave equation and superposition

If I have this equation:

$$\frac{\partial^2u}{\partial x^2}=\frac{\partial^2u}{\partial t^2}$$

And this general solution:

$$u(x,t)=\sum^\infty_{n=-\infty}\cos k_nx(C_n\cos k_nt+D_n\sin k_nt)$$

Would it then be wrong to write the above solution with only positive values of $n$? In my text book they often write the result from a superposition with only positive values of $n$, becasue the negative values of n already are included in the terms obtained for positive values of $n$.

The boundary condition:

$\frac{\partial u(x,t)}{\partial x}|_{x=0} = \frac{\partial u(x,t)}{\partial x}|_{x=L} = 0$

To get from $$\frac{\partial^2u}{\partial x^2}=\frac{\partial^2u}{\partial t^2}$$ to the solution I have used separation of variables and superposition.

Where I found:

U(x,t) = X(x)T(t)

And

$X^{''}(x) = -k^{2}X(x)$

$T^{''}(t) = -k^{2}T(t)$

Which gives me:

$X(x) = Acos(kx) + Bsin(kx)$

$T(t) = Ccos(kt) + Dsin(kt)$

Using the boundary condition I get: B = 0 and $k = k_{n} = \dfrac{n\pi}{L}$

Then I use superposition to get the solution:

$$u(x,t)=\sum^\infty_{n=-\infty}\cos k_nx(C_n\cos k_nt+D_n\sin k_nt)$$

-
This is not the general solution of the equation. It only generates even functions of $x$ (at fixed $t$), whereas the solution can be an arbitrary (twice differentiable) function of $x$ (at fixed $t$). –  joriki Apr 4 '11 at 12:47
Please enter your equations here so people don't have to click through. You can include $\LaTeX$ between dollar signs. –  Ross Millikan Apr 4 '11 at 13:11
What are your $k_n$? It looks like they should be something like $\frac{2n\pi }{L}$ where $L$ is the length of the box you are in. If you are not in a box you should have in integral instead of a sum. –  Ross Millikan Apr 4 '11 at 13:37
I suspect that in order to be able to understand any answers given to your question, you will first have to understand why the boundary conditions are an integral part of the definition of the problem (and thus it made no sense to ask the question without mentioning them). –  joriki Apr 4 '11 at 15:41
@Didier; the $k_n$ had been specified in the meantime (albeit as $K_n$). @Sommerfugl: You should really put all the stuff that you've added in the meantime into the question; you've created quite a mess by not supplying all this essential information right away and then scattering it in comments without fixing the question. –  joriki Apr 4 '11 at 16:16

Ignore the chatter, this is a standard undergraduate PDE problem and you're doing it correctly. You may use only $n \geq 0$ as you are doing, and you correctly only have cosine terms in the $x$ variable due to the nature of your boundary conditions.

-

It's certainly not the general solution. It's not the general solution of the equation with certain boundary conditions, either, because there's no way for boundary conditions to force the solution to be an even function of $x$.

As for the question of whether positive $n$ are sufficient: yes they are. Note that $\cos(-k x) (C \cos(-k t) + D \sin(-k t)) = \cos(k x) (C \cos(k t) - D \sin(k t))$ so the terms with negative $k_n$ can be written as terms with positive $k_n$.

-
That's not true -- the given boundary conditions do select the cosines because the derivative at $0$ has to vanish. In this case the boundary conditions can force the function to be even because the domain ends at $x=0$. –  joriki Apr 4 '11 at 16:13