| sample[a_,b_,n_] := N[Range[a,b,(b-a)/n]]
/. 0->0.0
d[x_List] := Drop[x,1] - Drop[x,-1]
mids[x_List] := (Drop[x,1] + Drop[x,-1])
/ 2
sum[x_List] := Apply[Plus,x]
S[x_List]:=FoldList[Plus, 0.0, x ]
plot[x_List, y_List] := ListPlot[Transpose[{x,y}], PlotJoined ->True] |
A typical sequence to demonstrate
that the derivative of the integral returns the original function
might consist of
x = sample[0,3,100];
y = Exp[-x^2];
Iy = S[mids[y]*d[x]];
DIy = d[Iy]/d[x];
yplot = plot[x,y];
DIplot = plot[mids[x],DIy];
Show[yplot,DIplot]; |