# 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,

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

subject to the conditions

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

$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:

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

Plugging into boundary conditions gives:

$\varphi(0) = 0$

Plugging the product solution into the DE and separating gives:

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

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

$\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:

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

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

$\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,

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

subject to the conditions

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

$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:

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

Plugging into boundary conditions gives:

$\varphi(0) = 0$

Plugging the product solution into the DE and separating gives:

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

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

$\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:

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

$\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 $\phi$ equation. You can do the h equation.

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

This is a homogeneous linear differential equation with constant coefficients.

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

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

So the solution to the homogeneous equation is
$\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
$\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!

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

Applying boundary conditions:

$0 = \varphi(0) = b$

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

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

So positive eigenvalues and their corresponding eigenfunctions are:

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

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

So the first DE is now:

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

So solution to this is then:

$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.
$\frac{d^2h}{dt^2} + c^2\lambda h = 0$

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

So we have as your overall function:
$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})$

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

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

This can only be true if b = 0.

Thus
$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
$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:
$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
$u(x,t) = af~sin(x \sqrt{\lambda})~cos(ct\sqrt{\lambda})$

Finally, the first condition:
$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
$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
$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:
$u(x,t)=X(x)\cdot T(t)$
giving rise to:
$T''-\lambda c^2T=0$
$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:
$\lambda =-\alpha^2$
$\alpha>0$
giving now:
$T''+\alpha^2 c^2T=0$
$X''+\alpha^2 X=0$
And therefore:
$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):
$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:
$u(x,t)=\int_{0}^{\infty} A(\alpha) sin(\alpha x) cos(\alpha ct) d\alpha$
Applying now the initial condition, gives:
$q(x)=\int_{0}^{\infty} A(\alpha) sin(\alpha x) d\alpha$
Or from the theorem of Fourier:
$A(\alpha)=\frac{2}{\pi} \int_{0}^{\infty} q(v) sin(\alpha v) dv$
And the final solution becomes:
$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:
$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 $\lambda = 0$

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

Gen solution is $T = Ax + B$

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

So this gives only trivial solutions.

Case
$\lambda > 0$

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

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

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

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

So this gives only trivial solutions.

Case $\lambda < 0$

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

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

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

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

So must have $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 $\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 $\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:

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

The first case is the zero one:

$T''=0$
$X''=0$

giving:

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

Thus:

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

The first condition gives:

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

We have now (C in A and B):

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

The other condition gives:

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

We have thus:

$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:

$|u(x,t)|

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 $\lambda > 0$

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

Thus giving:

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

Thus:

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

First condition gives:

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

We now have:

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

Then:

$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:

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

Hence a trivial solution and we reject.

Case $\lambda < 0$

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

Thus giving:

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

Thus:

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

First condition gives:

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

We now have:

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

Then:

$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:

$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:

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

Then:

$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:

$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:

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

The derivative is however:

$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:

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

Now you have:

$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:

$T(t)=Ae^{\alpha ct}+Be^{-\alpha ct}$
$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 $\lambda < 0$

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

Thus giving:

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

Thus:

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

First condition gives:

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

We now have:

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

Then:

$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:

$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:

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

You have now:

$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!