# Paritial Differential Equation separation of variables

## Homework Statement

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

## Homework Equations

Seperation of variable I assume a solution of X(x)T(t) right?

I think the length of the rod is not needed?

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

Last edited:

Tom Mattson
Staff Emeritus
Gold Member

## Homework Equations

Seperation of variable I assume a solution of X(x)T(t) right?

Yep.

I think the length of the rod is not needed?

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 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})$$

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.

I just cant seem to apply the first boundry condition to it....

Try it now.

Last edited:
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 don't agree with this part. The general solution of:

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

is:

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

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

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...

Tom Mattson
Staff Emeritus
Gold Member
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)

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.

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?

Yes, that was another typo. Sorry.

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

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^*$.

Anyway, I get $$u(x,t) = (Aexp(-ikx/\alpha)+Bexp(Ikx/\alpha)(Cexp(-k^2t)$$, and I guess B = 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.

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...

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

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

Hmmm...I'm getting A=B=0.

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

HallsofIvy
Homework Helper
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.

Tom Mattson
Staff Emeritus
Gold Member
Yes, but what of the apparent contradiction I brought up?

Office_Shredder
Staff Emeritus