BlackScholesGamma - Maple Help

# Online Help

###### All Products    Maple    MapleSim

Finance

 BlackScholesGamma
 compute the Gamma of a European-style option with given payoff

 Calling Sequence BlackScholesGamma(${S}_{0}$, K, T, sigma, r, d, optiontype) BlackScholesGamma(${S}_{0}$, P, T, sigma, r, d)

Parameters

 ${S}_{0}$ - algebraic expression; initial (current) value of the underlying asset K - algebraic expression; strike price T - algebraic expression; time to maturity sigma - algebraic expression; volatility r - algebraic expression; continuously compounded risk-free rate d - algebraic expression; continuously compounded dividend yield P - operator or procedure; payoff function optiontype - call or put; option type

Description

 • The Gamma of an option or a portfolio of options is the sensitivity of the Delta to changes in the value of the underlying asset

$\mathrm{Gamma}=\frac{{\partial }^{2}}{\partial {{S}_{0}}^{2}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}S$

 • The BlackScholesGamma command computes the Gamma of a European-style option with the specified payoff function.
 • The parameter ${S}_{0}$ is the initial (current) value of the underlying asset. The parameter T is the time to maturity in years.
 • The parameter K specifies the strike price if this is a vanilla put or call option. Any payoff function can be specified using the second calling sequence. In this case the parameter P must be given in the form of an operator, which accepts one parameter (spot price at maturity) and returns the corresponding payoff.
 • The sigma, r, and d parameters are the volatility, the risk-free rate, and the dividend yield of the underlying asset. These parameters can be given in either the algebraic form or the operator form.  The parameter d is optional. By default, the dividend yield is taken to be 0.

Examples

 > $\mathrm{with}\left(\mathrm{Finance}\right):$

First you compute the Gamma of a European call option with strike price 100, which matures in 1 year. This will define the Gamma as a function of the risk-free rate, the dividend yield, and the volatility.

 > $\mathrm{BlackScholesGamma}\left(100,100,1,\mathrm{\sigma },r,d,'\mathrm{call}'\right)$
 $\frac{\sqrt{{2}}{}{{ⅇ}}^{{-}\frac{{{\mathrm{\sigma }}}^{{4}}{+}{4}{}{d}{}{{\mathrm{\sigma }}}^{{2}}{+}{4}{}{r}{}{{\mathrm{\sigma }}}^{{2}}{+}{4}{}{{d}}^{{2}}{-}{8}{}{d}{}{r}{+}{4}{}{{r}}^{{2}}}{{8}{}{{\mathrm{\sigma }}}^{{2}}}}}{{200}{}{\mathrm{\sigma }}{}\sqrt{{\mathrm{\pi }}}}$ (1)

In this example you will use numeric values for the risk-free rate, the dividend yield, and the volatility.

 > $\mathrm{BlackScholesGamma}\left(100,100,1,0.3,0.05,0.03,'\mathrm{call}'\right)$
 ${0.01260567542}$ (2)

You can also use the generic method in which the option is defined through its payoff function.

 > $\mathrm{BlackScholesGamma}\left(100,t↦\mathrm{max}\left(t-100,0\right),1,\mathrm{\sigma },r,d\right)$
 $\frac{\sqrt{{2}}{}{{ⅇ}}^{{-}\frac{{{\mathrm{\sigma }}}^{{4}}{+}{4}{}{d}{}{{\mathrm{\sigma }}}^{{2}}{+}{4}{}{r}{}{{\mathrm{\sigma }}}^{{2}}{+}{4}{}{{d}}^{{2}}{-}{8}{}{d}{}{r}{+}{4}{}{{r}}^{{2}}}{{8}{}{{\mathrm{\sigma }}}^{{2}}}}}{{200}{}{\mathrm{\sigma }}{}\sqrt{{\mathrm{\pi }}}}$ (3)
 > $\mathrm{BlackScholesGamma}\left(100,t↦\mathrm{max}\left(t-100,0\right),1,0.3,0.05,0.03\right)$
 ${0.01260567513}$ (4)
 > $\mathrm{BSGamma}≔\mathrm{expand}\left(\mathrm{BlackScholesGamma}\left(100,100,1,\mathrm{\sigma },r,0.03,'\mathrm{call}'\right)\right)$
 ${\mathrm{BSGamma}}{≔}\frac{{0.001965014020}{}{{ⅇ}}^{{-}{0.1249999999}{}{{\mathrm{\sigma }}}^{{2}}}{}{{ⅇ}}^{{-}{0.4999999997}{}{r}}{}{{ⅇ}}^{{-}\frac{{0.4999999997}{}{{r}}^{{2}}}{{{\mathrm{\sigma }}}^{{2}}}}{}{{ⅇ}}^{\frac{{0.02999999998}{}{r}}{{{\mathrm{\sigma }}}^{{2}}}}{}{{ⅇ}}^{{-}\frac{{0.0004499999997}}{{{\mathrm{\sigma }}}^{{2}}}}}{{\mathrm{\sigma }}}{+}\frac{{0.0001179008410}{}{{ⅇ}}^{{-}{0.1249999999}{}{{\mathrm{\sigma }}}^{{2}}}{}{{ⅇ}}^{{-}{0.4999999997}{}{r}}{}{{ⅇ}}^{{-}\frac{{0.4999999997}{}{{r}}^{{2}}}{{{\mathrm{\sigma }}}^{{2}}}}{}{{ⅇ}}^{\frac{{0.02999999998}{}{r}}{{{\mathrm{\sigma }}}^{{2}}}}{}{{ⅇ}}^{{-}\frac{{0.0004499999997}}{{{\mathrm{\sigma }}}^{{2}}}}}{{{\mathrm{\sigma }}}^{{3}}}{-}\frac{{0.003930028034}{}{r}{}{{ⅇ}}^{{-}{0.1249999999}{}{{\mathrm{\sigma }}}^{{2}}}{}{{ⅇ}}^{{-}{0.4999999997}{}{r}}{}{{ⅇ}}^{{-}\frac{{0.4999999997}{}{{r}}^{{2}}}{{{\mathrm{\sigma }}}^{{2}}}}{}{{ⅇ}}^{\frac{{0.02999999998}{}{r}}{{{\mathrm{\sigma }}}^{{2}}}}{}{{ⅇ}}^{{-}\frac{{0.0004499999997}}{{{\mathrm{\sigma }}}^{{2}}}}}{{{\mathrm{\sigma }}}^{{3}}}{-}\frac{{0.0001179008410}{}{{ⅇ}}^{{-}{0.5000000002}{}{r}}{}{{ⅇ}}^{{-}\frac{{0.0004499999998}}{{{\mathrm{\sigma }}}^{{2}}}}{}{{ⅇ}}^{\frac{{0.02999999998}{}{r}}{{{\mathrm{\sigma }}}^{{2}}}}{}{{ⅇ}}^{{-}\frac{{0.4999999997}{}{{r}}^{{2}}}{{{\mathrm{\sigma }}}^{{2}}}}{}{{ⅇ}}^{{-}{0.1249999999}{}{{\mathrm{\sigma }}}^{{2}}}}{{{\mathrm{\sigma }}}^{{3}}}{+}\frac{{0.003930028033}{}{r}{}{{ⅇ}}^{{-}{0.5000000002}{}{r}}{}{{ⅇ}}^{{-}\frac{{0.0004499999998}}{{{\mathrm{\sigma }}}^{{2}}}}{}{{ⅇ}}^{\frac{{0.02999999998}{}{r}}{{{\mathrm{\sigma }}}^{{2}}}}{}{{ⅇ}}^{{-}\frac{{0.4999999997}{}{{r}}^{{2}}}{{{\mathrm{\sigma }}}^{{2}}}}{}{{ⅇ}}^{{-}{0.1249999999}{}{{\mathrm{\sigma }}}^{{2}}}}{{{\mathrm{\sigma }}}^{{3}}}{+}\frac{{0.001965014018}{}{{ⅇ}}^{{-}{0.5000000002}{}{r}}{}{{ⅇ}}^{{-}\frac{{0.0004499999998}}{{{\mathrm{\sigma }}}^{{2}}}}{}{{ⅇ}}^{\frac{{0.02999999998}{}{r}}{{{\mathrm{\sigma }}}^{{2}}}}{}{{ⅇ}}^{{-}\frac{{0.4999999997}{}{{r}}^{{2}}}{{{\mathrm{\sigma }}}^{{2}}}}{}{{ⅇ}}^{{-}{0.1249999999}{}{{\mathrm{\sigma }}}^{{2}}}}{{\mathrm{\sigma }}}$ (5)
 > $\mathrm{plot3d}\left(\mathrm{BSGamma},\mathrm{\sigma }=0..1,r=0..1,\mathrm{axes}=\mathrm{BOXED}\right)$

Here are similar examples for the European put option.

 > $\mathrm{BlackScholesGamma}\left(100,50,1,\mathrm{\sigma },r,d,'\mathrm{put}'\right)$
 $\frac{\sqrt{{2}}{}\left({{2}}^{\frac{{{\mathrm{\sigma }}}^{{2}}{+}{2}{}{d}{-}{2}{}{r}}{{2}{}{{\mathrm{\sigma }}}^{{2}}}}{}{{ⅇ}}^{{-}\frac{{{\mathrm{\sigma }}}^{{4}}{+}{4}{}{d}{}{{\mathrm{\sigma }}}^{{2}}{+}{4}{}{r}{}{{\mathrm{\sigma }}}^{{2}}{+}{4}{}{{\mathrm{ln}}{}\left({2}\right)}^{{2}}{+}{4}{}{{d}}^{{2}}{-}{8}{}{d}{}{r}{+}{4}{}{{r}}^{{2}}}{{8}{}{{\mathrm{\sigma }}}^{{2}}}}{}{{\mathrm{\sigma }}}^{{2}}{+}{2}{}{{ⅇ}}^{{-}\frac{{{\mathrm{\sigma }}}^{{4}}{+}{4}{}{\mathrm{ln}}{}\left({2}\right){}{{\mathrm{\sigma }}}^{{2}}{+}{4}{}{d}{}{{\mathrm{\sigma }}}^{{2}}{+}{4}{}{r}{}{{\mathrm{\sigma }}}^{{2}}{+}{4}{}{{\mathrm{ln}}{}\left({2}\right)}^{{2}}{-}{8}{}{\mathrm{ln}}{}\left({2}\right){}{d}{+}{8}{}{\mathrm{ln}}{}\left({2}\right){}{r}{+}{4}{}{{d}}^{{2}}{-}{8}{}{d}{}{r}{+}{4}{}{{r}}^{{2}}}{{8}{}{{\mathrm{\sigma }}}^{{2}}}}{}{{\mathrm{\sigma }}}^{{2}}{+}{{2}}^{\frac{{3}{}{{\mathrm{\sigma }}}^{{2}}{+}{2}{}{d}{-}{2}{}{r}}{{2}{}{{\mathrm{\sigma }}}^{{2}}}}{}{{ⅇ}}^{{-}\frac{{{\mathrm{\sigma }}}^{{4}}{+}{4}{}{d}{}{{\mathrm{\sigma }}}^{{2}}{+}{4}{}{r}{}{{\mathrm{\sigma }}}^{{2}}{+}{4}{}{{\mathrm{ln}}{}\left({2}\right)}^{{2}}{+}{4}{}{{d}}^{{2}}{-}{8}{}{d}{}{r}{+}{4}{}{{r}}^{{2}}}{{8}{}{{\mathrm{\sigma }}}^{{2}}}}{}{\mathrm{ln}}{}\left({2}\right){-}{{2}}^{\frac{{3}{}{{\mathrm{\sigma }}}^{{2}}{+}{2}{}{d}{-}{2}{}{r}}{{2}{}{{\mathrm{\sigma }}}^{{2}}}}{}{{ⅇ}}^{{-}\frac{{{\mathrm{\sigma }}}^{{4}}{+}{4}{}{d}{}{{\mathrm{\sigma }}}^{{2}}{+}{4}{}{r}{}{{\mathrm{\sigma }}}^{{2}}{+}{4}{}{{\mathrm{ln}}{}\left({2}\right)}^{{2}}{+}{4}{}{{d}}^{{2}}{-}{8}{}{d}{}{r}{+}{4}{}{{r}}^{{2}}}{{8}{}{{\mathrm{\sigma }}}^{{2}}}}{}{d}{+}{{2}}^{\frac{{3}{}{{\mathrm{\sigma }}}^{{2}}{+}{2}{}{d}{-}{2}{}{r}}{{2}{}{{\mathrm{\sigma }}}^{{2}}}}{}{{ⅇ}}^{{-}\frac{{{\mathrm{\sigma }}}^{{4}}{+}{4}{}{d}{}{{\mathrm{\sigma }}}^{{2}}{+}{4}{}{r}{}{{\mathrm{\sigma }}}^{{2}}{+}{4}{}{{\mathrm{ln}}{}\left({2}\right)}^{{2}}{+}{4}{}{{d}}^{{2}}{-}{8}{}{d}{}{r}{+}{4}{}{{r}}^{{2}}}{{8}{}{{\mathrm{\sigma }}}^{{2}}}}{}{r}{-}{4}{}{{ⅇ}}^{{-}\frac{{{\mathrm{\sigma }}}^{{4}}{+}{4}{}{\mathrm{ln}}{}\left({2}\right){}{{\mathrm{\sigma }}}^{{2}}{+}{4}{}{d}{}{{\mathrm{\sigma }}}^{{2}}{+}{4}{}{r}{}{{\mathrm{\sigma }}}^{{2}}{+}{4}{}{{\mathrm{ln}}{}\left({2}\right)}^{{2}}{-}{8}{}{\mathrm{ln}}{}\left({2}\right){}{d}{+}{8}{}{\mathrm{ln}}{}\left({2}\right){}{r}{+}{4}{}{{d}}^{{2}}{-}{8}{}{d}{}{r}{+}{4}{}{{r}}^{{2}}}{{8}{}{{\mathrm{\sigma }}}^{{2}}}}{}{\mathrm{ln}}{}\left({2}\right){+}{4}{}{{ⅇ}}^{{-}\frac{{{\mathrm{\sigma }}}^{{4}}{+}{4}{}{\mathrm{ln}}{}\left({2}\right){}{{\mathrm{\sigma }}}^{{2}}{+}{4}{}{d}{}{{\mathrm{\sigma }}}^{{2}}{+}{4}{}{r}{}{{\mathrm{\sigma }}}^{{2}}{+}{4}{}{{\mathrm{ln}}{}\left({2}\right)}^{{2}}{-}{8}{}{\mathrm{ln}}{}\left({2}\right){}{d}{+}{8}{}{\mathrm{ln}}{}\left({2}\right){}{r}{+}{4}{}{{d}}^{{2}}{-}{8}{}{d}{}{r}{+}{4}{}{{r}}^{{2}}}{{8}{}{{\mathrm{\sigma }}}^{{2}}}}{}{d}{-}{4}{}{{ⅇ}}^{{-}\frac{{{\mathrm{\sigma }}}^{{4}}{+}{4}{}{\mathrm{ln}}{}\left({2}\right){}{{\mathrm{\sigma }}}^{{2}}{+}{4}{}{d}{}{{\mathrm{\sigma }}}^{{2}}{+}{4}{}{r}{}{{\mathrm{\sigma }}}^{{2}}{+}{4}{}{{\mathrm{ln}}{}\left({2}\right)}^{{2}}{-}{8}{}{\mathrm{ln}}{}\left({2}\right){}{d}{+}{8}{}{\mathrm{ln}}{}\left({2}\right){}{r}{+}{4}{}{{d}}^{{2}}{-}{8}{}{d}{}{r}{+}{4}{}{{r}}^{{2}}}{{8}{}{{\mathrm{\sigma }}}^{{2}}}}{}{r}\right)}{{800}{}\sqrt{{\mathrm{\pi }}}{}{{\mathrm{\sigma }}}^{{3}}}$ (6)
 > $\mathrm{BlackScholesGamma}\left(100,50,1,0.3,0.05,0.03,'\mathrm{put}'\right)$
 ${0.000529595076}$ (7)
 > $\mathrm{BlackScholesGamma}\left(100,t↦\mathrm{max}\left(50-t,0\right),1,\mathrm{\sigma },r,d\right)$
 $\frac{{{ⅇ}}^{{-}{r}}{}\sqrt{{2}}{}\left({{ⅇ}}^{{-}\frac{{\left({-}{{\mathrm{\sigma }}}^{{2}}{+}{2}{}{\mathrm{ln}}{}\left({2}\right){-}{2}{}{d}{+}{2}{}{r}\right)}^{{2}}}{{8}{}{{\mathrm{\sigma }}}^{{2}}}}{}{{\mathrm{\sigma }}}^{{2}}{+}{2}{}{{ⅇ}}^{{-}\frac{{{\mathrm{\sigma }}}^{{4}}{+}{4}{}{\mathrm{ln}}{}\left({2}\right){}{{\mathrm{\sigma }}}^{{2}}{+}{4}{}{d}{}{{\mathrm{\sigma }}}^{{2}}{-}{4}{}{r}{}{{\mathrm{\sigma }}}^{{2}}{+}{4}{}{{\mathrm{ln}}{}\left({2}\right)}^{{2}}{-}{8}{}{\mathrm{ln}}{}\left({2}\right){}{d}{+}{8}{}{\mathrm{ln}}{}\left({2}\right){}{r}{+}{4}{}{{d}}^{{2}}{-}{8}{}{d}{}{r}{+}{4}{}{{r}}^{{2}}}{{8}{}{{\mathrm{\sigma }}}^{{2}}}}{}{{\mathrm{\sigma }}}^{{2}}{+}{2}{}{{ⅇ}}^{{-}\frac{{\left({-}{{\mathrm{\sigma }}}^{{2}}{+}{2}{}{\mathrm{ln}}{}\left({2}\right){-}{2}{}{d}{+}{2}{}{r}\right)}^{{2}}}{{8}{}{{\mathrm{\sigma }}}^{{2}}}}{}{\mathrm{ln}}{}\left({2}\right){-}{2}{}{{ⅇ}}^{{-}\frac{{\left({-}{{\mathrm{\sigma }}}^{{2}}{+}{2}{}{\mathrm{ln}}{}\left({2}\right){-}{2}{}{d}{+}{2}{}{r}\right)}^{{2}}}{{8}{}{{\mathrm{\sigma }}}^{{2}}}}{}{d}{+}{2}{}{{ⅇ}}^{{-}\frac{{\left({-}{{\mathrm{\sigma }}}^{{2}}{+}{2}{}{\mathrm{ln}}{}\left({2}\right){-}{2}{}{d}{+}{2}{}{r}\right)}^{{2}}}{{8}{}{{\mathrm{\sigma }}}^{{2}}}}{}{r}{-}{4}{}{{ⅇ}}^{{-}\frac{{{\mathrm{\sigma }}}^{{4}}{+}{4}{}{\mathrm{ln}}{}\left({2}\right){}{{\mathrm{\sigma }}}^{{2}}{+}{4}{}{d}{}{{\mathrm{\sigma }}}^{{2}}{-}{4}{}{r}{}{{\mathrm{\sigma }}}^{{2}}{+}{4}{}{{\mathrm{ln}}{}\left({2}\right)}^{{2}}{-}{8}{}{\mathrm{ln}}{}\left({2}\right){}{d}{+}{8}{}{\mathrm{ln}}{}\left({2}\right){}{r}{+}{4}{}{{d}}^{{2}}{-}{8}{}{d}{}{r}{+}{4}{}{{r}}^{{2}}}{{8}{}{{\mathrm{\sigma }}}^{{2}}}}{}{\mathrm{ln}}{}\left({2}\right){+}{4}{}{{ⅇ}}^{{-}\frac{{{\mathrm{\sigma }}}^{{4}}{+}{4}{}{\mathrm{ln}}{}\left({2}\right){}{{\mathrm{\sigma }}}^{{2}}{+}{4}{}{d}{}{{\mathrm{\sigma }}}^{{2}}{-}{4}{}{r}{}{{\mathrm{\sigma }}}^{{2}}{+}{4}{}{{\mathrm{ln}}{}\left({2}\right)}^{{2}}{-}{8}{}{\mathrm{ln}}{}\left({2}\right){}{d}{+}{8}{}{\mathrm{ln}}{}\left({2}\right){}{r}{+}{4}{}{{d}}^{{2}}{-}{8}{}{d}{}{r}{+}{4}{}{{r}}^{{2}}}{{8}{}{{\mathrm{\sigma }}}^{{2}}}}{}{d}{-}{4}{}{{ⅇ}}^{{-}\frac{{{\mathrm{\sigma }}}^{{4}}{+}{4}{}{\mathrm{ln}}{}\left({2}\right){}{{\mathrm{\sigma }}}^{{2}}{+}{4}{}{d}{}{{\mathrm{\sigma }}}^{{2}}{-}{4}{}{r}{}{{\mathrm{\sigma }}}^{{2}}{+}{4}{}{{\mathrm{ln}}{}\left({2}\right)}^{{2}}{-}{8}{}{\mathrm{ln}}{}\left({2}\right){}{d}{+}{8}{}{\mathrm{ln}}{}\left({2}\right){}{r}{+}{4}{}{{d}}^{{2}}{-}{8}{}{d}{}{r}{+}{4}{}{{r}}^{{2}}}{{8}{}{{\mathrm{\sigma }}}^{{2}}}}{}{r}\right)}{{800}{}\sqrt{{\mathrm{\pi }}}{}{{\mathrm{\sigma }}}^{{3}}}$ (8)
 > $\mathrm{BlackScholesGamma}\left(100,t↦\mathrm{max}\left(50-t,0\right),1,0.3,0.05,0.03,d\right)$
 ${0.0005295950875}$ (9)

In this example, you will compute the Gamma of a strangle.

 > $S≔\mathrm{BlackScholesGamma}\left(100,t↦\mathrm{piecewise}\left(t<50,50-t,t<100,0,t-100\right),1,\mathrm{\sigma },r,d\right)$
 ${S}{≔}{-}\frac{{{ⅇ}}^{{-}{r}}{}\sqrt{{2}}{}\left({-}{2}{}{{ⅇ}}^{{-}\frac{{{\mathrm{\sigma }}}^{{4}}{+}{4}{}{\mathrm{ln}}{}\left({2}\right){}{{\mathrm{\sigma }}}^{{2}}{+}{4}{}{d}{}{{\mathrm{\sigma }}}^{{2}}{-}{4}{}{r}{}{{\mathrm{\sigma }}}^{{2}}{+}{4}{}{{\mathrm{ln}}{}\left({2}\right)}^{{2}}{-}{8}{}{\mathrm{ln}}{}\left({2}\right){}{d}{+}{8}{}{\mathrm{ln}}{}\left({2}\right){}{r}{+}{4}{}{{d}}^{{2}}{-}{8}{}{d}{}{r}{+}{4}{}{{r}}^{{2}}}{{8}{}{{\mathrm{\sigma }}}^{{2}}}}{}{{\mathrm{\sigma }}}^{{2}}{-}{4}{}{{ⅇ}}^{{-}\frac{{\left({{\mathrm{\sigma }}}^{{2}}{+}{2}{}{d}{-}{2}{}{r}\right)}^{{2}}}{{8}{}{{\mathrm{\sigma }}}^{{2}}}}{}{{\mathrm{\sigma }}}^{{2}}{+}{4}{}{{ⅇ}}^{{-}\frac{{{\mathrm{\sigma }}}^{{4}}{+}{4}{}{\mathrm{ln}}{}\left({2}\right){}{{\mathrm{\sigma }}}^{{2}}{+}{4}{}{d}{}{{\mathrm{\sigma }}}^{{2}}{-}{4}{}{r}{}{{\mathrm{\sigma }}}^{{2}}{+}{4}{}{{\mathrm{ln}}{}\left({2}\right)}^{{2}}{-}{8}{}{\mathrm{ln}}{}\left({2}\right){}{d}{+}{8}{}{\mathrm{ln}}{}\left({2}\right){}{r}{+}{4}{}{{d}}^{{2}}{-}{8}{}{d}{}{r}{+}{4}{}{{r}}^{{2}}}{{8}{}{{\mathrm{\sigma }}}^{{2}}}}{}{\mathrm{ln}}{}\left({2}\right){-}{4}{}{{ⅇ}}^{{-}\frac{{{\mathrm{\sigma }}}^{{4}}{+}{4}{}{\mathrm{ln}}{}\left({2}\right){}{{\mathrm{\sigma }}}^{{2}}{+}{4}{}{d}{}{{\mathrm{\sigma }}}^{{2}}{-}{4}{}{r}{}{{\mathrm{\sigma }}}^{{2}}{+}{4}{}{{\mathrm{ln}}{}\left({2}\right)}^{{2}}{-}{8}{}{\mathrm{ln}}{}\left({2}\right){}{d}{+}{8}{}{\mathrm{ln}}{}\left({2}\right){}{r}{+}{4}{}{{d}}^{{2}}{-}{8}{}{d}{}{r}{+}{4}{}{{r}}^{{2}}}{{8}{}{{\mathrm{\sigma }}}^{{2}}}}{}{d}{+}{4}{}{{ⅇ}}^{{-}\frac{{{\mathrm{\sigma }}}^{{4}}{+}{4}{}{\mathrm{ln}}{}\left({2}\right){}{{\mathrm{\sigma }}}^{{2}}{+}{4}{}{d}{}{{\mathrm{\sigma }}}^{{2}}{-}{4}{}{r}{}{{\mathrm{\sigma }}}^{{2}}{+}{4}{}{{\mathrm{ln}}{}\left({2}\right)}^{{2}}{-}{8}{}{\mathrm{ln}}{}\left({2}\right){}{d}{+}{8}{}{\mathrm{ln}}{}\left({2}\right){}{r}{+}{4}{}{{d}}^{{2}}{-}{8}{}{d}{}{r}{+}{4}{}{{r}}^{{2}}}{{8}{}{{\mathrm{\sigma }}}^{{2}}}}{}{r}{-}{{ⅇ}}^{{-}\frac{{\left({-}{{\mathrm{\sigma }}}^{{2}}{+}{2}{}{\mathrm{ln}}{}\left({2}\right){-}{2}{}{d}{+}{2}{}{r}\right)}^{{2}}}{{8}{}{{\mathrm{\sigma }}}^{{2}}}}{}{{\mathrm{\sigma }}}^{{2}}{-}{2}{}{{ⅇ}}^{{-}\frac{{\left({-}{{\mathrm{\sigma }}}^{{2}}{+}{2}{}{\mathrm{ln}}{}\left({2}\right){-}{2}{}{d}{+}{2}{}{r}\right)}^{{2}}}{{8}{}{{\mathrm{\sigma }}}^{{2}}}}{}{\mathrm{ln}}{}\left({2}\right){+}{2}{}{{ⅇ}}^{{-}\frac{{\left({-}{{\mathrm{\sigma }}}^{{2}}{+}{2}{}{\mathrm{ln}}{}\left({2}\right){-}{2}{}{d}{+}{2}{}{r}\right)}^{{2}}}{{8}{}{{\mathrm{\sigma }}}^{{2}}}}{}{d}{-}{2}{}{{ⅇ}}^{{-}\frac{{\left({-}{{\mathrm{\sigma }}}^{{2}}{+}{2}{}{\mathrm{ln}}{}\left({2}\right){-}{2}{}{d}{+}{2}{}{r}\right)}^{{2}}}{{8}{}{{\mathrm{\sigma }}}^{{2}}}}{}{r}\right)}{{800}{}\sqrt{{\mathrm{\pi }}}{}{{\mathrm{\sigma }}}^{{3}}}$ (10)
 > $C≔\mathrm{BlackScholesGamma}\left(100,100,1,\mathrm{\sigma },r,d,'\mathrm{call}'\right)$
 ${C}{≔}\frac{\sqrt{{2}}{}{{ⅇ}}^{{-}\frac{{{\mathrm{\sigma }}}^{{4}}{+}{4}{}{d}{}{{\mathrm{\sigma }}}^{{2}}{+}{4}{}{r}{}{{\mathrm{\sigma }}}^{{2}}{+}{4}{}{{d}}^{{2}}{-}{8}{}{d}{}{r}{+}{4}{}{{r}}^{{2}}}{{8}{}{{\mathrm{\sigma }}}^{{2}}}}}{{200}{}{\mathrm{\sigma }}{}\sqrt{{\mathrm{\pi }}}}$ (11)
 > $P≔\mathrm{BlackScholesGamma}\left(100,50,1,\mathrm{\sigma },r,d,'\mathrm{put}'\right)$
 ${P}{≔}\frac{\sqrt{{2}}{}\left({{2}}^{\frac{{{\mathrm{\sigma }}}^{{2}}{+}{2}{}{d}{-}{2}{}{r}}{{2}{}{{\mathrm{\sigma }}}^{{2}}}}{}{{ⅇ}}^{{-}\frac{{{\mathrm{\sigma }}}^{{4}}{+}{4}{}{d}{}{{\mathrm{\sigma }}}^{{2}}{+}{4}{}{r}{}{{\mathrm{\sigma }}}^{{2}}{+}{4}{}{{\mathrm{ln}}{}\left({2}\right)}^{{2}}{+}{4}{}{{d}}^{{2}}{-}{8}{}{d}{}{r}{+}{4}{}{{r}}^{{2}}}{{8}{}{{\mathrm{\sigma }}}^{{2}}}}{}{{\mathrm{\sigma }}}^{{2}}{+}{2}{}{{ⅇ}}^{{-}\frac{{{\mathrm{\sigma }}}^{{4}}{+}{4}{}{\mathrm{ln}}{}\left({2}\right){}{{\mathrm{\sigma }}}^{{2}}{+}{4}{}{d}{}{{\mathrm{\sigma }}}^{{2}}{+}{4}{}{r}{}{{\mathrm{\sigma }}}^{{2}}{+}{4}{}{{\mathrm{ln}}{}\left({2}\right)}^{{2}}{-}{8}{}{\mathrm{ln}}{}\left({2}\right){}{d}{+}{8}{}{\mathrm{ln}}{}\left({2}\right){}{r}{+}{4}{}{{d}}^{{2}}{-}{8}{}{d}{}{r}{+}{4}{}{{r}}^{{2}}}{{8}{}{{\mathrm{\sigma }}}^{{2}}}}{}{{\mathrm{\sigma }}}^{{2}}{+}{{2}}^{\frac{{3}{}{{\mathrm{\sigma }}}^{{2}}{+}{2}{}{d}{-}{2}{}{r}}{{2}{}{{\mathrm{\sigma }}}^{{2}}}}{}{{ⅇ}}^{{-}\frac{{{\mathrm{\sigma }}}^{{4}}{+}{4}{}{d}{}{{\mathrm{\sigma }}}^{{2}}{+}{4}{}{r}{}{{\mathrm{\sigma }}}^{{2}}{+}{4}{}{{\mathrm{ln}}{}\left({2}\right)}^{{2}}{+}{4}{}{{d}}^{{2}}{-}{8}{}{d}{}{r}{+}{4}{}{{r}}^{{2}}}{{8}{}{{\mathrm{\sigma }}}^{{2}}}}{}{\mathrm{ln}}{}\left({2}\right){-}{{2}}^{\frac{{3}{}{{\mathrm{\sigma }}}^{{2}}{+}{2}{}{d}{-}{2}{}{r}}{{2}{}{{\mathrm{\sigma }}}^{{2}}}}{}{{ⅇ}}^{{-}\frac{{{\mathrm{\sigma }}}^{{4}}{+}{4}{}{d}{}{{\mathrm{\sigma }}}^{{2}}{+}{4}{}{r}{}{{\mathrm{\sigma }}}^{{2}}{+}{4}{}{{\mathrm{ln}}{}\left({2}\right)}^{{2}}{+}{4}{}{{d}}^{{2}}{-}{8}{}{d}{}{r}{+}{4}{}{{r}}^{{2}}}{{8}{}{{\mathrm{\sigma }}}^{{2}}}}{}{d}{+}{{2}}^{\frac{{3}{}{{\mathrm{\sigma }}}^{{2}}{+}{2}{}{d}{-}{2}{}{r}}{{2}{}{{\mathrm{\sigma }}}^{{2}}}}{}{{ⅇ}}^{{-}\frac{{{\mathrm{\sigma }}}^{{4}}{+}{4}{}{d}{}{{\mathrm{\sigma }}}^{{2}}{+}{4}{}{r}{}{{\mathrm{\sigma }}}^{{2}}{+}{4}{}{{\mathrm{ln}}{}\left({2}\right)}^{{2}}{+}{4}{}{{d}}^{{2}}{-}{8}{}{d}{}{r}{+}{4}{}{{r}}^{{2}}}{{8}{}{{\mathrm{\sigma }}}^{{2}}}}{}{r}{-}{4}{}{{ⅇ}}^{{-}\frac{{{\mathrm{\sigma }}}^{{4}}{+}{4}{}{\mathrm{ln}}{}\left({2}\right){}{{\mathrm{\sigma }}}^{{2}}{+}{4}{}{d}{}{{\mathrm{\sigma }}}^{{2}}{+}{4}{}{r}{}{{\mathrm{\sigma }}}^{{2}}{+}{4}{}{{\mathrm{ln}}{}\left({2}\right)}^{{2}}{-}{8}{}{\mathrm{ln}}{}\left({2}\right){}{d}{+}{8}{}{\mathrm{ln}}{}\left({2}\right){}{r}{+}{4}{}{{d}}^{{2}}{-}{8}{}{d}{}{r}{+}{4}{}{{r}}^{{2}}}{{8}{}{{\mathrm{\sigma }}}^{{2}}}}{}{\mathrm{ln}}{}\left({2}\right){+}{4}{}{{ⅇ}}^{{-}\frac{{{\mathrm{\sigma }}}^{{4}}{+}{4}{}{\mathrm{ln}}{}\left({2}\right){}{{\mathrm{\sigma }}}^{{2}}{+}{4}{}{d}{}{{\mathrm{\sigma }}}^{{2}}{+}{4}{}{r}{}{{\mathrm{\sigma }}}^{{2}}{+}{4}{}{{\mathrm{ln}}{}\left({2}\right)}^{{2}}{-}{8}{}{\mathrm{ln}}{}\left({2}\right){}{d}{+}{8}{}{\mathrm{ln}}{}\left({2}\right){}{r}{+}{4}{}{{d}}^{{2}}{-}{8}{}{d}{}{r}{+}{4}{}{{r}}^{{2}}}{{8}{}{{\mathrm{\sigma }}}^{{2}}}}{}{d}{-}{4}{}{{ⅇ}}^{{-}\frac{{{\mathrm{\sigma }}}^{{4}}{+}{4}{}{\mathrm{ln}}{}\left({2}\right){}{{\mathrm{\sigma }}}^{{2}}{+}{4}{}{d}{}{{\mathrm{\sigma }}}^{{2}}{+}{4}{}{r}{}{{\mathrm{\sigma }}}^{{2}}{+}{4}{}{{\mathrm{ln}}{}\left({2}\right)}^{{2}}{-}{8}{}{\mathrm{ln}}{}\left({2}\right){}{d}{+}{8}{}{\mathrm{ln}}{}\left({2}\right){}{r}{+}{4}{}{{d}}^{{2}}{-}{8}{}{d}{}{r}{+}{4}{}{{r}}^{{2}}}{{8}{}{{\mathrm{\sigma }}}^{{2}}}}{}{r}\right)}{{800}{}\sqrt{{\mathrm{\pi }}}{}{{\mathrm{\sigma }}}^{{3}}}$ (12)

Check:

 > $\mathrm{simplify}\left(S-C-P\right)$
 ${0}$ (13)

References

 Hull, J., Options, Futures, and Other Derivatives, 5th. edition. Upper Saddle River, New Jersey: Prentice Hall, 2003.

Compatibility

 • The Finance[BlackScholesGamma] command was introduced in Maple 15.
 • For more information on Maple 15 changes, see Updates in Maple 15.