> 
plots:setoptions(gridlines=false);

> 
d:=1: s:=8/10: c1:=sqrt((s)/Pi/r^3)/2 * (sin(r*(u1)^2/4/(s)+Pi/4)+sin(r*(u+1)^2/4/(s))/sqrt(2)): c22:=((u+1)/(4*Pi*r*sqrt(y1)))*(exp(r*y*(u+1)^2/(8*s)))*(sin(r*y*(u+1)^2/8/(s*(y1))+Pi/4)/2+sin(r*y*(u1)^2/8/(s*(y1))+Pi/4)): c2:=Int(c22, y= 1..infinity):

> 
value(student[changevar](Y=sqrt(y1),c2,Y)) assuming r>1, r<100, u>1, u<10: alt_c2:=simplify(combine(simplify(%)),size) assuming r>1, r<100, u>1, u<10;

> 
c33:=(sin(r*y*(u+1)^2/8/(s*(y1))+Pi/4)+sin(r*y*(u1)^2/8/(s*(y1))+Pi/4))*(((d*s)/(Pi*(r^2)*y*sqrt(y1))*exp(r*y*(u+1)^2/8/s))((d^2*sqrt((2*s^3)/(Pi*(y1)*y^3*r^5)))*exp(d*(u+1)+(2*d^2*s)/(y*r))*erfc((r*y*(u+1)+4*d*s)/(2*sqrt(2*s*r*y))))): c3_1:=Int(c33, y= 1..2); c3_2:=simplify(Int(c33, y= 2..infinity, epsilon=1e6, method=_d01amc),size) assuming r>0, u>0, u<10;

> 
eval(c3_2, [u=1.2, r=3.1]): evalf(%);

> 
alt_c3_1 := simplify(combine(student[changevar](Y=1/(y1), c3_1, Y)),size) assuming r>0, u>0, u<10: alt_c3_1 := Int(op(1,alt_c3_1), Y=1..100, epsilon=1e6, method=_d01akc);

> 
evalf(eval(alt_c3_1, [u=1.2, r=3.1]));

> 
plot(eval(op(1,alt_c3_1), [u=1.2, r=3.1]), Y=1..100, size=[500,200]);

> 
g1:=c1+alt_c2+alt_c3_1+c3_2:

> 
evalf(eval(g1, [u=1.2, r=3.1]));

> 
evalf(eval(g1, [u=1.2, r=10.6]));

> 
CodeTools:Usage( plot( eval(g1, [u=1.2]), r=1..100, adaptive=false, numpoints=300, size=[500,200] ) );

memory used=52.17MiB, alloc change=8.00MiB, cpu time=2.54s, real time=2.71s, gc time=0ns
> 
expand(expandoff()); expandoff(sin, cos, exp, erf, erfc);

> 
#g2_pre := Int(unapply(eval(g1, [u=1.2]), r), 1..100, epsilon=1e5, method=_Dexp): #evalf(g2_pre);

> 
g2_pre := Int(g1, r=1..100, epsilon=1e3, method=_Dexp): CodeTools:Usage( evalf(eval(g2_pre, [u=4.1])) );

memory used=189.97MiB, alloc change=32.00MiB, cpu time=11.44s, real time=11.19s, gc time=624.00ms
> 
g2:= unapply(g2_pre,u):

> 
CodeTools:Usage( evalf(g2(4.0)) );

memory used=190.19MiB, alloc change=0 bytes, cpu time=12.56s, real time=12.22s, gc time=733.20ms
> 
CodeTools:Usage( plot(g2, 0.1..10, adaptive=false, numpoints=100) );

memory used=43.22GiB, alloc change=384.00MiB, cpu time=60.07m, real time=58.65m, gc time=3.32m
> 
CodeTools:Usage( plot(g2, 0.1..2.0, adaptive=false, numpoints=50) );

memory used=2.44GiB, alloc change=0 bytes, cpu time=2.49m, real time=2.41m, gc time=9.13s
