# Yet Another Differential Equations Problem

I come from a non mathematical background, so solving differential equations is something that I have to acquire on the go. I hope the following makes sense.

I want to chose a nonnegative depreciation rate $f$ for $x$ for any point between $0, T$ such that I maximize some instantaneous objective function $g(x)$, increasing and concave, given that I arrive at $\bar x$ in $T$. Would the following way be a correct one to write that up?

$$G(x_0) = max_{f\in F} \int_0^T e^{-\rho t}g(x(t)) dt \\ \text{s.t. } \dot x(t) = -f(t)x(t)\\ x(0) = x_0 \\ x(T) = \bar x$$

For a given constant $\bar x$, and concave increasing $g \in \mathcal C^1$. I define $F$ to be the set of measurable functions from $[0, T] \rightarrow R^+$.

Second, how would I try to solve this? If it were an infinite horizon, I would try to write it up as a HJB of the form $\rho F(x) = g(x) + F'(x)\dot x$, but that's not the case here.

Given that I have a finite horizon, I assume I should start at $G(x(T))$ and somehow go backwards, but I'm not really sure how. I appreciate hints at both solving this with pen&paper and numerically.

Actually, after thinking more about the problem, I'm not even sure that a maximum exists. $g$ strictly increases in $x$, and we are only constrained to reach a level of $x$ in the end. Moreover, the functions in $F$ have a unbounded image. Hence, it is always improving $G(x)$ if we "delay" the depreciation a bit, by decreasing $f(t)$ and increasing $f(t+\epsilon)$. Since there is no bound on how much "depreciation" can happen at one point in time, this strategy is always feasible.