# Paritial Differential Equation separation of variables

1. May 2, 2007

### KitusFanaticus

1. The problem statement, all variables and given/known data
The temp. as a function of time of a metal rod obeys the following diff. eq.

$$\alpha^2 \frac{\partial^2u(x,t)}{\partial x^2} = \frac{\partial u(x,t)}{\partial t}$$

Use separation of variables to find $$u(x,t)$$ in a rod of length 1 subject to the conditions $$u(0,t) = 0 , u(1,t) = 0$$ and $$u(x,0) = 10$$

2. Relevant equations
Seperation of variable I assume a solution of X(x)T(t) right?

I think the length of the rod is not needed?

3. The attempt at a solution
Assume $$u(x,t) = X(x)T(t)$$

Then I get $$\frac{\alpha^2}{X(x)}\frac{\partial^2 X(x)}{\partial x^2}= \frac{1}{T(t)}\frac{\partialT(t)}{\partialt}$$

I then set them each equal to an arbitrary constant, -k^2 $$\frac{\alpha^2}{X(x)}\frac{\partial^2X(x)}{\parital x^2} = -k^2$$ and $$\frac {1}{T(t)}\frac{\partial T(t)}{\partial t} = -k^2$$

I then solve each of them and get a function $$u(x,t) = (e^{-i\frac{k}{\alpha}x} +e^{i\frac{k}{\alpha}x})*(e^{-k^2t}-e^{k^2t})$$

Now I think thats correct, but Im not positive. I just cant seem to apply the first boundry condition to it....

Help!

PS, I thought this was more useful in the math than physics forum, but move it if necessary, thx
1. The problem statement, all variables and given/known data

2. Relevant equations

3. The attempt at a solution

Last edited: May 2, 2007
2. May 3, 2007

### Tom Mattson

Staff Emeritus
Yep.

Not for the formal separation of variables, no. But of course since they give you the temperature at both ends, it is necessary to know where those ends are. Fortunately, you've been told that.

I don't agree with this part. The general solution of:

$X^{\prime\prime}(x)+\frac{k^2}{\alpha^2}X(x)=0$

is:

$X(x)=A\exp(ikx/\alpha)+A^*\exp(-ikx/\alpha)$

(the two terms should be modulated by constants that are complex conjugates of each other.

And the solution of:

$T^{\prime}(t)+k^2T(t)=0$,

has only one term, the decaying exponential. That second term with the growing exponential shouldn't be there.

Try it now.

Last edited: May 3, 2007
3. May 3, 2007

### KitusFanaticus

Thank you for the reply, it was helpful. I am still have much difficulty with this problem though. I have never taken diff. eq. class, the teacher wants us to 'discover' these solutions

I dont think $X^{\prime\prime}(x)+\frac{k^2}{\alpha^2}=0$ is what I want to solve is it? I want to solve $X^{\prime\prime}(x)+\frac{k^2}{\alpha^2}\cdotx=0$. (I think)

And the solution would be $X(x)=A\exp(ikx/\alpha)+A^*\exp(-ikx/\alpha)$ not $X(x)=A\exp(ik^2x/\alpha^2)+A^*\exp(-ik^2x/\alpha^2)$ right?

I dont understand why you take the complex conjugate of the coefficients....

Anyway, I get $$u(x,t) = (Aexp(-ikx/\alpha)+Bexp(Ikx/\alpha)(Cexp(-k^2t)$$, and I guess B = A*

When I try to apply the initial conditions I get A = -B, and C = 0 ... which leads me to believe I dont quite have the correct solution still...

4. May 3, 2007

### Tom Mattson

Staff Emeritus
That was a typo on my part. It should read:

$$X^{\prime\prime}(x)+\frac{k^2}{\alpha^2}X(x)=0$$

It's fixed now.

Yes, that was another typo. Sorry.

The constants must be complex conjugates because the overall solution must be real. That means that it must equal its own complex conjugate. The only way for that to happen is for the constants to be $A$ and $A^*$.

Yes, but there's no need to bother with the $C$. It is just a real constant that can get absorbed into $A$ and $A^*$ upon distributing.

Hmmm...I'm getting A=B=0. Let me think about it some more.

5. May 3, 2007

### Tom Mattson

Staff Emeritus
KF, I think that this problem is ill-posed. Let me backup and explain why.

That was a mistake on my part. The general solution of the PDE is, as we discussed,

$u(x,t)=[Aexp(ikx/\alpha)+A^*exp(-ikx/\alpha)]exp(-k^2t)$

There's nothing wrong with this. Now apply the first boundary condition.

$u(0,t)=[Aexp(0)+A^*exp(0)]exp(-k^2t)=0$,

which implies that $A^*=-A$, which in turn implies that $A$ is purely imaginary. All good so far.

Now let's apply the second boundary condition.

$u(1,t)=[Aexp(ik/\alpha)-Aexp(-ik/\alpha)]exp(-k^2t)=0$

$A[exp(ik/\alpha)-exp(-ik/\alpha)]exp(-k^2t)=0$

We have 3 options.

1: $A=0$

That is, the temperature is zero everywhere and for all time. But looking at the initial condition $u(x,0)=10$, that isn't possible.

2: $exp(-k^2t)=0$

This has no solution for any value of $t$.

3: $exp(ik/\alpha)-exp(-ik/\alpha)=0$

You have to use Euler's identities here to simplify this equation to $sin(k/\alpha)=0$. This leads to (countably) infinitely many values of $k$ which we can refer to as $k_n$, $n\in\mathbb{N}$ (I'll leave the $k_n$ for you to find). Since for a linear PDE the sum of solutions is again a solution, you will have an infinite sum of functions as your solution.

We now turn to the initial condition. It says that the temperature is 10 for all x when t=0. So $u(0,0)=10$ BUT, the first boundary condition says that the temperature is equal to 0 for all t when x=0. So $u(0,0)=0$.

6. May 4, 2007

### HallsofIvy

Staff Emeritus
Are you aware that
$$e^{ik/\alpha}= cos(k/\alpha)+ i sin(k/\alpha)$$

It might be simpler to write this in terms of sine and cosine rather that the imaginary exponentials.

7. May 4, 2007

### Tom Mattson

Staff Emeritus
Yes, but what of the apparent contradiction I brought up?

8. May 4, 2007

### Office_Shredder

Staff Emeritus
You'll note on the problem sheet it should read for all 0<x<1, which won't include x=0

9. May 4, 2007

### HallsofIvy

Staff Emeritus
Yes, the initial value is not continuous at x= 0 or x= 1. However, since the solution is an integral which "smooths" the functions, that is not a problem.