@itsme Hmmm... it looks like I'll need to eat my words in this case!
I was trying to add this info to our help pages, but then found there is a way you can control the integration scheme that's used, in an indirect way. Many of the process creation procedures have a 'scheme' option, which has two values: Euler and unbiased. The default value is Euler, and in that case, integration proceeds as I described above. However, the unbiased case is more complicated.
I looked at the GaussMarkovProcess case to find out what exactly is going on. I haven't completely figured out why it works yet, but here is the short version. If you select 'scheme = unbiased', then Maple uses its own integration methods (as implemented in evalf/Int) to do as much of the integration as possible behind the scenes. Concretely, here's what happens:
The SDE for this class of process is dX = h * (g - X) * dt + sigma * dW. Define the following auxiliary functions:
lambda(t, t + dt) = exp(int(h(z), z = t .. t+dt))
mu(t, t+dt) = int(exp(int(h(u, u = z .. t + dt)) * g(z), z = t .. t + dt)
s(t, t+dt) = sqrt(int(exp(2*int(h(u), u=z..t+dt))*sigma(z)^2, z=t..t+dt))
Integration proceeds *technically* via the Euler-Maruyama scheme in all cases, with a callback from QuantLib. QuantLib asks the process what the change in X should be as time progresses from t to t+dt; this delta is added to the current value of X. If the Euler scheme is selected, then (unsurprisingly) Maple returns
h(t) * g(t) * dt - h(t) * X * dt + sigma(t) * sqrt(dt) * W,
where W is a standard normally distributed random variable. On the other hand, if the unbiased scheme is selected, Maple returns:
(lambda(t, t+dt) - 1) * X + mu(t, t+dt) + s(t, t+dt)*W.
This means that for every time step, Maple needs to compute a number of (deterministic) numerical integrals (through evalf/Int). (Note that this happens only once for each new process-time grid combination; if you create many sample paths, the integrals for each time point are computed only once.) The time steps and integration scheme used for these integrations cannot be set manually.
I haven't figured out yet why, exactly, the second expression is a valid thing to return, but (at the cost of being many times slower) it appears to give excellent results.
As for documenting this, it's now become a much larger task. I'll see if I can schedule this in somewhere...