# Integrating above the x-axis only

I would like to perform a numerical integration between the x-axis and some values.

1st value is x and the second y. My code looks like this:

d={{0., -1.11}, {0.01, 2.22}, {0.02, 0.}, {0.03, -2.22}, {0.04, 2.22}, {0.05, -1.11}, {0.06, -1.11},{0.07, 2.22}, {0.08, 0.}, {0.09, 0.}, {0.1, -1.11}}
dt=0.01

de = Sum[{ (d[[nn + 1, 2]] + d[[nn, 2]])*dt}, {nn, Length[d] - 1}]


How do I integrate only positive values?

• Have you already seen Max[] or Clip[]? Jan 26 at 21:21
• Hi, just wondering, is it possible that there is a $\frac{1}{2}$ missing?
– NG98
Jan 26 at 21:41

maybe you can define the positive part of your function. $$f^+:=\max\{f,0\},$$ and integrate this new function.
de = Sum[