The following passage is in my textbook:
$$A(S) = \int_0^{\infty} f(E) \max(S-E,0)dE$$
This simplifies to $$A(S) = \int_0^{S} f(E)(S-E) dE$$
Now this is from a finance textbook so it might not be fully rigorous, but I'm curious about what happens with the integral. I think this is an improper integral, and I haven't really studied those yet, but after reading up on them I'm still confused as to what is done here and why it's allowed.
This is because $\max(S - E, 0) = 0$ for $E \geq S$. Alternatively, it is equal to $S - E$ for $E \leq S$.