Sponsored links: Algebra eBooks
 

Related

erf-integrate-sqrt

integrate(erf (x), sq...

Calculate

erf-exp-integrate-pi-sqrt-tex

integrate(y*exp(-y^2)...

tex(%);

Calculate

erf-sqrt

x:2;

y:3;

a:2;

Calculate

erf-numer-sqrt

a:5428.13;

d:51040.53;

f(x,y):=1/2*(erf((y-a...

Calculate

erf

val(erf(1));

Calculate

erf-pi-plot2d-sqrt
plot2d([erf(x), x*2/sqrt(%pi)/(1+1/3*x^2)],[x,-2,2]);

plot2d([erf(x), x*2/s...

Calculate

erf-exp-factor-integrate-ratsimp

erf(10.0);

erf(%i*100.0-100.0);

h(t):= exp(-t^2/(2*s^...

Calculate

erf-pi-plot2d-sqrt
plot2d([sqrt(%pi)*1/2*erf(x)+x-(1/x)-sqrt(%pi)*1/2*erf(1)],[x,-10,10]);

plot2d([sqrt(%pi)*1/2...

Calculate

erf-integrate-sqrt

integrate(erf (x), sq...

Calculate

erf

Run Example
(%i1)f(x):=exp(-x^2);
                                              2
(%o1)                          f(x) := exp(- x )
(%i2) tex( expand( integrate( (x-y-l)*f(x), x, l+y, inf) ));
$${{\sqrt{\pi}\,y\,\mathrm{erf}\left(y+l\right)}\over{2}}+{{\sqrt{\pi
 }\,l\,\mathrm{erf}\left(y+l\right)}\over{2}}+{{e^{-y^2-2\,l\,y-l^2}
 }\over{2}}-{{\sqrt{\pi}\,y}\over{2}}-{{\sqrt{\pi}\,l}\over{2}}$$
(%o2)                                false
(%i3) tex(integrate( expand( integrate( (x-y-l)*f(x), x, l+y, inf) * f(y)),y, -inf,inf));
$$\int_{-\infty }^{\infty }{{{\sqrt{\pi}\,y\,e^ {- y^2 }\,
 \mathrm{erf}\left(y+l\right)}\over{2}}+{{\sqrt{\pi}\,l\,e^ {- y^2 }
 \,\mathrm{erf}\left(y+l\right)}\over{2}}-{{\sqrt{\pi}\,y\,e^ {- y^2
  }}\over{2}}-{{\sqrt{\pi}\,l\,e^ {- y^2 }}\over{2}}+{{e^{-2\,y^2-2\,
 l\,y-l^2}}\over{2}}\;dy}$$
(%o3)                                false
(%i4) integrate( expand( integrate( (x-y-l)*f(x), x, l+y, inf) * f(y)),y, -inf,inf);
       inf                     2                               2
      /                     - y                             - y
      [       sqrt(%pi) y %e     erf(y + l)   sqrt(%pi) l %e     erf(y + l)
(%o4) I      (----------------------------- + -----------------------------
      ]                     2                               2
      /
       - inf
                             2                    2          2            2
                          - y                  - y      - 2 y  - 2 l y - l
            sqrt(%pi) y %e       sqrt(%pi) l %e       %e
          - ------------------ - ------------------ + ---------------------) dy
                    2                    2                      2
(%i5) integrate( y*exp(-y^2), y, -inf,inf);
(%o5)                                  0
(%i6) integrate( exp(-y^2)*erf(y+l),y,-inf,inf );
                           inf
                          /           2
                          [        - y
(%o6)                     I      %e     erf(y + l) dy
                          ]
                          /
                           - inf
(%i7) integrate( y*exp(-y^2),y,-inf,inf);
(%o7)                                  0
(%i8) integrate( exp(-y^2),y,-inf,inf);
(%o8)                              sqrt(%pi)
(%i9) integrate( exp(-(y+l)^2),y,-inf,inf);
(%o9)                              sqrt(%pi)
(%i10) romberg(exp(-y^2)*erf(y+l),y,-inf,inf);
                              2
                           - y
(%o10)           romberg(%e     erf(y + l), y, - 1.0 inf, inf)
(%i11) 
Run Example
load(distrib);
(%o1)     /usr/share/maxima/5.21.1/share/contrib/distrib/distrib.mac
(%i2) d1:1/(volat*sqrt(T))*(ln(S/K)+(r+(volat^2)/2)*T);
                                  2
                             volat              S
                            (------ + r) T + ln(-)
                               2                K
(%o2)                       ----------------------
                                volat sqrt(T)
(%i3) d2:d1-volat*sqrt(T);
                          2
                     volat              S
                    (------ + r) T + ln(-)
                       2                K
(%o3)               ---------------------- - volat sqrt(T)
                        volat sqrt(T)
(%i4) C:cdf_normal(d1,0,1)*S-cdf_normal(d2,0,1)*K*exp(-r*T);
                   2
              volat              S
             (------ + r) T + ln(-)
                2                K
         erf(----------------------)
             sqrt(2) volat sqrt(T)     1
(%o4) S (--------------------------- + -)
                      2                2
                                         2
                                    volat              S
                                   (------ + r) T + ln(-)
                                      2                K
                                   ---------------------- - volat sqrt(T)
                                       volat sqrt(T)
                               erf(--------------------------------------)
                        - r T                     sqrt(2)                    1
                  - K %e      (------------------------------------------- + -)
                                                    2                        2
(%i5) P:K*exp(-r*T)-S+C;
                             2
                        volat              S
                       (------ + r) T + ln(-)
                          2                K
                       ---------------------- - volat sqrt(T)
                           volat sqrt(T)
                   erf(--------------------------------------)
            - r T                     sqrt(2)                    1
(%o5) - K %e      (------------------------------------------- + -)
                                        2                        2
                                         2
                                    volat              S
                                   (------ + r) T + ln(-)
                                      2                K
                               erf(----------------------)
                                   sqrt(2) volat sqrt(T)     1        - r T
                          + S (--------------------------- + -) + K %e      - S
                                            2                2
(%i6) solve(C,volat);
(%o6)                                 []
(%i7) solve(P,volat);
(%o7)                                 []
(%i8) solve(P,T);
                                      2                 S
                                (volat  - 2 r) T - 2 ln(-)
                                                        K
                       K (- erf(--------------------------) - 1)
                                     3/2
                 r T                2    volat sqrt(T)
(%o8)         [%e    = -----------------------------------------]
                                     2                 S
                               (volat  + 2 r) T + 2 ln(-)
                                                       K
                        S (erf(--------------------------) - 1)
                                    3/2
                                   2    volat sqrt(T)
(%i9) solve(P,S);
                                        2                 S
                                  (volat  - 2 r) T - 2 ln(-)
                     - r T                                K
                 K %e      (- erf(--------------------------) - 1)
                                       3/2
                                      2    volat sqrt(T)
(%o9)       [S = -------------------------------------------------]
                                  2                 S
                            (volat  + 2 r) T + 2 ln(-)
                                                    K
                        erf(--------------------------) - 1
                                 3/2
                                2    volat sqrt(T)
(%i10) solve(P,K);
                                      2                 S
                                (volat  + 2 r) T + 2 ln(-)
                       r T                              K
                   S %e    (erf(--------------------------) - 1)
                                     3/2
                                    2    volat sqrt(T)
(%o10)        [K = ---------------------------------------------]
                                   2                 S
                             (volat  - 2 r) T - 2 ln(-)
                                                     K
                       - erf(--------------------------) - 1
                                  3/2
                                 2    volat sqrt(T)
(%i11) solve(d1,volat);
                                    S                                  S
                                 ln(-)                              ln(-)
                                    K                                  K
(%o11) [volat = - sqrt(2) sqrt(- ----- - r), volat = sqrt(2) sqrt(- ----- - r)]
                                   T                                  T
(%i12) solve(d2,volat);
                                  S                                S
                               ln(-)                            ln(-)
                                  K                                K
(%o12) [volat = - sqrt(2) sqrt(----- + r), volat = sqrt(2) sqrt(----- + r)]
                                 T                                T
(%i13) fortran(C);
      S*(erf(((volat**2/2.0E+0+r)*T+ln(S/K))/(sqrt(2)*volat*sqrt(T)))/2.
     1   0E+0+1.0E+0/2.0E+0)-K*exp(-r*T)*(erf((((volat**2/2.0E+0+r)*T+ln
     2   (S/K))/(volat*sqrt(T))-volat*sqrt(T))/sqrt(2))/2.0E+0+1.0E+0/2.
     3   0E+0)
(%o13)                               done
(%i14) factor(S*(erf(((volat^2/2+r)*T+ln(S/K))/(sqrt(2)*volat*sqrt(T)))/2+1/2)-K*exp(-r*T)*(erf((((volat^2/2+r)*T+ln(S/K))/(volat*sqrt(T))-volat*sqrt(T))/sqrt(2))/2+1/2));
                                   2                 S
                             (volat  + 2 r) T + 2 ln(-)
          - r T      r T                             K
(%o14) (%e      (S %e    erf(--------------------------)
                                  3/2
                                 2    volat sqrt(T)
                                        2                 S
                                  (volat  - 2 r) T - 2 ln(-)
                                                          K         r T
                          + K erf(--------------------------) + S %e    - K))/2
                                       3/2
                                      2    volat sqrt(T)
(%i15) 
Run Example
G(x):=0.5*(1+erf(x/sqrt(2)));
                                                x
(%o1)                   G(x) := 0.5 (1 + erf(-------))
                                             sqrt(2)
(%i2) Q(x,m,d):= G((x-m)/d);
                                            x - m
(%o2)                       Q(x, m, d) := G(-----)
                                              d
(%i3) 

Related Help

Help for Erf