I should maximize the following integral (by determine the optimal time $t_o$)
$C(u)=\int_0^T e^{-rt}(1-u(t))x(t)dt$
with $u(t)=1$ if $t<t_{o}$ and $u(t)=0$ if $t_{o}<t$. under $x´(t)=u(t)x(t)$, $x(0)=x_0>0$. $0<r<1$
This means that the integral from $0$ to $t_o$ is $0$. This problem reduces to
$C(u)=\int_{t_0}^T e^{-rt}x(t)dt$
and if I solve the differential equation then I get $\frac{dx}{x}=u dt$ and with that $x(t)=e^{\int_0^t u dt+c}$ and for $c=log(x_0)$ and for $t>t_o$ is $\int_0^t udt=t_o$. So $x(t)=e^{t_o+log(x_0)}$
Is that correct? How can I determine the optimal time $t_0$?