>

> COMPARISONS OF ASYMPTOTIC APPROXIMATIONS WITH
NUMERICAL QUADRATURE RESULTS

> restart:
approx:=x->evalf(exp(x^2)/(2*x));

`...`

> num:=x->evalf(Int(exp(t^2),t=0..x));

`...`

> test:=proc(x)
  local a,n,rel_err;

  a:=approx(x);

  n:=num(x);

  rel_err:=(a-n)/n;

  return [a,n,rel_err];

end proc:

test(1);

test(5);

test(10);

test(20);


[1.359140914, 1.462651746, -0.7076929439e-1]

[7200489934., 7354153748., -0.2089483294e-1]

[0.1344058571e43, 0.1350882281e43, -0.5051298767e-2]

[0.1305367422e173, 0.1307005289e173, -0.1253144891e-2]

>

>

> restart:
approx:=lambda->evalf((sqrt(Pi))*( exp(lambda)/sqrt(lambda)));

`...`

> num:=lambda->evalf(Int(cos(t/2)*exp(lambda*sin(t)),t=0..Pi));

`...`

> p:=lambda->plot(cos(t/2)*exp(lambda*sin(t)),t=0..Pi);
p(50);

test:=proc(lambda)

  local a,n,rel_err;

  a:=approx(lambda);

  n:=num(lambda);

  rel_err:=(a-n)/n;

  return [a,n,rel_err];

end proc:

test(1);

test(10);

test(20);

test(50);

`...`

[Plot]

[4.818029094, 4.060156939, .1866608031]

[12345.81473, 12345.71912, 0.7744384841e-5]

[192286846.3, 192286846.2, 0.5200563740e-9]

[0.1299612947e22, 0.1299612947e22, 0.]

>

Animations of solution here