How to use the implicit function theorem? Consider a gas field with K > 0 cubic meters of gas at the
start of the planning horizon. The price of gas changes over time: one
cubic meter of gas can be sold for $m \cdot exp\{st\}$ euros at time $t$, where $m$ > 0 and $s \in \mathbb{R}$. 
Extracting gas is costly: if the extraction rate at time $t$ is $u$, then the extraction costs amount to $\frac{1}{2}u^2$. The discount rate is $r$ > 0
and it is assumed that $s$ < $r$. 
We are interested in maximizing the total discounted net profits stemming from the gas field by choosing an extraction rate for each moment in time as well as the moment in time when extraction is terminated. 
The probability that an earthquake occurs in the vicinity of the
gas eld becomes very large if the amount of gas in the eld drops
below S $\in$ (0, K) cubic meters. For that reason the government
imposes that the amount of gas in the fieeld must remain at least
S cubic meters. 
In this exercise time is treated as a continuous variable.
I have to do 2 things now:
(1) Derive an implicit expression for the optimal termination time $T^*$.
(2) Prove using the Implicit Function Theorem that the optimal termination time is a decreasing function of S.
I have proven that the optimal termination time is the unique solution of:
\begin{equation}
K-S + \frac{m \cdot exp\{st\}}{r} = m \cdot exp\{st\}T^* + \frac{m \cdot exp\{st\}}{r}e^{-rT^*}
\end{equation}
But how do I prove the second part?

If we differentiate both sides of $K-S + \frac{m e^{st}}{r} = m e^{st}T^*(S) + \frac{m e^{st}}{r}e^{-rT^*(S)}$  with respect to $S$, we get
$-1  = m e^{st} {d T^*(S) \over dS} - m e^{st} e^{-r T^*(S)} {d T^*(S) \over dS}$.
Factoring out ${d T^*(S) \over dS}$ gives
${d T^*(S) \over dS}  = { -1 \over me^{st}(1-e^{-r T^*(S)})} $ and we see
that the right hand side is negative.
