# Question on Deriving Heat Equation when thermal conductivity depends on x

The question comes from S. Farlow's book on PDEs and says: Derive the heat equation $$u_t(x,t) = \frac{1}{cp}\frac{\partial}{\partial x}[k(x)u_{x}(x,t)] + f(x,t)$$ , for the situation where the thermal conductivity $k(x)$ depends on $x$.

As in the text, I've done the following:

Net change of heat inside $[x,x+\Delta x]$ = Net flux of heat across boundaries + Total heat generated inside $[x,x+\Delta x]$

$$\textit{Total Heat Inside} [x,x+\Delta x]= cpA \int _{ x}^{x+\Delta x}u(s,t) ds$$

$$\frac{d}{dt} \int _{ x}^{x+\Delta x} c\rho A u(s,t) ds = c\rho A \int _{ x}^{x+\Delta x} u_t(s,t) ds$$ Here is where I made the change $$= A [ k(x+\Delta x)u_x(x+\Delta x,t) - k(x)u_x(x,t)] +A \int _{x}^{x+\Delta x} f(s,t) ds$$

After applying the Mean Value Theorem as in the lecture, I get:

$$c\rho A u_t(\xi_1,t)\Delta x = A[k(x+\Delta x)u_x(x+\Delta x, t) - k(x)u_x(x,t)] + Af(\xi_2,t)\Delta x$$

$$x < \xi < x+\Delta x$$

Thus, I end up with:

$$u_t(\xi,t) = \frac{1}{c\rho} \bigg[ \frac{k(x+\Delta x)u_x(x+\Delta x,t) - k(x)u_x(x,t)} {\Delta x} \bigg] + \frac{ 1}{c\rho}f(\xi,t)$$

Thus, to get to the answer, I am supposed to take $$\Delta x \to 0$$, but I don't see how I can proceed further using what I have above, since I am supposed to have a "$k'(x)u_x(x,t)$" term and a $k(x)u_xx(x,t)$ term from the product rule. Is there anything I am missing? Also, I am noticing the units for the source function are not quite tying out, as I get $\frac{ 1}{c\rho}f(x,t)$, not sure why.

• As $\Delta x\to 0$ the first term on the RHS after "Thus, I end up with" is $\frac{1}{c\rho}\frac{\partial}{\partial x}[k(x)u_x(x,t)]$ by the defintion of the derivative ($g'(x) = \lim_{\Delta x \to 0}\frac{g(x+\Delta x)-g(x)}{\Delta x}$). Isn't this what you are after? – Winther Sep 19 '16 at 3:28
• Right, but don't you have an extra term from the product rule, in the final answer? I don't see how you get that from just looking at it and taking the limit. – LordVader007 Sep 19 '16 at 3:41
• I don't see why you want/need to use the product rule here. Once you have derived the answer you are of course free to use the product rule to write $\frac{d}{dx}[k(x) u_x] = k(x) u_{xx} + k'(x) u_x$. Is this what you mean? – Winther Sep 19 '16 at 3:45
• Yes, that confuses me for some reason. Seeing how that expands out with the product rule, I don't see how it equals after taking limits using the original expression. – LordVader007 Sep 19 '16 at 3:50
• All I can say is that you don't need the product rule. To repeat it: by the definition of the derivative we have that $\frac{d}{dx}(a(x)b(x))$ is just $\lim_{\Delta x \to 0}\frac{a(x+\Delta x)b(x+\Delta x) - a(x)b(x)}{\Delta x}$. This is exacly what you have so the product rule don't enter into the derivation. However as you know the product rule says that this derivative can also be written $a'(x)b(x) + a(x)b'(x)$. Maybe it helps to see a derivation of this result planetmath.org/proofofproductrule from the definition I quoted above. – Winther Sep 19 '16 at 3:57

Now just put $$\frac{k(x+\Delta x)u_x(x+\Delta x,t) - k(x)u_x(x,t)} {\Delta x} = \frac{[k(x+\Delta x)-k(x)]u_x(x+\Delta x,t)+k(x)[u_x(x+\Delta x,t)-u_x(x,t)]}{\Delta x},$$ and take the limit; this recovers the product rule you are looking for.