I am trying to run through this example as a learning exercise, but I am not getting the result. Define $$ C_t = \int_k^\infty (s-k)\pi(s)ds $$ Where $\pi$ is some function (that satisfies whatever basic assumptions are necessary) $\pi$ is not actually known, though, so we cannot explicitly integrate this.
The goal (and my question) is to find $$ \frac{dC}{dk} $$
So first I notice that this has $\infty$ as an upper limit, so I rewrite it as $$ C_t = \int_k^b (s-k)\pi(s)ds $$ and, once this is evaluated, I will take the limit of the result as $b\to \infty$.
My attempt is to say that $$ C_t = \int_k^b s\pi(s)ds - \int_k^b k\pi(s)ds $$ Next, letting $$ F(k) = \int_k^b s\pi(s)ds,\; G(k) = \int_k^b k\pi(s)ds\\ f(s) = s\pi(s);\; g(s) = k\pi(s) $$ I thought that the fundamental theorem of calculus (+ chain rule) tells us that $$ \frac{dC}{dk} = [F'(b)\frac{db}{dk} - F'(k)] +[G'(b)\frac{db}{dk} - G'(k)] $$ where $F'(b) = b\pi(b)$, and $G'(b) = k\pi(b)$, $G'(k) = F'(k) = k \pi(k)$.
But then $G'(k)$ cancels with $F'k$ and we get $$(b\pi(b) - k\pi(b))\frac{db}{dk}$$ I have two problems with this: The first is that I have no clue what $\frac{db}{dk}$ is. I feel like it should be $0$ since $b$ is just some upper bound, a constant...
and two: The answer is that $$\frac{dC}{dk} = -\int_k^\infty \pi(s)\cdot ds$$ I never took the limit at the end, so perhaps I would get the infinity upper bound if I did so, but I don't understand how the integral sign remains, now how this result is obtained?