Let $g$ be defined by $$ g(t) = a + b\, t + c\, \mathrm{exp}(-kt), $$ where $a > 0, b < 0, c < 0$ and $0 < k < 1$ (for my use case I have $k = 0.05$). $a$, $b$, and $c$ are chosen such that $0 \leq g(t)$ for $0 \leq t \leq t_{end}$. A specific example plot of such $g$ is shown below
I want to find an $f$ defined by a similar formula $$ f(t) = u + v\, t + w\, \mathrm{exp}(-kt), $$ with $u > 0$, $v < 0$, $w < 0$ and $k$ the same as in $g$, such that:
- $f(t)$ attains its maximum at a fixed value $0 \leq t_{max} \leq t_{end}$,
- $0 \leq f(t) \leq g(t)$ for all $0 \leq t \leq t_{end}$,
- $\int_0^{t_{end}} f(t)dt$ is maximized.
The first property can be satisfied as follows, $$ 0 = \frac{df}{dt}(t_{max}) = v - k\,w\,\mathrm{exp}(-k t_{max}). $$ Solving $w$ we get that $$ f(t) = u + v\,t + \frac{v}{k} \mathrm{exp}(-k(t - t_{max})). $$
This is where I'm stuck. Is it possible to solve $u$ and $v$ given properties 2 and 3? In other words, is it possible to solve $u$ and $v$ algebraically, involving $g$, such that $0 \leq f(t) \leq g(t)$ for all $0 \leq t \leq t_{end}$ such that the area under the curve of $f(t)$ is as large as possible? Could someone give me some leads?
Thank you in advance!
Edit: $t_{max}$, the value where $f$ attains its maximum is a fixed/known value. Note that the value at which $g$ attains its maximum doesn't have to be $t_{max}$. In that case $f \neq g$.
