Solution (source code)

= Solution

Write $p=1-R$ and, for a constant bank rate $s$, define
$$
B(s)=s+\frac{(\mu-s)^2}{2R\sigma^2},
\qquad
\gamma(s)=\frac{\rho-pB(s)}{R}.
$$
Assume $\sigma>0$, positive <portfolio wealth>, unrestricted <stock> fractions and the usual nonnegative-wealth admissibility. Once the rate has changed, the model is the <Merton consumption-investment problem> with $s=r$. Put $\gamma_0=\gamma(r)$. In its finite-value regime $\gamma_0>0$, the answer is
$$
\boxed{V_0(w)=\frac{\gamma_0^{-R}w^{1-R}}{1-R},\qquad
\pi_0^*=\frac{\mu-r}{R\sigma^2},\qquad c_t^*=\gamma_0w_t.}
$$
Here $\pi_0^*$ is the fraction of <portfolio wealth> in the <stock>, so the dollar holding is $\pi_0^*w_t$.

The positive-coefficient condition matters: the stated signs of $\rho$ and $R$ alone do not guarantee finite infinite-horizon <expected utility maximization>. If $\gamma_0\leq0$, the unconstrained <Merton consumption-investment problem> has value $+\infty$ for $0<R<1$ and $-\infty$ for $R>1$. The remaining calculation therefore uses $\gamma_0>0$.