Here's the probability (I think) that a particle in Brownian motion (w/ standard deviation $\sqrt{t}$) will exceed $m$ between times $t_1$ and $t_2$:
$$\frac1{2\sqrt{2\pi}}\int_{-\infty }^m \frac1{\sqrt{t_1}}e^{-\frac{x^2}{2t_1}}\left(1+\mathrm{erf}\left(\frac{m-x}{2\sqrt{t_2-t_1}}\right)\right)\mathrm{d}x$$
or, in Mathematica (slightly different form):
p[m_,t1_,t2_] := Integrate[
PDF[NormalDistribution[0,Sqrt[t1]]][x]*
CDF[NormalDistribution[x, Sqrt[2]*Sqrt[t2-t1]]][m],
{x,-Infinity,m}, Assumptions -> {
t2 >= t1 >= 0, Element[m,Reals], Element[t2, Reals], Element[t1, Reals]}
]
Mathematica can numerically integrate this for specific values of m,
t1, and t2, but it's not superfast.
I now want to find the partial derivatives of p[] with respect to each
of its variables. Ideally in closed-form (Mathematica can't find one),
but a good approximation if not.
I've tried power series and a few other techniques, but I've found
nothing good enough for a wide range of values for m, t1, and t2.
Solving this problem will calculate the "Greeks" for box options:
https://money.stackexchange.com/questions/4312/calculating-fair-value-of-an-oanda-com-box-option
In view of your previous post, the probability you are considering is actually $$ \bar P(m,t_1,t_2) = 1 - \frac{1}{{\sqrt {2\pi t_1 } }}\int_{ - \infty }^m {{\rm erf}\bigg(\frac{{m - x}}{{2\sqrt {t_2 - t_1 } }}\bigg)e^{ - x^2 /(2t_1 )} {\rm d}x},\;\; m \in {\bf R}. $$ This is the complement of the probability considered in your previous post. So, we may consider instead the partial derivatives of $$ P(m,t_1,t_2) = \frac{1}{{\sqrt {2\pi t_1 } }}\int_{ - \infty }^m {{\rm erf}\bigg(\frac{{m - x}}{{2\sqrt {t_2 - t_1 } }}\bigg)e^{ - x^2 /(2t_1 )} {\rm d}x}. $$ Now, erf(x) has derivative ${\rm erf}'(x)= \frac{2}{{\sqrt \pi }}e^{ - x^2 }$, $x > 0$. Then, the partial derivative with respect to $t_2$ is obtained as follows: $$ \frac{{\partial}}{{\partial t_2 }}P(m,t_1 ,t_2 ) = \frac{1}{{\sqrt {2\pi t_1 } }}\int_{ - \infty }^m {\frac{\partial }{{\partial t_2 }}{\rm erf}\bigg(\frac{{m - x}}{{2\sqrt {t_2 - t_1 } }}\bigg)e^{ - x^2 /(2t_1 )} {\rm d}x}, $$ and explicitly, $$ \frac{{\partial}}{{\partial t_2 }}P(m,t_1 ,t_2 ) = \frac{{ - 1}}{{\sqrt {8 \pi ^2 t_1 (t_2 - t_1 )^3 } }}\int_{ - \infty }^m {\exp \bigg[ - \frac{{(m - x)^2 }}{{4(t_2 - t_1 )}} - \frac{{x^2 }}{{2t_1 }}\bigg](m - x){\rm d}x}. $$ (The probability that the maximum is smaller than $m$ decreases as $t_2$ increases, hence the minus sign in this equation.) To find the partial derivative with respect to $m$ corresponds to taking the derivative of a convolution, according to the rule $(f * g)' = f' * g$. Specifically, this says that $$ \frac{{\partial}}{{\partial m }}P(m,t_1 ,t_2 ) = \frac{1}{{\sqrt {2\pi t_1 } }}\int_{ - \infty }^m {\frac{\partial }{{\partial m }}{\rm erf}\bigg(\frac{{m - x}}{{2\sqrt {t_2 - t_1 } }}\bigg)e^{ - x^2 /(2t_1 )} {\rm d}x}, $$ and explicitly, $$ \frac{{\partial}}{{\partial m }}P(m,t_1 ,t_2 ) = \frac{{1}}{{\sqrt {2 \pi ^2 t_1 (t_2 - t_1 ) } }}\int_{ - \infty }^m {\exp \bigg[ - \frac{{(m - x)^2 }}{{4(t_2 - t_1 )}} - \frac{{x^2 }}{{2t_1 }}\bigg]{\rm d}x}. $$ Maybe you can simplify further. The partial derivative with respect to $t_1$ is apparently a quite complicated expression.