I was trying to answer this question: $\frac{\mathrm d}{\mathrm dt}\int_{t-\mathrm d1}^t \int_h^t f(s) \,\mathrm ds\,\mathrm dh$. I got the accepted answer by hand (using the Leibniz integral rule) but why does Mathematica (and Maple) give the seemingly wrong $\mathrm d_{{1}}f \left( t \right) \color{orange}{-}\int_{t-\mathrm d_{{1}}}^{t}\!f \left( s \right) \,{\rm d}s=\mathrm d_{{1}}f \left( t \right) \color{orange}{-}F \left( t \right) \color{orange}{+} F \left( t-\mathrm d _{{1}} \right)$ instead of $\mathrm d_{{1}}f \left( t \right) \color{lime}{+}\int_{t-\mathrm d_{{1}}}^{t}\!f \left( s \right) \,{\rm d}s=\mathrm d_{{1}}f \left( t \right) \color{lime}{+}F \left( t \right) \color{lime}{-} F \left( t-\mathrm d _{{1}} \right)$
The Mathematica code I used is D[Integrate[Integrate[f[s], {s, h, t}], {h, t - d1, t}], t]
.
D[Integrate[f[s], {h, t - d1, t}, {s, h, t}], t]
- you don't need to writeIntegrate
twice. $\endgroup$Derivative[]
:D[Integrate[Derivative[-1][f][t] - Derivative[-1][f][h], {h, t - d1, t}], t]
. $\endgroup$