1. Limited time only! Sign up for a free 30min personal tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Homework Help: Diffusion equation by seperation of variables

  1. May 6, 2014 #1
    1. The problem statement, all variables and given/known data

    A uniform rod of length l has an initial (at time t = 0) temperature distribution given by u(x, 0) = sin([itex]\frac{πx}{l}[/itex]), 0 [itex]\leq[/itex] x [itex]\leq[/itex] l.

    The temperature u(x, t) satisfies the classical one-dimensional diffusion equation, ut = kuxx

    The ends of the rod are perfectly insulated, so ux(0, t) = ux(l, t) = 0.

    Find general solution u(x, t) by the method of separation of variables. What happens to the solution as t -> ∞ ? (Do not find the Fourier coefficients other than the one required to answer the last part.)

    2. Relevant equations

    3. The attempt at a solution

    We have method of Seperation of Variables so set:

    u(x, t) = X(x)T(t) so we have XT' = kX''T (by using this with ut = kuxx)

    This gives us: [itex]\frac{X''}{X}[/itex] = [itex]\frac{T'}{kT}[/itex] = λ (by separating the variables where λ is a constant)

    Looking at X:

    we have X'' = Xλ so X'' - Xλ = 0

    this means we have [itex]\alpha[/itex]2 = λ and so [itex]\alpha[/itex] = [itex]\pm[/itex][itex]\sqrt{λ}[/itex]

    we require λ < 0, so let λ = -[itex]\omega[/itex]2 and so we now have: [itex]\alpha[/itex] = i[itex]\omega[/itex]

    this gives us X(x) = Asin([itex]\omega[/itex]x) + Bcos([itex]\omega[/itex]x)

    Applying our boundary conditions to X(x) we have:

    X' = A[itex]\omega[/itex]cos([itex]\omega[/itex]x) - B[itex]\omega[/itex]sin([itex]\omega[/itex]x)

    thus X'(0) = A[itex]\omega[/itex] = 0 so we know A=0

    and X'(l) = -B[itex]\omega[/itex]sin([itex]\omega[/itex]l) = 0 so we know sin([itex]\omega[/itex]l) = 0 and so [itex]\omega[/itex]l = nπ

    this means [itex]\omega[/itex] = [itex]\frac{nπ}{l}[/itex]

    then finally for X we have that: X(x) = Bcos([itex]\frac{nπx}{l}[/itex]), n=0,1,2,3,....

    Looking at T:

    we have [itex]\frac{T'}{T}[/itex] = kλ and integrate to find:

    ln|T| = kλt + C so T = Cekλt

    and we know that λ = -[itex]\omega[/itex]2 = (-n2π2)/(l2)

    Hence we know our General Solution is u(x,t) = X(x)T(t) so

    Our General Solution is:

    u(x,t) = [itex]\sum[/itex]Bncos([itex]\frac{nπx}{l}[/itex])exp{(-n2π2kt)/(l2)}

    Also given an initial condition:

    u(x,0) = sin([itex]\frac{πx}{l}[/itex])

    using this, we set t=0 in u(x,t) so we have:

    u(x,0) = [itex]\sum[/itex]Bncos([itex]\frac{nπx}{l}[/itex]) = sin([itex]\frac{πx}{l}[/itex])

    so by inspection when n=0, B0 = sin([itex]\frac{πx}{l}[/itex])

    and when n=1,2,3,... we have B1, B2, B3, ... = 0.

    Thus our full solution for these boundary conditions and initial conditions is:

    u(x,t) = sin([itex]\frac{πx}{l}[/itex])


    Is this all correct what I've done? The reason I'm unsure if I'm correct is due to the last part of the question asking "What happens to the solution when t --> ∞?" as you can see there is no t in the final solution. It also notes "Do not find the Fourier coefficients other than the one required to answer the last part" and I'm not sure what this means or how it effects the question really.

    ANY help is very much appreciated! Thanks very much!
  2. jcsd
  3. May 6, 2014 #2


    User Avatar
    Science Advisor
    Homework Helper
    Gold Member

    Several comments here. You have ##\lambda = -\omega^2 < 0## and ##\omega_n = \frac {n\pi} l##. This does not include ##n=0##. The corresponding eigenfunction is ##X_n =
    \cos(\frac{n\pi x}{l})##. You do need the subscript on the ##X## and you don't need the ##B## out in front at this stage.

    At this point you should check the case ##\lambda = 0##. You will find a nonzero solution ##X_0##.

    No. We would build terms ##u_n(x,t) = X_n(x)T_n(t)## and look for a solution as a sum of those.
    You also have to check the ##T## equation for when ##\lambda = 0## to see if you get a ##T_0##. This matters because you need to know if your solution includes an ##X_0T_0## term or not.

    Where does this sum start? ##n=1## or ##n=0##. See above about checking the case ##\lambda = 0##.

    No, this is as wrong as it can be. You haven't shown there is a ##B_0## and even if you had, it would be constant, not a function of ##x##. At this point you need to expand a sine term in a half range cosine series. Given your instructions not to calculate the coefficients you don't need, I think the problem is mis-stated or mistyped. If your initial temperature distribution was ##\cos(\frac{πx}{l})## you would have only one term in the FS. You need to ask your teacher about that.
    What happened to the exponentials in your general solution above (in red)? Also note I have removed your huge bold type which is irritating and violates the forum rules.
  4. May 6, 2014 #3


    User Avatar
    Homework Helper

    So far this is correct, but you need to give limits for the sum:
    u(x,t) = \sum_{n=0}^\infty B_n \cos\left( \frac{n\pi x}l\right) \exp\left(-\frac{n^2 \pi^2 kt}{l^2}\right).[/tex]

    That's not how you determine the [itex]B_n[/itex], which are constants; having one of them turn out to be a function of [itex]x[/itex] immediately suggests an error.

    To find the [itex]B_n[/itex] for [itex]u(x,0) = f(x)[/itex] you would use [tex]
    \int_0^l B_n \cos^2\left(\frac{n\pi x}l\right)\,dx = \int_0^l f(x) \cos\left(\frac{n\pi x}{l}\right)\,dx,[/tex] but here the question asks you not to do that for general [itex]n[/itex].

    Look at the general solution again: [tex]
    u(x,t) = \sum_{n=0}^\infty B_n \cos\left( \frac{n\pi x}l\right)
    \exp\left(-\frac{n^2 \pi^2 kt}{l^2}\right).
    [/tex] What is [tex]\lim_{t \to \infty} \exp\left(-\frac{n^2 \pi^2 kt}{l^2}\right)?[/tex] Is it the same for all [itex]n \geq 0[/itex]?
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook

Have something to add?
Draft saved Draft deleted