# Question:How to integrate when the integrand is not a built-in function?

## Question:How to integrate when the integrand is not a built-in function?

Maple

I have a nice function whose graph is approximately quadratic; the plot shows the area under it should be around 1.6

However, it seems Maple thinks the area is 0.1465

Presumably there is something simple I am doing wrong, but I can't see it.

What follows may seem strange -- it is certainly strange to me -- but I need to be able to make integration work with my functions as apposed to the built-in functions one sees in examples...

with(Student[Calculus1]);

Digits:= 64;

erfy := (x) -> piecewise(x < -5, -1+(-1/Pi^(1/2)/x+1/2/Pi^(1/2)/x^3-3/4/Pi^(1/2)/x^5)/exp(x^2), And(-5 <= x, x <= 5), erf(x), x > 5, (1+(-1/Pi^(1/2)/x+1/2/Pi^(1/2)/x^3-3/4/Pi^(1/2)/x^5)/exp(x^2)));

h:= (u,a,b,g,d) ->  exp(-(1/d)^2)*d*g*exp(-(u-a)^2/b^2)*exp(((d-u)/(d*u))^2)*(1-erfy((d-u)/(d*u)))/u;

core := proc(n,t0,t1,a,b,g,d)

local x,y,f;

x := 2*t0/(d*g);

y := 2*t1/(d*g);

f := unapply(h(u,a,b,g,d), u);

[ApproximateInt(f, x..y, method = simpson),x,y];

end proc;

core(3,.5, 2.1, .5, 3, 3.14, 2.4);

MAPLE responds with an integral of about 0.1465...

HOWEVER:

show := proc(n,t0,t1,a,b,g,d)

local x,y,f;

x := 2*t0/(d*g);

y := 2*t1/(d*g);

f := unapply(h(u,a,b,g,d), u);

plot(f, x..y);

end proc;

show(3,.5, 2.1, .5, 3, 3.14, 2.4);

MAPLE responds with the nice quadratic graph whose area should be about 1.6...

Is it possible that Maple can be so wrong?!?  More likely would be that I have no clue as to how one somehow manages to cajole Maple into preforming an integral.