Solution (source code)

= Solution

Let $\phi_T(y)=(2\pi T)^{-1/2}e^{-y^2/(2T)}$ be the <normal distribution> density. The <Brownian reflection principle> gives the killed endpoint density
$$
\mathbb P(W_T\in dy,\ \sup_{s\leq T}W_s<a)
=[\phi_T(y)-\phi_T(y-2a)]\,dy,\qquad y<a.
$$
Indeed, reflection after the first hit of $a$ maps paths ending below $a$ that have hit the barrier to paths ending at $2a-y$; symmetry gives $\phi_T(2a-y)=\phi_T(y-2a)$.

By the <Girsanov theorem>, weighting the path law by $\exp(\nu W_T-\nu^2T/2)$ makes the coordinate process a <Brownian motion with drift> $\nu$. Completing the two squares yields
$$
e^{\nu y-\nu^2T/2}[\phi_T(y)-\phi_T(y-2a)]
=\phi_T(y-\nu T)-e^{2a\nu}\phi_T(y-2a-\nu T).
$$
Integration up to $x\leq a$ proves the <joint endpoint and maximum law for drifted Brownian motion>:
$$
\boxed{\mathbb P(W_T^\nu\leq x,M_T^\nu<a)
=\Phi\left(\frac{x-\nu T}{\sqrt T}\right)
-e^{2a\nu}\Phi\left(\frac{x-2a-\nu T}{\sqrt T}\right).}
$$
Here $\Phi$ is the <standard normal distribution function>. Setting $x=a$ also gives a continuous barrier distribution, so equality at the barrier has zero <probability>.

For the <up-and-in option>, use the <risk-neutral measure> of the <Black-Scholes model> with <interest rate> $\rho$ and <spot volatility> $\sigma>0$. Then
$$
S_t=S_0e^{\sigma(W_t+\nu t)},\qquad
\nu=\frac{\rho-\sigma^2/2}{\sigma},\qquad
a=\frac{\log(b/S_0)}{\sigma}>0.
$$
Above $a$, the barrier has certainly been reached. Below $a$, subtracting the killed density from the unrestricted endpoint density leaves $e^{2a\nu}\phi_T(y-2a-\nu T)$. Thus the discounted <expected value> of its payoff is
$$
e^{-\rho T}\left[\int_a^\infty f(S_0e^{\sigma y})\phi_T(y-\nu T)\,dy
+e^{2a\nu}\int_{-\infty}^a f(S_0e^{\sigma y})\phi_T(y-2a-\nu T)\,dy\right].
$$
In the second integral put $z=y-2a$, and define
$$
\boxed{\kappa=e^{-2\sigma a}=\left(\frac{S_0}{b}\right)^2.}
$$
Then $S_0e^{\sigma y}=S_0e^{\sigma z}/\kappa$, $z\leq-a$ means $S_0e^{\sigma z}\leq\kappa b$, and $e^{2a\nu}=\kappa^{-\nu/\sigma}$. Both integrals now use the unrestricted terminal <stock> distribution. This proves that the <reflected European payoff for an up-and-in option> is
$$
\boxed{g(x)=f(x)\mathbf1_{\{x>b\}}+\kappa^{-\nu/\sigma}f(x/\kappa)\mathbf1_{\{x\leq\kappa b\}}.}
$$
Their initial <risk-neutral pricing> values agree for payoffs with finite absolute expectations in these integrals. The identity concerns prices; the two terminal payoffs need not agree along individual paths.