# Thread: wave equation - finding the solution

1. ## wave equation - finding the solution

An electrical signal described by the function u(x,t) is transmitted in the x direction. The signal satisfies the wave equation,

$\displaystyle u_{tt} - c^2u_{xx} = 0, x > 0, t > 0$

subject to the conditions

$\displaystyle u(x,0) = q(x), u_t(x,0) = 0$ for x > 0,

$\displaystyle u(0,t) = 0,$ for t > 0, where q(x) is a known function.

Find the solution for u(x,t).

So far I have done...

The product solution is:

$\displaystyle u(x,t) = \varphi(x)h(t)$

Plugging into boundary conditions gives:

$\displaystyle \varphi(0) = 0$

Plugging the product solution into the DE and separating gives:

$\displaystyle \frac{\partial^2}{\partial t^2}(\varphi(x)h(t)) = c^2\frac{\partial^2}{\partial x^2}(\varphi(x)h(t))$

$\displaystyle \varphi(x) \frac{d^2h}{dt^2}= c^2h(t)\frac{d^2 \varphi}{dx^2}$

$\displaystyle \frac{1}{c^2h}\frac{d^2h}{dt^2} = \frac{1}{\varphi}\frac{d^2\varphi}{dx^2} = -\lambda$

From separating variables we get 2 ODES:

$\displaystyle \frac{d^2h}{dt^2} + c^2\lambda h = 0$

$\displaystyle \frac{d^2\varphi}{dx^2} + \lambda \varphi$

$\displaystyle \varphi(0) = 0$

And then I'm really really stuck about how to do the rest, I think I need to get some eigenfunctions and eigenvalues, but then don't know how to get the solution u(x,t) from there...

Any help would be so appreciated, I need to know how to do loads fo these questions for my exam but I'm really struggling

2. Originally Posted by hunkydory19
An electrical signal described by the function u(x,t) is transmitted in the x direction. The signal satisfies the wave equation,

$\displaystyle u_{tt} - c^2u_{xx} = 0, x > 0, t > 0$

subject to the conditions

$\displaystyle u(x,0) = q(x), u_t(x,0) = 0$ for x > 0,

$\displaystyle u(0,t) = 0,$ for t > 0, where q(x) is a known function.

Find the solution for u(x,t).

So far I have done...

The product solution is:

$\displaystyle u(x,t) = \varphi(x)h(t)$

Plugging into boundary conditions gives:

$\displaystyle \varphi(0) = 0$

Plugging the product solution into the DE and separating gives:

$\displaystyle \frac{\partial^2}{\partial t^2}(\varphi(x)h(t)) = c^2\frac{\partial^2}{\partial x^2}(\varphi(x)h(t))$

$\displaystyle \varphi(x) \frac{d^2h}{dt^2}= c^2h(t)\frac{d^2 \varphi}{dx^2}$

$\displaystyle \frac{1}{c^2h}\frac{d^2h}{dt^2} = \frac{1}{\varphi}\frac{d^2\varphi}{dx^2} = -\lambda$

From separting variables we get 2 ODES:

$\displaystyle \frac{d^2h}{dt^2} + c^2\lambda h = 0$

$\displaystyle \frac{d^2\varphi}{dx^2} + \lambda \varphi$

And then I'm really really stuck about how to do the rest, I think I need to get some eigenfunctions and eigenvalues, but then don't know how to get the solution u(x,t) from there...

Any help would be so appreciated, I need to know how to do loads fo these questions for my exam but I'm really struggling

I'll do the $\displaystyle \phi$ equation. You can do the h equation.

$\displaystyle \frac{d^2 \phi}{d^2x} + \lambda \phi = 0$

This is a homogeneous linear differential equation with constant coefficients.

The characteristic equation is
$\displaystyle m^2 + \lambda = 0$

$\displaystyle m = \pm i \sqrt{\lambda}$

So the solution to the homogeneous equation is
$\displaystyle \phi (x) = Ae^{i \sqrt{\lambda}} + Be^{-i \sqrt{\lambda}}$

With a bit of effort (which I'll leave to you) we can rewrite this as
$\displaystyle \phi(x) = a~sin(x \sqrt{\lambda} ) + b~cos(x \sqrt{\lambda})$
where a and b are two new arbitrary constants.

-Dan

3. Thank you so much for replying topsquark. I've re-read my notes again and again and although I'm still not sure of what I'm doing I've had a go at the rest. So forgive me if it's all a load of rubbish!

$\displaystyle \varphi(x) = asin(x \sqrt{\lambda} ) + bcos(x \sqrt{\lambda})$

Applying boundary conditions:

$\displaystyle 0 = \varphi(0) = b$

We need no-trivial solutions, so we must have:

$\displaystyle sin(x \sqrt{\lambda} ) = 0 ==> x \sqrt{\lambda} = n \pi, n = 1,2,3$

So positive eigenvalues and their corresponding eigenfunctions are:

$\displaystyle \lambda_n = \displaystyle \left(\frac{n\pi}{x} \right)^2$

$\displaystyle \varphi_n (x) = sin (n\pi), n = 1,2,3...$

So the first DE is now:

$\displaystyle \frac{d^2h}{dt^2} + (n \pi c)^2h = 0$

So solution to this is then:

$\displaystyle h(t) = c_1 cos (n \pi c t) + c_2 sin (n \pi c t)$

And then I'm a bit shaky as to how get u(x,t) from here....

4. I prefer to look at the overall function before I start applying the boundary conditions. And, as you will see, there is a chance that your boundary conditions are inconsistent.

Let's look at your time function first.
$\displaystyle \frac{d^2h}{dt^2} + c^2\lambda h = 0$

This has a similar solution to the $\displaystyle \phi$ equation, so let's just skip to the end:
$\displaystyle h(t) = d~sin(ct\sqrt{\lambda}) + f~cos(ct\sqrt{\lambda})$

So we have as your overall function:
$\displaystyle u(x,t) = \phi(x) \cdot h(t) = (a~sin(x \sqrt{\lambda}) + b~cos(x \sqrt{\lambda}))(d~sin(ct\sqrt{\lambda}) + f~cos(ct\sqrt{\lambda})$

$\displaystyle u(x, 0) = q(x)$
$\displaystyle u_t(x, 0) = 0$
$\displaystyle u(0, t) = 0$

The last one says:
$\displaystyle u(0, t) = (b)(d~sin(ct\sqrt{\lambda}) + f~cos(ct\sqrt{\lambda})) = 0$

This can only be true if b = 0.

Thus
$\displaystyle u(x,t) = a~sin(x \sqrt{\lambda}) \cdot (d~sin(ct\sqrt{\lambda}) + f~cos(ct\sqrt{\lambda})$

Now let's look at the second condition. We have that
$\displaystyle u_t(x, t) = a~sin(x \sqrt{\lambda}) \cdot (dc \sqrt{\lambda}~cos(ct \sqrt{\lambda}) - fc \sqrt{\lambda}~sin(ct \sqrt{\lambda}))$

So applying the second condition gives:
$\displaystyle u_t(x, 0) = a~sin(x \sqrt{\lambda}) \cdot (dc \sqrt{\lambda}) = 0$

The only way this can happen is if d = 0.

Thus
$\displaystyle u(x,t) = af~sin(x \sqrt{\lambda})~cos(ct\sqrt{\lambda})$

Finally, the first condition:
$\displaystyle u(x, 0) = af~sin(x \sqrt{\lambda}) = q(x)$

All I can say is that q(x) had better be consistent with this, else the wave will not be consistent. I think that
$\displaystyle u(x,t) = af~sin(x \sqrt{\lambda})~cos(ct\sqrt{\lambda})$
is going to be the best solution you are going to get for these conditions.

-Dan

5. Thanks again for replying topsquark, that makes so much more sense the way you have done it

Just a few more questions regarding this, I have to give a physical interpretation of what happens to the left-moving waves when they hit the boundary at x = 0, but have no idea to explain this...could I just say it bounces and interferes with itself? Or that they simpy vanish? Two VERY wild stabs in the dark!

Also the second part of the question says the general solution of the problem takes form

u(x,t) = F(x - ct) + G(x + ct)

for some twice-differential functions F and G sketch the domain of dependence for a point (x,t) x < ct and x > ct.

I don't understand what I have to actually sketch here or how to sketch it...could you possibly explain this simply?

Thanks so much!

6. Originally Posted by topsquark
All I can say is that q(x) had better be consistent with this, else the wave will not be consistent. I think that
$\displaystyle u(x,t) = af~sin(x \sqrt{\lambda})~cos(ct\sqrt{\lambda})$
is going to be the best solution you are going to get for these conditions.
I don't agree with this. There is a better solution. First consider the separation of the solution into the product of two other functions. There you have the following:
$\displaystyle u(x,t)=X(x)\cdot T(t)$
giving rise to:
$\displaystyle T''-\lambda c^2T=0$
$\displaystyle X''-\lambda X=0$
There are three cases to consider, smaller, equal to and a value of lambda larger than 0. The second and third one give rise to the zero solution, which is a trivial one and can be discarded. You are left with a negative value. Thus it can be written as:
$\displaystyle \lambda =-\alpha^2$
$\displaystyle \alpha>0$
giving now:
$\displaystyle T''+\alpha^2 c^2T=0$
$\displaystyle X''+\alpha^2 X=0$
And therefore:
$\displaystyle u(x,t)=\left[ A cos(\alpha ct)+B sin(\alpha ct)\right]\left[ C cos(\alpha x)+D sin(\alpha x) \right]$
Applying the boundary conditions gives B and C equal to 0. The current result we have is thus (D in A):
$\displaystyle u(x,t)=A cos(\alpha ct) sin(\alpha x)$
Because we are dealing with a semi-infinite string, we must use the integral form of the Fourier series, thus we have:
$\displaystyle u(x,t)=\int_{0}^{\infty} A(\alpha) sin(\alpha x) cos(\alpha ct) d\alpha$
Applying now the initial condition, gives:
$\displaystyle q(x)=\int_{0}^{\infty} A(\alpha) sin(\alpha x) d\alpha$
Or from the theorem of Fourier:
$\displaystyle A(\alpha)=\frac{2}{\pi} \int_{0}^{\infty} q(v) sin(\alpha v) dv$
And the final solution becomes:
$\displaystyle u(x,t)=\frac{2}{\pi} \int_{0}^{\infty} \int_{0}^{\infty} q(v) sin(\alpha v) sin(\alpha x) cos(\alpha ct) dv d\alpha$
This can be transformed (I haven't done this though) into a more common form if we consider F(x) to be the odd extension of q(x) as:
$\displaystyle u(x,t)=\frac{1}{2}\left[ F(x-ct)+F(x+ct)\right]$

This final result looks wavy :-)

7. Thanks so much for the better solution Coomast!

Could you possibly check my 3 cases for me as I'm still not sure I've done it right...I added in the BC X(L) = 0, since I'm assuming the ends of the wave are fixed, and also because I couldn't see another way to work out what both A and B were otherwise...

Case $\displaystyle \lambda = 0$

Equation for T is now: $\displaystyle T'' = 0$

Gen solution is $\displaystyle T = Ax + B$

Applying BCs: $\displaystyle T(0) = 0 --> B = 0$
$\displaystyle T(L) = 0 --> AL = 0 --> A = 0$

So this gives only trivial solutions.

Case
$\displaystyle \lambda > 0$

Let $\displaystyle \lambda = \alpha^2, \alpha > 0$

Equation for T is now: $\displaystyle T'' - \alpha^2c^2T= 0$

Gen solution is $\displaystyle T = Acosh \alpha c x + Bsinh \alpha c x$

Applying BCs: $\displaystyle T(0) = 0 --> A = 0$
$\displaystyle X(L) = 0 --> Bsinh \alpha c L = 0 --> B = 0$

So this gives only trivial solutions.

Case $\displaystyle \lambda < 0$

Let $\displaystyle \lambda = -\alpha^2, \alpha > 0$

Equation for T is now: $\displaystyle T'' + \alpha^2c^2T = 0$

Gen solution is $\displaystyle T = Asin \alpha c x + B cos \alpha c x$

Applying BCs: $\displaystyle T(0) = 0 --> B = 0$
$\displaystyle X(L) = 0 --> Asin \alpha c x = 0$

So must have $\displaystyle sin \alpha c x = 0$ for non-trivial solutions.

8. This seems more or less OK as an intention..., but don't forget to give the original equation and the exact way how you separated it, otherwise it might be confusing, also you mixed the notation of x and t sometimes. However the principal working is correct, just take more care on the algebra notation. I know that typing this much latex can be confusing.

Note that this is a different kind of problem than the one you originally posted. Here you have a finite length of string. You can use now the Fourier series expansion to arrive at the final solution if your boundary conditions are defined well.

In case of any more problems, please post, but define your exact problem completely and give it here, this makes it easier for me to check.

9. Cheers Coomast, you are so so helpful!

Although I'm still a tad confused...I don't want to be answering a new question, I'm still trying to answer the original one! So because I added in the boundary condition with L in, it changed the question?

If I dont add that boundary condition in, I don't understand how to work out the cases, i.e. for $\displaystyle \lambda = 0$ I know B = 0, but without any more information how do I show that A is also 0?

10. Originally Posted by hunkydory19
Cheers Coomast, you are so so helpful!
You're welcome.

Originally Posted by hunkydory19
Although I'm still a tad confused...I don't want to be answering a new question, I'm still trying to answer the original one! So because I added in the boundary condition with L in, it changed the question?

If I dont add that boundary condition in, I don't understand how to work out the cases, i.e. for $\displaystyle \lambda = 0$ I know B = 0, but without any more information how do I show that A is also 0?
Yes it changes it fairly drastic, a string of length L or one with infinite length is certainly not the same for solving. This comes from the fact that in mathematics you can be certain that when infinity comes in the picture things can behave strangely. Now to come back to the original one, you're problem is infinite, thus the condition X(L)=0 does not make a lot of sense. You're problem was defined correctly, don't add this condition. It is one that is important for a string of length L.

Now in order to show the three cases for an infinite string, consider the separation as I wrote earlier:

$\displaystyle T''-\lambda c^2T=0$
$\displaystyle X''-\lambda X=0$

The first case is the zero one:

$\displaystyle T''=0$
$\displaystyle X''=0$

giving:

$\displaystyle T(t)=At+B$
$\displaystyle X(x)=Cx+D$

Thus:

$\displaystyle u(x,t)=(At+B)(Cx+D)$

The first condition gives:

$\displaystyle u(0,t)=0=(At+B)(D) --> D=0$

We have now (C in A and B):

$\displaystyle u(x,t)=(At+B)x$

The other condition gives:

$\displaystyle u_t(x,0)=0=Ax --> A=0$

We have thus:

$\displaystyle u(x,t)=Bx$

Which can't be a solution because for very large x this goes towards infinity which is not physical. Therefore B=0 and thus the trivial zero solution. Normally this last condition is given as: "The solution must be bounded", or:

$\displaystyle |u(x,t)|<M$

With M a number, stating therefore that the solution must be smaller than infinity. A string can't be stretched infinite in size.

Hope this helps.

11. Right I've had a go at doing it your method, but I end up getting two trivial solutions so its obviously all wrong, although I can't see why...

Promise this is the last time il bother you about this question, I'm giving up after this attempt!

Case $\displaystyle \lambda > 0$

$\displaystyle T'' - \alpha^2c^2T = 0$
$\displaystyle X'' - \alpha^2X = 0$

Thus giving:

$\displaystyle T(t) = Acosh \alpha c t + Bsinh \alpha c t$
$\displaystyle X(x) = Csinh \alpha x + D cosh \alpha x$

Thus:

$\displaystyle u(x,t) = (Acosh \alpha c t + Bsinh \alpha c t)(Csinh \alpha x + D cosh \alpha x)$

First condition gives:

$\displaystyle u(0,t) = 0 = (Acosh \alpha c t + Bsinh \alpha c t)(D) --> D = 0$

We now have:

$\displaystyle u(x,t) = (Acosh \alpha c t + Bsinh \alpha c t)sinh \alpha x$

Then:

$\displaystyle u_t(x,t) = Asinh \alpha c sinh \alpha x . sinh \alpha c t + B \alpha c sinh \alpha x . cosh \alpha ct$

Other condition gives:

$\displaystyle u_t(x,) = B\alpha c sinh \alpha x --> B = 0$

Hence a trivial solution and we reject.

Case $\displaystyle \lambda < 0$

$\displaystyle T'' + \alpha^2c^2T = 0$
$\displaystyle X'' + \alpha^2X = 0$

Thus giving:

$\displaystyle T(t) = Asin \alpha c t + B cos \alpha c t$
$\displaystyle X(x) = Csin \alpha x + D co \alpha x$

Thus:

$\displaystyle u(x,t) = (Asin \alpha c t + B cos \alpha c t)(Csin \alpha x + D co \alpha x)$

First condition gives:

$\displaystyle u(0,t) = 0 = (Asin \alpha c t + B cos \alpha c t)D --> D = 0$

We now have:

$\displaystyle u(x,t) = (Asin \alpha c t + B cos \alpha c t)sin \alpha x$

Then:

$\displaystyle u_t(x,t) = A \alpha c sin \alpha x cos \alpha c t - B \alpha c sin \alpha c . sin \alpha c t$

Other condition gives:

$\displaystyle u_t(x,0) = 0 = A \alpha c sin \alpha x --> A = 0$

Which is obviously wrong...

12. Originally Posted by hunkydory19
Right I've had a go at doing it your method, but I end up getting two trivial solutions so its obviously all wrong, although I can't see why...

Promise this is the last time il bother you about this question, I'm giving up after this attempt!
No, don't give up you're almost there.

Originally Posted by hunkydory19
We now have:

$\displaystyle u(x,t) = (Acosh \alpha c t + Bsinh \alpha c t)sinh \alpha x$

Then:

$\displaystyle u_t(x,t) = Asinh \alpha c sinh \alpha x . sinh \alpha c t + B \alpha c sinh \alpha x . cosh \alpha ct$

Other condition gives:

$\displaystyle u_t(x,) = B\alpha c sinh \alpha x --> B = 0$

Hence a trivial solution and we reject.
This is not entirely correct written. You have indeed:

$\displaystyle u(x,t) = (Acosh( \alpha c t) + Bsinh( \alpha c t))sinh( \alpha x)$

The derivative is however:

$\displaystyle u_t(x,t) = (A \alpha c sinh( \alpha c t) + B \alpha c cosh( \alpha c t))sinh( \alpha x)$

And the other condition is thus:

$\displaystyle u_t(x,0) =0= (B \alpha c )sinh( \alpha x) --> B=0$

Now you have:

$\displaystyle u(x,t) =Acosh( \alpha c t) sinh( \alpha x)$

Because the solution must be bounded you can't have this as a solution because for large x both sinh and cosh tend to infinity. Another way of writing the solution for these two ordinary differential equations is by rewriting it as two exponentials:

$\displaystyle T(t)=Ae^{\alpha ct}+Be^{-\alpha ct}$
$\displaystyle X(x)=Ce^{\alpha x}+De^{-\alpha x}$

This is sometimes easier when infinity comes in the picture. You can more directly see what will happen at large x or t.

Originally Posted by hunkydory19
Case $\displaystyle \lambda < 0$

$\displaystyle T'' + \alpha^2c^2T = 0$
$\displaystyle X'' + \alpha^2X = 0$

Thus giving:

$\displaystyle T(t) = Asin \alpha c t + B cos \alpha c t$
$\displaystyle X(x) = Csin \alpha x + D co \alpha x$

Thus:

$\displaystyle u(x,t) = (Asin \alpha c t + B cos \alpha c t)(Csin \alpha x + D co \alpha x)$

First condition gives:

$\displaystyle u(0,t) = 0 = (Asin \alpha c t + B cos \alpha c t)D --> D = 0$

We now have:

$\displaystyle u(x,t) = (Asin \alpha c t + B cos \alpha c t)sin \alpha x$

Then:

$\displaystyle u_t(x,t) = A \alpha c sin \alpha x cos \alpha c t - B \alpha c sin \alpha c . sin \alpha c t$
There is an error in this last line, it should read:

$\displaystyle u_t(x,t) = A \alpha c sin( \alpha x) cos( \alpha c t) - B \alpha c sin (\alpha x) sin( \alpha c t)$

Applying the condition gives:

$\displaystyle u_t(x,0) =0= A \alpha c sin( \alpha x) --> A=0$

You have now:

$\displaystyle u(x,t) = B sin (\alpha x) cos( \alpha c t)$

Which is perfectly correct.

13. Cheers Coomast, got it sorted now! Thanks so much for ALL your help!