# Application of Leibniz's Integral Rule

Consider the following image showing the temperature of a metal pipe: The temperature $$T(z,t)$$ is a function of the length coordinate $$z$$ and time $$t$$. Integrating the partial derivative of $$T$$ with respect to $$t$$, $$\frac{\partial T}{\partial t}$$ over the entire length of the pipe (from $$z=a$$ to $$z=b$$) and applying Leibniz's rule, we should get $$\int_{z=a}^{z=b}\frac{\partial}{\partial t}T(z,t)dz=\frac{d}{dt}\int_{z=a}^{z=b}T(z,t)dz-T(b,t)\frac{db}{dt}+T(a,t)\frac{da}{at}.$$ In a paper (eqs. (21) and (22)), the result is reported as follows: $$\int_{z=a}^{z=b}\frac{\partial}{\partial t}T(z,t)dz=(b-a)\frac{d}{dt}T_\mathrm{avg}(t)+\big(T(a,t)-T_\mathrm{avg}(t)\big)\frac{da}{dt}+\big(T_\mathrm{avg}(t)-T(b,t)\big)\frac{db}{dt},$$ where $$T_\mathrm{avg}(t)=\frac{1}{2}\big(T(a,t)+T(b,t)\big).$$ Are the two equivalent? If not, which one is correct? I'm not able to see the equivalence, or understand how the second result could be valid. Any help and elaboration will be greatly appreciated!

Note: The integral in this question is only a portion of a larger integration problem in the energy balance, not reported for brevity. Equations (21) and (22) in the reference describe the complete energy balance.

I don't see it either. What is always true is$$\newcommand{\avg}{\text{avg}}$$ \begin{align} \int_a^b \partial_t T dz &= \int_a^b \partial_t T_{\avg} dz + \int_a^b \partial_t (T-T_{\avg}) dz \\ &= \int_a^b \partial_t T_{\avg} dz + \frac{d}{dt}\int_a^b(T-T_\avg)dz -(T(a)-T_\avg)\frac{da}{dt} + (T(b)-T_\avg)\frac{db}{dt} \end{align} The last two terms appear in what you want. Further, $$\partial_t T_\avg$$ does not depend on $$z$$, so $$\int_a^b \partial_t T_{\avg} dz = (b-a) \partial_t T_{\avg}.$$ So, ignoring the notation choice of $$\partial_t$$ vs $$d/dt$$, it seems that we need $$\frac{d}{dt}\int_a^b(T-T_\avg)dz = 0$$ Perhaps this is something implied by what previously appears in the paper. I can't decipher the notation of the paper, and can't deduce what you wrote from (21), (22) so I hope you can finish from here.

• The problem posed is not exactly as it appears in the paper, but only a part was extracted and modified to ask the question. I'm having difficulty relating your notation to mine, so could you please update your notation to the one in the question. Thanks! Sep 4 '20 at 3:03
• @Adeel I don't see any difference in notation between your question and my answer? If you point out which thing you can't read, I'll gladly explain Sep 4 '20 at 3:11
• I see it now. Shouldn't the $T$ in the 2nd and 3rd terms in second equality (right side) be denoted $T(a,t)$ and $T(b,t)$ to differentiate it from the first integral term's $T$, which should be $T(z,t)$? It would make it easier to understand for a novice like me. The second part of your solution makes sense; the derivative or the integral term going to zero would lead to the desired expression. Could the mean value theorem as in this video: youtube.com/watch?v=wkh1Y7R1sOw&feature=youtu.be be applied to reach that conclusion? Watch from 6:50. I'm unsure if it could. Sep 4 '20 at 16:50
• As you suggested, it turns out $\int_a^b(T(z,t)-T_\mathrm{avg}(t))dz\approx 0$ if $T(z,t)$ is assumed to vary (approximately) linearly from $a$ to $b$ over $z$, which, in this particular application, could be reasonable to assume of the pipe's temperature. Sep 4 '20 at 18:03

This answer is based on the original answer by Calvin Khor. Some supplemental details relevant to the problem are added.

Referring to the original problem, let $$T(z,t)$$ vary with $$z$$ as shown in the following figure: As proposed in the original solution, integrating integral of the partial derivative of $$T$$ from $$a$$ to $$b$$ and applying Leibniz's Rule: \begin{align} \int_{a}^{b}\frac{\partial}{\partial t}T(z,t)dz&=\int_{a}^{b}\frac{\partial}{\partial t}\big(T(z,t)-T_\mathrm{avg}(t)+T_\mathrm{avg}(t)\big)dz\\ &=\int_{a}^{b}\frac{\partial}{\partial t}T_\mathrm{avg}(t)dz + \underbrace{\int_{a}^{b}\frac{\partial}{\partial t}\big(T(z,t)-T_\mathrm{avg}(t)\big)dz}_\text{apply Leibniz Rule}\\ &=(b-a)\frac{d}{dt}T_\mathrm{avg}(t)\\ &\quad+\underbrace{\frac{d}{dt}\int_{a}^{b}\big(T(z,t)-T_\mathrm{avg}(t)\big)dz+\big(T(a,t)-T_\mathrm{avg}(t)\big)\frac{da}{dt}+\big(T_\mathrm{avg}(t)-T(b,t)\big)\frac{db}{dt}.}_\text{Leibniz's Rule applied} \end{align}

The area under the curve in the figure (shaded green) can be found using the integral $$\int_{a}^{b}T(z,t)dz$$. Approximating the curve with a straight line, we can write

\begin{align} \int_{a}^{b}T(z,t)dz&\approx\underbrace{\frac{1}{2}(b-a)\big(T(b,t)-T(a,t)\big)}_\text{area of top triangle}+\underbrace{T(a,t)(b-a)}_\text{area of bottom rectangle}\\ &=\frac{1}{2}\big(T(a,t)+T(b,t)\big)(b-a)=(b-a)T_\mathrm{avg}(t). \end{align}

Thus, the second term in the third equality of the first equation vanishes, and the desired result is obtained: $$\int_{a}^{b}\frac{\partial}{\partial t}T(z,t)dz\approx(b-a)\frac{d}{dt}T_\mathrm{avg}(t)+\big(T(a,t)-T_\mathrm{avg}(t)\big)\frac{da}{dt}+\big(T_\mathrm{avg}(t)-T(b,t)\big)\frac{db}{dt}.$$