# Solving inhomogenous wave equation

1. Sep 19, 2008

### wahoo2000

I have made an attempt on this one, but I'm not quite sure that I have done it correctly so far..? I am now heading a (for me massive partial integration, and therefore I think it's better to ask before I start.

1. The problem statement, all variables and given/known data
Find the solution u(x,t) of the inhomogenous wave equation

$$u_{tt}-u_{xx}=x, 0<x<1, t>0$$
$$u(0,t)=1, u_{x}(1,t)=0$$
$$u(x,0)=1, u_{t}(x,0)=0$$

3. The attempt at a solution

Let u(x,t)=S(x)+w(x,t) where S''(x)=x, S(0)=S'(1)=0
then
S'(x)= X^2+C
S(x)=x^3/6+C*x+D
S(0)=0 ==> D=0
S'(1)=0 ==> C=-1/2
==>
S(x)=x^3/6-x/2

Then the equation for w is:
$$w_{tt}-w_{xx}=0, 0<x<1, t>0$$
$$w(0,t)=1, w_{x}(1,t)=0$$
$$w(x,0)=u(x,0)-S(x)=1-\frac{x^{3}}{6}+\frac{x}{2}, w_{t}(x,0)=0$$

I will try to send the rest as a reply to this post... I get database error when I try to send more than this.. :/

Last edited: Sep 19, 2008
2. Sep 19, 2008

### wahoo2000

Now I use separation of variables
w(x,t)=X(x)T(t)=/0
==>

$$\frac{X''(x)}{X(x)}=\frac{T''(t)}{T(t)}=\lambda<0$$
==>

$$X(x)=Asin(\sqrt{-\lambda}x+Bcos(\sqrt{-\lambda}x)$$
And since X(0)=1 ==> A=0
and therefore $$\lambda=-n^{2}\pi^{2}$$
And then $$X_{n}x=cos(nx\pi)$$

Last edited: Sep 19, 2008
3. Sep 19, 2008

### wahoo2000

same thing for t ==> $$T_{n}t=P_{n}sin(nt\pi)+Q_{n}cos(nt\pi)$$
And since $$w_{t}(x,0)=0, T_{n}'t=P_{n}cos(nt\pi)-Q_{n}sin(nt\pi)$$
==>$$Q_{n}=0$$
This means that $$w(x,t)=\sum^{n=1}_{\infty}P_{n}sin(nx\pi)cos(nx\pi)$$

4. Sep 19, 2008

### wahoo2000

And to identify $$P_{n}$$ let t=0 (to use w(x,0))

$$w(x,0)=\sum^{\infty}_{n=1}P_{n}sin(nt\pi)=1-\frac{x^{3}}{6}+\frac{x}{2}$$
Multiply both sides with $$sin(kx\pi)$$ and integrate over (0,1)

==>
$$\sum^{\infty}_{n=1}P_{n}\int^{0}_{1}sin(nt\pi)sin(kx\pi)dx = \int^{0}_{1}(1-\frac{x^{3}}{6}+\frac{x}{2})sin(kx\pi)dx$$

And now it is time for the integration by parts..... If it was correct so far!

Last edited: Sep 19, 2008
5. Sep 19, 2008

### gabbagabbahey

Your solution for $$S(x)$$ is incorrect:

$$\int Cdx = Cx+D$$

NOT

$$\frac{Cx^2}{2} + D$$

6. Sep 19, 2008

### wahoo2000

Yes, of course... S(x)=x^3/6-x/2

7. Sep 19, 2008

### gabbagabbahey

Why are you assuming $$\lambda < 0$$ here? Don't you generally have to treat all three cases:
$$\lambda < 0$$, $$\lambda = 0$$, and $$\lambda > 0$$ ?

8. Sep 19, 2008

### wahoo2000

Hmm, I might have misunderstood this. In all examples I have seen, $$\lambda<0$$ is the one used. Therfore I thought it might be ok to assume that this is the case, if I find a non-trivial solution using that $$\lambda$$

9. Sep 19, 2008

### gabbagabbahey

You might also find non-trivial solutions for the other two cases. If you do, then the complete solution will be the product of your solutions for each of the 3 cases. I think you need to make sure that there are no non-trivial solutions for the other two cases.

10. Sep 19, 2008

### gabbagabbahey

Anyways, for the $$\lambda<0$$ case,

$$X(0)=1 \Rightarrow Asin(0) + Bcos(0) = B =1$$

NOT $$A=0$$

11. Sep 19, 2008

### wahoo2000

Ah, okey! Then I have the check the other two cases as well. Thanks so far!

12. Sep 19, 2008

### gabbagabbahey

Where did you get that from?

13. Sep 19, 2008

### wahoo2000

Ok, I have studied the two other cases now...

For X the boundary conditions given are X(0)=1 and X'(1)=0
And X''(x)=$$\lambda*X(x)$$
The characteristic equation is r^2=lambda and hence $$r_{1,2}=+-\sqrt{\lambda}, \lambda>0$$
and
$$r_{1,2}=+-i\sqrt{-\lambda}, \lambda<0.$$

For case 1, lambda=0
X(x)=Ax+B
X'(x)=A

X(0)=B=1
X'(1)=A=0 ==> X(x)=0 and that is not what we are looking for.... so now to the case where lambda>0:

$$X(x)=Ae^{\sqrt{\lambda}x}+Be^{-\sqrt{\lambda}x}$$
and
$$X'(x)=\sqrt{\lambda}*(Ae^{\sqrt{\lambda}x}-Be^{-\sqrt{\lambda}x})$$
then
X(0)=A+B=1
and
X'(1)$$= \sqrt{\lambda}*(Ae^{\sqrt{\lambda}}-Be^{-\sqrt{\lambda}})=0$$
then I am not sure.. sqrt(lambda) obviously can't be zero, since lambda is larger than zero in this case.. Then the other part might be zero? But I am not sure if I can say it is.. If it is zero, then the case where lambda<0 alone gives the solution.

There is no need to do the same calculations for T since the equations and boundary conditions are the same, right?

14. Sep 19, 2008

### wahoo2000

From the boundary condition $$u_{x}(1,t)=0$$
X' is $$-Bsin(\sqrt{-\lambda}x)=0$$ for x=1
and since B is not allowed to be 0, $$sin(\sqrt{-\lambda})$$ has to be zero. And that is true if sqrt(-lamba)=n*Pi, which menas that $$\lambda=-n^{2}\pi^{2}$$

15. Sep 19, 2008

### gabbagabbahey

This is incorrect.

If $$X(0)=1$$ , then $$B=1 \Rightarrow X(x)=Asin(kx) +cos(kx) \Rightarrow X'(x) = Akcos(kx) -ksin(kx)$$ where $$k \equiv \sqrt{- \lambda}$$

So,

$$X'(1)=0 \Rightarrow Akcos(k) -ksin(k)=0 \Rightarrow A = tan(k) \Rightarrow X(x)=tan(k)sin(kx)+cos(kx)$$

But(!) these are not the boundary conditions you were given; you only have conditions for $$w(x,t)$$ NOT for $$X(x)$$ and $$T(t)$$ individually.

Here is what you actually know:

$$w(x,t)=(Asin(kx)+Bcos(kx))(Csin(kt) + Dcos(kt))$$

And so, for the first boundary condition:

$$w(0,t)=1 \Rightarrow (Asin(0)+Bcos(0))(Csin(kt)+Dcos(kt))=B(Csin(kt)+Dcos(kt))=1$$

$$\Rightarrow (Csin(kt)+Dcos(kt))= \frac{1}{B}$$

$$\Rightarrow w(x,t) = \frac{A}{B}sin(kx)+cos(kx)$$

What do the other 3 boundary conditions say about $$w(x,t)$$ ?

16. Sep 20, 2008

### wahoo2000

"$$\lambda=-n^{2}\\pi^{2}$$
This is incorrect. "

Hmm.. Tried again and saw an error, but still get the same result?
X'= $$-B\sqrt{-\lambda}sin(\sqrt{-\lambda}*1)=0$$ But B or lambda can't be zero so then sqrt(-lambda)=n*Pi?

Then I made an attempt with the boundary conditions but I am getting confused... Is the solution really t-independent?
From the first BC you got w(x,t)=(A/B)sin(kx)+cos(kx), but since B=1, w(x,t)=Asin(kx)+Bcos(kx).

Then I uesd the second one, $$w_{x}(1,t)=0=(Ak cos(k)- k sin(k))=0 ==> A=\frac{k cos(k)}{k sin(k)} ==> \frac{1}{A}=tan(k) ==> A=\frac{1}{tan(k)}$$

Then the third, w_t(x,0)=0
Is true because the soulution is independent of t, (because C and D = 0) ?????

Fourth
w(x,0)=Asin(kx)+cos(kx)=1-x^3/6-x/2 I don't know what to do with it? True since there is no t..?

Then w(x,t)=(1/tan(k))sin(kx)+cos(kx)-1+x^3/6-x/2

But I don't know what to do now, this can't be it..? Seems suspiciously simple.. Need to get to u(x,t), and also it has to be written in some convenient form that can help me to calculate $$\sum^{\infty}_{k=0}\frac{1}{(2k+1)^{4}}$$

Last edited: Sep 20, 2008
17. Sep 20, 2008

### gabbagabbahey

Are you sure you've posted the correct boundary conditions for u(x,t)?

i.e. are these correct:
$$u(0,t)=1, u_{x}(1,t)=0$$
$$u(x,0)=1, u_{t}(x,0)=0$$

???

18. Sep 20, 2008

### wahoo2000

Yes.... that is what it says.

19. Sep 20, 2008

### gabbagabbahey

hmmm....okay, I think I found the problem:

(1) first, for w(x,t)+S(x) to satisfy the given wave equation, S''(x) should be negative x, not +x. This gives a general solution of S(x)=-(x^3)/6 +Ax +B

(2) second, S(0)=0 leaves w(x,t) with too harsh restrictions at x=0; it is better to set S(0)=1 so that w(0,t)=0. S'(1)=0 is fine though. This gives S(x)=-(x^3)/6 +x/2 +1.

So the boundary conditions for w(x,t) are:
$$(i) \quad w(0,t)=0$$
$$(ii) \quad w_x (1,t)=0$$
$$(iii) \quad w(x,0)=\frac{x^3}{6} - \frac{x}{2}$$
$$(iv) \quad w_t (x,0)=0$$

Now you can get a meaningful solution for $$w(x,t)$$

Start with the $$\lambda <0$$ and show me what you get.

Last edited: Sep 20, 2008
20. Sep 20, 2008

### wahoo2000

Hmm..

k=n*Pi=sqrt(-lambda) if my lambda was correct.

then
(i) w(0,t)=0=B(Csin(kt)+Dcos(kt)), and since B=1, Csin(kt)+Dcos(kt) must be =0

(ii) w_x(1,t)=0=(Akcos(k)-Bksin(k))(Csin(kt)+Dcos(kt))
And I know from (i) that Csin(kt)+Dcos(kt)=0 and hence Akcos(k)-ksin(k)=0 ==> A=(kcos(k))/ksin(k)=tan(k)

(iii) w(x,0)=x^3/6-x/2=(Asin(kx)+Bcos(kx))(Csin(0)+Dcos(0))=D(Asin(kx)+(Bcos(kx)=x^3/6-x/2
==> D(tan(k)sin(kx)+cos(kx))=x^3/6-x/2

(iv) w_t(x,0)=(Asin(kx)+Bcos(kx))(Ckcos(0)-Dksin(0))=Ck(Asin(kx)+Bcos(kx))=0
==> Ck=(tan(k)sin(kx)+cos(kx))=0

But I don't know how to continue from here?