Solution for the One-dimensional Diffusion Equation
The coefficient
An is in turn determined from the initial condition. We require
u(x,0)=g(x)=∞∑n=1Ansin(nπx/L).
The coefficient
An is the Fourier coefficients for the function
g(x). Because of this,
An is given by (from the theory on Fourier series)
An=2L∫L0g(x)sin(nπx/L)dx.
Different
g(x) functions will obviously result in different results for
An.