The question is as follows: solve using the method of eigenfunction expansion $$c\rho \frac{\partial u}{\partial t} = \frac{\partial u}{\partial x}\left(K_0\frac{\partial u}{\partial x} \right) + Q(x,t)$$ With boundary condition $u(0, t)=u(L,t)=0$ and initial condition $u(x, 0)=g(x)$
Additionally, $c, \rho, K_0$ are all functions of $x$
For eigenfunction expansion, we use $ u(x, t) = \sum{a_n(t)\sin\left(\frac{n\pi x}{L}\right)}$, so I substituted that into the partial equation, getting
$$ c \rho \frac{\partial a_n}{\partial t}=\frac{\partial}{\partial x}\left(K_0 a_n(t) \frac{n \pi}{L}\cos\frac{n\pi x}{L}\right) + Q(x, t)$$
Then I tried multiplying both sides by $\sin\left(\frac{n\pi x}{L}\right) $ and integrating from $0$ to $L$
$$ \frac{2}{L} \frac{\partial a_n}{\partial t} \int c \rho \sin\left(\frac{n\pi x}{L}\right) dx = -a_n(t) \left(\frac{n \pi}{L}\right)^2 \frac{2}{L} \int(K_0)\sin\left(\frac{n\pi x}{L}\right)\sin\left(\frac{n\pi x}{L}\right) dx + a_n(t) \frac{n\pi}{L} \frac{2}{L} \int \cos\left(\frac{n\pi x}{L} \right)\sin\left(\frac{n\pi x}{L}\right) \frac{\partial K_0}{\partial x}dx + \frac{2}{L} \int Q(x, t)\sin\left(\frac{n\pi x}{L}\right)dx $$
I then swapped the $\sin^2$ for $(1-\cos)/2$, and the $\sin\cos$ for $\sin2$, and tried integrating by parts for both of those terms once, and did not get anywhere.
This is starting to look very complicated, and I'm wondering
Is this the correct approach? and
If this is the correct approach, is there some way of solving these integrals very easily?
- How do I then go about finding a Green's function for this?