$\newcommand{\expq}[1]{{e^{#1}}}$ $\newcommand{\integral}[4]{\int_{#2}^{#3} {#4} \,d{#1}}$ $\newcommand{\dd}[2]{\frac{d #1}{d #2}}$ $\newcommand{\loss}{L}$ Suppose we want to draw the function $\expq{-kt}$ between 0 and $x$ by approximating it with a polygon. What we want to do is to repeatedly subdivide each section of the function into with a vertex at some point that minimizes the area between the approximation and the true value. The subdivision point we are looking for is $(m, \expq{-km})$ where $0<m<x$.
The loss is the absolute difference of the true value with the polygonal approximation. Since the true value is always below the polygon, the first part of this loss is: \begin{align} f(k, m) &= \integral{t}{0}{m}{1 + \frac{\expq{-km}-1}{m}t - \expq{-kt}} \\ &= m + \frac{\expq{-km}-1}{2m}m^2 - \frac{\expq{-km}-1}{-k} \\ &= m + \frac{\expq{-km}-1}{2}m + \frac{\expq{-km}-1}{k} \\ &= \frac12 m\expq{-km} + \frac1k \expq{-km} + \frac{m}{2} - \frac{1}{k}. \end{align}
The second part is \begin{align} \expq{-km}f(k, x-m) &= \expq{-km}\left(\frac12 (x-m)\expq{-k(x-m)} + \frac1k \expq{-k(x-m)} + \frac{x-m}{2} - \frac{1}{k}\right) \\ &= \frac12 (x-m)\expq{-kx-2km} + \frac1k \expq{-kx-2km} + \frac{x-m}{2}\expq{-km} - \frac{\expq{-km}}{k}. \end{align} The loss is the sum of these terms: \begin{align} \loss &= \frac12 m\expq{-km} + \frac1k \expq{-km} + \frac{m}{2} - \frac{1}{k} + \frac12 (x-m)\expq{-kx-2km} + \frac1k \expq{-kx-2km} + \frac{x-m}{2}\expq{-km} - \frac{\expq{-km}}{k} \\ &= \frac{m}{2} - \frac{1}{k} - \frac{m}2 \expq{-kx-2km} + \left(\frac1k+\frac{x}{2}\right) \expq{-kx-2km} + \frac{x}{2}\expq{-km}. \end{align}
Then \begin{align} 0 &= \dd{\loss}{m} \\ &= \frac{1}{2} - \frac{1}2 \expq{-kx-2km} - \frac{-2km}2 \expq{-kx-2km} -2k\left(\frac1k+\frac{x}{2}\right) \expq{-kx-2km} - \frac{kx}{2}\expq{-km} \\ &\Downarrow \notag \\ &= 1 - \expq{-kx-2km} + 2km \expq{-kx-2km} - 4k\left(\frac1k+\frac{x}{2}\right) \expq{-kx-2km} - {kx}\expq{-km} \\ &= 1 - 5\expq{-kx-2km} + 2km \expq{-kx-2km} - {2kx} \expq{-kx-2km} - {kx}\expq{-km}. \end{align}
I'm having trouble minimizing this w.r.t. $m$. Intuitively, $m = xg(kx)$ where $g$ is some unknown function.