restart:# Basically I want do do something like that,
J1 := proc()
local z:
z := proc(u) fsolve(sqrt(x)=u, x) end proc:
evalf(Int(''z''(u), u=0..1))
end proc:
J1();
# but when z is more complex finction of two arguments.
#
# Unfortunately a direct transposition of what worked above no longer works.
J2 := proc()
local z:
z := proc(q1, q2)
exp(
2*(
fsolve(1/2+(1/2)*erf((1/2)*x*sqrt(2)) = q1, x)
*
fsolve(1/2+(1/2)*erf((1/2)*x*sqrt(2)) = q2, x)
)

fsolve(1/2+(1/2)*erf((1/2)*x*sqrt(2)) = sqrt(q1), x)^2

fsolve(1/2+(1/2)*erf((1/2)*x*sqrt(2)) = sqrt(q2), x)^2
)
end proc:
evalf(Int(''z''(q1, q2), q1=0..1, q2=0..1))
end proc:
J2();