# How to extract a list of available Method-s

The option Methodapplies for several functions, such as NDSolve, FindRoot, NIntegrate and some others. It is difficult, however, to find a list of Methods for a given function. By digging through tutorials I extracted, for example, a list of Methods for NIntegrate:

"ClenshawCurtisRule"

"NewtonCotesRule",

"GaussKronrodRule",

"ClenshawCurtisRule"

"MultidimensionalRule"

"GaussKronrodRule",

"LobattoKronrodRule"

"SingularityHandler"

"DuffyCoordinates"

"Trapezoidal"

BDoubleExponentialOscillatory

MultiPeriodic,

MonteCarlo,

QuasiMonteCarlo,

ExtrapolatingOscillatory,

MultiPeriodicDoubleExponentialOscillator,

DoubleExponentialOscillatory

though I am not sure that my collection is complete.

Is there a way to get a complete list of Methods for a given function? I mean not only NIntegratebut also others.

I use this function

getList[name_String] := Module[{options, idx}, options = Names[name <> "*"];
options = ToExpression /@ options;
options = {#, Options[#]} & /@ options;
idx = Range[Length[options]];
options = {#[[1]], TableForm[#[[2]]]} & /@ options;
options = Insert[options[[#]], #, 1] & /@ idx;
options = Insert[options, {"#", "Option", "Options to this option"}, 1]
];

To use:

r = getList["NIntegrate"];
Grid[r, Frame -> All, Alignment -> Left, FrameStyle -> Directive[Thickness[.005],
Gray]]

I modified the above a bit based on function I think I got from one of the Mathematica Guide books but I do not remember now which book it was. The methods can be seen under the third column there by looking for Method-> there. At least this is much easier than having to scan pages and pages of help looking for these things.

Replace the name of the command above to get other functions. To filter the Method-> part automatically, one possible way would be to use Cases or some pattern on the result r above. This is left as an exercise for the pattern experts out there.

Update Response to comment below. I made new version called getList2 which only shows up the options with Method on them. I am sure this could be written better, but I am not good with patterns. Here we go

getList2[name_String] := Module[{options, idx,z1,z2},
options = Names[name <> "*"];
options = ToExpression /@ options;
options = Flatten[Last@Reap@Do[z1 = Options[options[[i]]];
If[z1 != {},
z2 = Cases[z1, Rule["Method", x_] :> Method -> x];
If[Length[z2] != 0 , Sow[{options[[i]], z2}]]
],
{i, Length[options]}
], 1];
(* rest for formatting*)
idx = Range[Length[options]];
options = {#[[1]], TableForm[#[[2]]]} & /@ options;
options = Insert[options[[#]], #, 1] & /@ idx;
options = Insert[options, {"#", "Option", "Options to this option"}, 1]];

Example calls

r = getList2["NIntegrate"];
Grid[r, Frame -> All, Alignment -> Left]

r = getList2["NDSolve"];
Grid[r, Frame -> All, Alignment -> Left]

• Thank you, it is a very valuable answer. Could you please comment on your function. I could not understand, where from it knows that among all options the Method should be chosen? Commented Nov 17, 2014 at 9:00
• @AlexeiBoulbitch I've added another function to filter only those options which has the Method-> on them and only show those. I kept the original function as is. Commented Nov 17, 2014 at 12:41
• Oddly, this does not work for ´Asymptotic´. Commented Aug 18, 2021 at 7:17