# The constant $c$ when deriving the general series solution for the heat and wave equations

When deriving the general solution for the heat and wave equations, we have a constant $c$ that is carried in our calculations. Take the wave equations, for example:

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

Let's say we have boundary conditions $u(0, t) = 0$ and $u(1, t) = 0$.

Now assume a solution of the form

$$u(x, t) = X(x)T(t)$$

The boundary conditions imply that

$$X(0) = X(1) = 0$$

We substitute the assumed form of the solution into the PDE and use separation of variables:

$$\frac{1}{c^2} \frac{1}{T(t)} \frac{d^2T}{dt^2} = \frac{1}{X} \frac{d^2 X}{dx^2}$$

This must be equal to a constant. Make the constant $- \lambda$:

$$\frac{1}{c^2} \frac{1}{T(t)} \frac{d^2T}{dt^2} = \frac{1}{X} \frac{d^2 X}{dx^2} = -\lambda$$

The eigenvalue problems become either

$$c^2 \frac{1}{X} \frac{d^2 X}{dx^2} = - \lambda$$

OR

$$\frac{1}{c^2} \frac{1}{T(t)} \frac{d^2T}{dt^2} = - \lambda$$

Does it matter which equation takes the constant $c$? Will we get the same solutions either way?

We are trying to derive the general series solution, so why would it matter where we put the $c$? Shouldn't it produce the same general solution either way? Otherwise, I don't think it would be 'general'?

• Why don't you try both ways to see what happens? – mattos Jul 26 '18 at 3:18
• @Mattos Yes I think I will do this. But can you tell me what outcome I am supposed to get so that I know where I am heading towards? – Wyuw Jul 26 '18 at 3:19
• If you let the $c$ be with the eigenvalue problem in $X$, then the eigenvalues will be $(n \pi/c)^{2}, n \ge 1$. If you let $c$ be with the eigenvalue problem in $T$, then the eigenvalues will be $(n \pi)^{2}, n \ge 1$ i.e the $c$ is just a rescaling of the eigenvalues. – mattos Jul 26 '18 at 3:23
• I mostly put the $c$ with the $T$ eigenvalue problem. This is because the eigenvalue is derived from the boundary value problem and so it is more convenient to have this ODE be as simple as possible. – mattos Jul 26 '18 at 3:30
• @Mattos Hmm ok. I will do the calculations and see how this works out. Thank you for that. – Wyuw Jul 26 '18 at 3:47

In general you should get the following

$$\frac{1}{c^{2}}\frac{1}{h}\frac{d^{2}h}{dt^{2}} = \frac{1}{\phi} \frac{d^{2}\phi}{dx^{2}} = -\lambda \tag{1}$$ which gives you two eigenvalue problems

$$\frac{d^{2}h}{dt^{2}} = -\lambda c^{2} h \tag{2}$$

and

$$\frac{d^{2}\phi}{dx^{2}} = -\lambda \phi \tag{3}$$

then you end up with your boundary conditions

$$BC1: \phi(0) = 0 \\ BC2 : \phi(1) =1 \tag{4}$$

Now if $\lambda >0$

$$h(t) = c_{1} \cos(c\sqrt{\lambda}t) + c_{2}\sin(c\sqrt{\lambda}t) \tag{5}$$

when $\lambda = 0$ we have instead

$$h(t) = c_{1} +c_{2}t \tag{6}$$

If $\lambda< 0$ then we get hyperbolics, addressing the question. If we change this does it matter? What is the actual solution? Consider when the boundary conditons below

$$BC1: u(0,t) = 0 \\ BC2 : u(L,t) = 0 \tag{7}$$

Ok if we solve for them.

$$\frac{d^{2}\phi}{dx^{2}} = -\lambda \phi \tag{8}$$

becomes

$$\frac{d^{2}\phi}{dx^{2}} + \lambda \phi = 0 \tag{9}$$

The solutions are simply of the forms

$$\phi(x) = c_{1}\cos(\sqrt{\lambda}x) + c_{2}\sin(\sqrt{\lambda}x) \tag{10}$$ when we use the boundary conditions we get sines with these eigenvalues

$$\lambda = \big(\frac{n\pi }{L}\big)^{2} \tag{11}$$

so we have

$$\phi(x) = c_{1}\sin(\frac{n\pi x}{L}) \tag{12}$$

similarly, when we find $h(t)$ comes out as above.

$$h(t) = c_{1} \cos(c\sqrt{\lambda}t) + c_{2}\sin(c\sqrt{\lambda}t) \tag{13}$$

Note that boundary conditions made on $x$ not on $t$. So the ansatz is a product of these

$$u(x,t) = \phi(x)h(t) \tag{14}$$ we denoted that it was any linear combinations of them. What that really means is take the product of these eigenfunctions as a basis and sum them infinitely.

$$u(x,t) = \sum_{n=1}^{\infty} \bigg( A_{n}\sin(\frac{n\pi x}{L}) \cos(\frac{n\pi ct}{L}) + B_{n} \sin(\frac{n\pi x}{L}) \cos(\frac{n\pi ct}{L})\bigg) \tag{15}$$

Ok, so if you change where the $c^{2}$ is we have

$$u(x,t) = \sum_{n=1}^{\infty} \bigg( A_{n}\sin(\frac{n\pi c x}{L}) \cos(\frac{n\pi t}{L}) + B_{n} \sin(\frac{n\pi cx}{L}) \cos(\frac{n\pi t}{L})\bigg) \tag{16}$$

Which I will take a moment to note that this is not the same equation.

Typically we have a initial condition right. It goes like this

$$IC1: u(x,0) = f(x) \\ IC2 :\frac{\partial u}{\partial t}u(x,0) =g(x) \tag{17}$$

Now, not what we haven't solved for above. The coefficients. When we solve for them the major differnce appears. If I use the equation one line $15$

$$A_{n} = \frac{2}{L} \int_{0}^{L} f(x) \sin(\frac{n \pi x}{L})dx \tag{18}$$ $$B_{n}\frac{n \pi c}{L} = \frac{2}{L} \int_{0}^{L} g(x) \sin(\frac{n \pi x}{L})dx \tag{19}$$

This changes when you switch that clearly.