Solution (source code)

= Solution

Assume $r>0$, put $b=S^\star\in(0,K)$ and let $\tau_b=\inf\{u\geq0:S_u\leq b\}$. In the continuation region $S>b$, the time-independent <Black-Scholes equation> is a <Cauchy-Euler equation>. Substituting $V=S^m$ gives
$$
\frac12\sigma^2m(m-1)+rm-r=(m-1)\left(\frac12\sigma^2m+r\right)=0.
$$
Set $\gamma=2r/\sigma^2>0$. The two powers are $S$ and $S^{-\gamma}$. The <boundary condition> $V(S)\to0$ as $S\to\infty$ removes the growing solution; value matching at $b$ sets the coefficient. Hence the fixed-trigger value is
$$
\boxed{V_b(S)=(K-b)^n(S/b)^{-\gamma},\qquad S>b}.
$$
For $0\leq S\leq b$ the policy exercises immediately, giving $V_b(S)=(K-S)^n$. The quoted continuation expression alone does not apply below the exercise boundary. Equivalently, the <discounted boundary-hitting representation> gives $\mathbb E_S[e^{-r\tau_b};\tau_b<\infty]=(S/b)^{-\gamma}$, which multiplies the exercise <financial payoff>.