# Solving non-homogeneous heat eq'n with fourier series

1. Oct 20, 2009

### wakko101

1. The problem statement, all variables and given/known data
The heat eq'n is Ut -4Uxx = 2t - xsin(x)
Ux(0,t) = Ux(pi,t) = 0, U(x,0)=x^2+1

2. Relevant equations
Using separation of variables, in obtaining the eigenvalues/eigenfunctions of X''=-lambdaX, it would appear that you would need to use a cosine series basis and expand the equation. But it seems to me that the xsin(x) on the RHS of the equation is causing problems and I'm not sure how to proceed.

3. The attempt at a solution

If you expand the RHS as a cosine fourier series, the coefficients would be given by int(0 to pi)(2t + xsin(x))cos(nx) dx. I'm stumped....any suggestions/hints would be appreciated.

Cheers. =)

2. Oct 20, 2009

### HallsofIvy

Staff Emeritus
Yes, that's right:
$$\int_0^\pi (2t+ x sin(x)cos(nx))dx[/itex] (except for the normalizing factor in front) What is the problem? Of course, t is a constant here so the first part is just 2t = 2t cos(0x). the second part, [tex]\int_0^\pi x sin(x)cos(nx)dx$$
you should be able to do with integration by parts. Let u= x, dv= sin(x)cos(nx)dx.

3. Oct 20, 2009

### wakko101

I had thought of that. I suppose I'm not sure how to go about integrating dv=sin(x)cos(nx).