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: Solve the Dirichlet problem for the heat equation

  1. Apr 10, 2014 #1
    1. The problem statement, all variables and given/known data

    Solve the Dirichlet problem for the heat equation
    [tex]u_y=u_{xx}\quad 0<x<2\pi, \: t>0[/tex][tex]u(x,0)=\cos x[/tex][tex]u(0,t)=u(2\pi,t)=e^{-t}[/tex]

    2. Relevant equations

    3. The attempt at a solution

    I have no idea what to do here. It seems to me like it's a mix of the solutions we learned. I have time-dependant boundary conditions, and then an initial condition. To solve this do I have to use the reference temperature to turn it into an inhomogenous equation with homogenous boundary conditions, and then the eigenfunction expansion method, or is there an easier way?
  2. jcsd
  3. Apr 10, 2014 #2


    User Avatar
    Gold Member

    Do not ask yourself if it will be easy.
    Just go forward, do something.
    I guess you mean ut = uxx instead of uy = uxx?

    What do you know about this kind of question?
    Which methods have you learned?
  4. Apr 10, 2014 #3
    yes it's supposed to be a ut

    I don't know what I have learned about this type of question. I don't think I can use a general formula like I could when I had homogenous BC and a homogenous PDE.

    There is a chapter in my book which shows how to switch a PDE with time-dependent non-homogenous BC into a non-homogenous PDE with homogenous boundary conditions by subtracting a reference temperature, and then you have to use the eigenfunction expansion method to solve the new problem. I keep not getting anywhere when I try to do it like this though. We really only skimmed over the whole chapter so I have never really seen an example of this method being used.
  5. Apr 10, 2014 #4


    User Avatar
    Science Advisor

    That's a very unfortunate thing to say! I hope you didn't really mean it the way you said it. Further, whether you intended it or not, you are saying that you know how to solve this problem, you just don't want to do the work!

    One way of handling non-homogeneous boundary values is to make them homogenous (Homogenize them?) by changing the variable. Since the only boundary value given is [itex]u(0, t)= e^{-t}[/itex], let [itex]y(x, t)= u(x, t)- e^{-t}[/itex] or [itex]u(x, t)= y(x, t)+ e^{-t}[/itex]. Then [itex]u_{xx}= y_{xx}[/itex] and [itex]u_{t}= y_t- e^{-t}[/itex] so the equation becomes [itex]y_t- e^{-t}= y_xx[/itex] with "initial condition" [itex]y(x, 0)= u(x, 0)- 1= cos(x)- 1[/itex] and "boundary condition" [itex]y((0, t)= u(0, t)- e^{-t}= e^{-t}- e^{-t}= 0[/itex] and [itex]y(2\pi, t)= u(2\pi, t)- e^{-t}= 0[/itex].

    That's probably what you did. Now to solve that using the "eigenfunction expansion" method, we would recognize that eigenvectors for the operator [itex]\partial^2/\partial x[/itex], with boundaries at x= 0 and [itex]x= 2\pi[/itex] are sin(nx) for n a positive integer. So you want to write [itex]y(x)= \sum A_n(t) sin(nx)[/itex].

    Then [itex]y_xx= y_t[/itex] becomes [itex]\sum -n^2 A_n(t) sin(nx)= \sum A'_n sin(nx)[/itex] so that we must have [itex]A'_n= -n^2A_n[/itex] for all n.
  6. Apr 10, 2014 #5


    User Avatar
    Homework Helper

    In general if you can find a solution which satisfies the boundary conditions but not necessarily the initial condition, then you can add a solution which vanishes on the boundaries and satisfies the initial condition.

    This one does have an easier way, because it's an extremely special case: look for a solution of the form [itex]u(x,t) = f(t)\cos(x)[/itex].
  7. Apr 10, 2014 #6
    Thanks, I did do up to the eigenfunction expansion (and attempted that) before I posted here. Of course I want to do the work, but I was not sure if I was even on the right track!:smile:

    could you explain to me why I don't have eigenfunction [tex]\phi_n(x) =\sin\left( \frac{n x}{2} \right)[/tex]and eigenvectors[tex]\lambda_n=\left(\frac{n}{2}\right)^2[/tex]
    I have dirichetlet type BC, and using SOV, we have shown that the solution to the eigenvalue equation [itex]\phi''=-\lambda \phi[/itex] is [tex]\phi_n(x)=\sin\left( \frac{n \pi x}{L} \right)[/tex] with eigenvalues [itex]\left(\frac{n \pi}{L}\right)^2[/itex]
  8. Apr 10, 2014 #7
    ok I am completely and utterly lost on using the eigenfunction expansion method. to solve this problem. I get the equation. I'm going to type out everything I have done. Keep in mind I have never seen the eigenfunction expansion being used, there are no worked examples in my textbook as far as I know.

    I had
    [tex]u_t=u_{xx}\quad 0<x<2\pi, \: t>0[/tex]
    [tex]u(x,0)=\cos x[/tex]

    so I looked for a reference temperature r(x,t) so that r(0,t)=r(2π,t) = 0
    I determined that [itex]r(t)=e^{-t}[/itex]

    then I defined[tex]v(x,t) = u(x,t)-r(x,t)[/tex][tex]v_t=u_{xx}-r_t+r_{xx}[/tex][tex]v_t=v_{xx}+\bar{Q}[/tex]where [itex]\bar{Q}=e^{-t}[/itex]now I need to solve that problem with[tex]v(0,t)=v(2\pi,t) = 0[/tex][tex]v(x,0)=u(x,0)-r(x,0)=\cos x -1=g(x)[/tex]

    then I want to use eigenfunction expansion (I think) so I say[tex]v(x,t)=\sum_{n=1}^\infty a_n(t)\phi_n(x)[/tex] I have dirichetlet BC so [itex]\phi_n(x) =\sin\left( \frac{n x}{2} \right)[/itex] and the eigenvalues are [itex]\lambda_n=\left(\frac{n}{2}\right)^2[/itex]

    then to determine [itex]a_n(0)[/itex] I used the formula

    [tex]a_n(0)=\frac{\int^2\pi_0 g(x)\phi_n(x)dx}{\int^L_0 \phi^2_n(x)dx}=\frac{8(1-(-1)^2)}{\pi(n^2-4n)}[/tex] then to figure out the [itex]a_n(t)[/itex] I have [tex]\sum^\infty_{n=1}\left[ \frac{da_n}{dt}+\lambda_n a_n\right]\phi_n(x)=\bar{Q}(x,t)[/tex]which gives me [tex]\frac{da_n}{dt}+\lambda_n a_n = \bar{q}_n(t)[/tex]where[tex]\frac{\int^{2\pi}_0 \bar{Q}(x)\phi_n(x)dx}{\int^{2\pi}_0 \phi^2_n(x)dx}=\frac{2((-1)^n-1)e^{-t}}{n\pi}[/tex]which gives me the differential equation[tex]\frac{da_n}{dt}+\lambda_n a_n = \frac{2((-1)^n-1)e^{-t}}{n\pi}[/tex]

    and from there I do not understand what to do.
  9. Apr 10, 2014 #8


    User Avatar
    Science Advisor

    An "eigenvalue",0 for operator A, is a number, [itex]\lambda[/itex] such that [itex]Af= \lambda f[/itex] has non-trivial solutions. Here, the operator is [itex]d^2/dx^2[/itex] with domain functions that are 0 at x= 0 and [itex]x= 2\pi[/itex].

    If f is a function such that [itex]d^2f/dx^2= \lambda f[/itex] then there are three cases to consider:
    1) [itex]\lambda= 0[/itex]. In that case the differential equation is [itex]d^2f/dx^2= 0[/itex] which as general solution [itex]f(x)= Ax+ B[/itex]. f(0)= A(0)+ B= 0 so B= 0. Then [itex]f(2\pi)= 2\pi A= 0[/itex] so A= 0. That is, f(x)= 0x+ 0= 0, the "trivial solution". There is NO "non-trivial solution. 0 is NOT an eigenvalue.

    2) [itex]\lambda> 0[/itex]. To make that explicit, let [itex]\lambda= \alpha^2[/itex] where [itex]\alpha[/itex] can be any positive number. The differential equation is [itex]d^2y/dx^2= \alpha^2 y[/itex] which has general solution [itex]y= Ce^{\alpha x}+ De^{-alpha x}[/itex]. [itex]y(0)= C+ D= 0[/itex] and [itex]y(2\pi)= Ce^{2\alpha\pi}+ De^{-2\alpha\pi}[/itex]. From C+ D= 0, D= -C so the second equation becomes [itex]Ce^{2\alpha\pi}- Ce^{-2\alpha\pi}= C(e^{2\alpha\pi}- e^{-2\alpha\pi})= 0[/itex]. Since [itex]\alpha[/itex] is not 0, one of [itex]e^{2\alpha\pi}[/itex] and [itex]e^{-2\alpha\pi}[/itex] is greater than 1 and the other is less than 1. [itex]e^{2\alpha\pi}- e^{-2\alpha\pi}[/itex] is NOT 0 so we must have C= 0. Then D= -C= 0 also. The only solution is [itex]y= 0e^{\alpha x}+ 0e^{-\alpha x}= 0[/itex], the trivial solution. Again, there is no non-trivial solution so no positive number is an eigenvalue.

    3) [itex]\lambda< 0[/itex]. To make that explicit, let [itex]\lambda= -\alpha^2[/itex] where [itex]\alpha[/itex] can be any positive number. The general solution to [itex]d^2y/dx^2= -\alpha^2 y[/itex] is [itex]y(x)= C cos(\alpha x)+ D sin(\alpha x)[/itex]. [itex]y(0)= C cos(0)+ D sin(0)= C= 0[/itex]. Then [itex]y(2\pi)= Dsin(2\alpha \pi)= 0[/itex].

    Now, either D= 0, in which case we have the trivial solution, or [itex]sin(2\alpha\pi)= 0[/itex] which happens if and only if [itex]2\alpha\pi[/itex] is an integer multiple of [itex]\pi[/itex]. That is [itex]2\alpha= n[/itex] for some integer n. In that case we have the non-trivial solution [itex]y= C sin(nx/2)[/itex]. So [itex]\lambda= -\alpha^2= -n^2/4[/itex] is an eigenvalue, for n any positive integer, with corresponding eigenfunction [itex]sin(nx/2)[/itex].

    (We need only positive integers because sine is an odd function so [itex]Csin((-n)x/2)= -Csin(nx/2)[/itex] and we can incorporate the negative into the constant.)
    Last edited by a moderator: Apr 10, 2014
  10. Apr 11, 2014 #9
    so if I can solve the equation with u(x,0)=0 and [itex]u(0,t)=u(2\pi,t)=e^{0t}[/itex] and solve u(x,0)=cos(x) and [itex]u(0,t)=u(2\pi,t)=0[/itex] and add the solutions together?
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook

Have something to add?
Draft saved Draft deleted