678 CHAPTER 34. SOME PARTIAL DIFFERENTIAL EQUATIONS
Then, as above, bn = 0 and an must be chosen such that
f (x) =∞
∑n=1
an sin(nπx
4
)Thus
an =24
∫ 3
1
(1− (x−2)2
)sin(nπx
4
)dx
Then after doing the hard work, you end up with
an =−164cos 3
4 nπ +nπ sin 34 nπ−4cos 1
4 nπ +nπ sin 14 nπ
n3π3
Then the solution is
u(x, t) =∞
∑n=1
(−16
4cos 34 nπ +nπ sin 3
4 nπ−4cos 14 nπ +nπ sin 1
4 nπ
n3π3
)·
cos(
αnπ
4t)
sin(nπx
4
)Let α = .5 to give a specific example. Here is a graph of the function of two variablesin which the sum is taken up to n = 6. The t axis goes from 0 to 10 and if you fix t andimagine a cross section, it will be x→ u(x, t).
-1
0
0
1
5 4210 0
34.3 Nonhomogeneous ProblemsFor the sake of completeness, here is a brief discussion of what can be done if you have anonhomogeneous equation of the form ut = auxx + f along with an initial condition
u(x,0) = g(x)
and boundary conditions. As before, there are eigenfunctions yn satisfying the boundaryconditions and
y′′n =−λ2nyn, lim
n→∞λ n = ∞
such that also ∫ L
0yn (x)ym (x)dx = δ nm =
{1 if n = m0 if n ̸= m