# Evaluating a definite integral numerically using the ODE integrator. # Thanks to David W. Neilsen for working out the template. Digits := 20; ErrorTol := 1e-10; deq1 := diff(f(t),t) = 1/(1+t^2) * cos(t); iv1 := f(0) = 0; C := array(1..30); for i from 1 to 30 do C[i]:= 0; od; C[1] := 0; C[2] := ErrorTol; C[10] := 1000; S := dsolve({deq1,iv1},{f(t)},type=numeric,method=lsode[adamsfull],ctrl=C); S(1); S(10); S(100); S(200);