I am not entirely sure how the derivative follows from the preceding line in this example.
$f(x)$ is a PDF. You are supposed to set the derivative to 0 as the expectation needs to be minimised.
Could someone please explain a bit?
$$ C_t(X) = \begin{cases} c(t-X), & \text{if }\ X \le t \\ k(X-t), & \text{if }\ X \ge t \end{cases} $$
$$ E[C_t(X)] = ct\int_0^tf(x)dx \ -c\int_0^txf(x)dx \ +k\int_t^\infty xf(x)dx \ -kt\int_t^\infty f(x)dx\ $$
$$ \cfrac {d}{dt}E[C_t(X)] = ctf(t) \ + cF(t) \ -ctf(t) \ -ktf(t) \ +ktf(t) \ - k[1-F(t)] $$
I have only managed to get the first half of the derivative so far.
$$ ct\int_0^tf(x)dx = ctF(t) \ - \ ctF(0) $$
Since the function is a CDF, it evaluates to 0 at 0 for this distribution. So by differentiating and using the product rule we get:
$$ \cfrac{d}{dt}ctF(t)=ctf(t) +cF(t) $$
For the next part: $$ -c \int_0^t xf(x)dx = -c[xF(x)|_0^t \ - \ \int_0^tF(x)] $$ The derivative will be: $$ -c[tf(t)+F(t)-F(t)] \ = \ -ctf(t) $$
Im not sure how to proceed from here, since the upper limit is infinite for the next two integrals. I get stuck when I have to evaluate the function after using integration by parts because of the upper limit.