# Thread: Heat equation, using orthogonality conditions

1. ## Heat equation, using orthogonality conditions

The temperature u(x,t) in a thin bar of length 1 satisfies the diffusion equation

d^2u/dx^2 = du/dt.

Bar is insulated at x = 0 and x = 1, meaning du/dx = 0 at both ends. The initial condition is u(0,t) = cos^2(pi x)

I have deduced that u(x,t) = sum from n = 1 to infinity of

A exp(-n^2 pi^2 t) cos (n pi x), but I need help applying the orthogonality condition to obtain my coefficients A.

2. I'm puzzled by your "The initial condition is u(0,t) = cos^2(pi x)". You've plugged in zero for z on the LHS, but not on the RHS. Did you mean "The initial condition is u(x,0) = cos^2(pi x)."? If so, the usual procedure for applying the orthogonality condition is to set your initial condition equal to the solution sum, with t=0 (assuming your work up to now is correct):

$\displaystyle u(x,0)=\sum_{n=1}^{\infty}A_{n}e^{-n^{2}\pi^{2}0}\cos(n\pi x) =\sum_{n=1}^{\infty}A_{n}\cos(n\pi x),$

(note the required dependence on $\displaystyle n$ of the coefficients $\displaystyle A_{n}$), and then multiply through by an orthogonal term:

$\displaystyle u(x,0)\cos(m\pi x)=\sum_{n=1}^{\infty}A_{n}\cos(n\pi x)\cos(m\pi x).$

You then integrate both sides w.r.t. $\displaystyle x$ from $\displaystyle 0$ to $\displaystyle 1$:

$\displaystyle \displaystyle{\int_{0}^{1}\cos^{2}(\pi x)\cos(m\pi x)\,dx=\sum_{n=1}^{\infty}A_{n}\int_{0}^{1}\cos(n\ pi x)\cos(m\pi x)\,dx}.$

You exploit the orthogonality of the cosine functions to simplify the RHS. See what you get when you do all that.

This is standard Fourier analysis, by the way.

Make sense?

$\displaystyle \cos^2 \pi x = \dfrac{1}{2} + \dfrac{1}{2}\cos 2 \pi x$

4. Thanks both of you, yeah sorry Ackbeet I did mean u(x,0) = cos^2(pi x).

Having performed the integral on the left hand side I get a fraction involving 3 terms. The first one has a numerator of sin((m-2)pi*x), the second one sin(m*pi*x) and the third sin((m+2)*pi*x). I can see no way that A_m can possibly be nonzero, yet it must be.

5. After plugging in the limits on the LHS, I get

$\displaystyle \displaystyle{\frac{\sin (\left( m-2 \right) \pi )}{4\left( m-2 \right) \,\pi } + \frac{\sin (m\,\pi )}{2\,m\,\pi } + \frac{\sin (\left( m+2 \right) \,\pi )}{4\,\left( m+2 \right) \,\pi }.}$

For integer values of $\displaystyle m\not=2,$ the last two terms are zero. The singular nature of the first term leads me to believe that that integral might need to be done separately. That is, if I compute the LHS with m=2 from the integral itself, I get this:

$\displaystyle \frac{1}{4}.$

Alternatively, you could actually get this value by taking the limit of the first term as m approaches 0, and you'd get the same thing. It's the well-known limit of (sin(x))/x as x approaches zero.

As for the RHS, all the terms except when $\displaystyle n=m$ are going to disappear. You have to compute that values separately. That should give you all the coefficients. See what you get.