Is there any command to give me the list of all the embedded elementary functions in Mathematica like Cos Sin Cosh Sinh Log and so on?
-
1$\begingroup$ I think you need to define what makes a function elementary. $\endgroup$– SPPearceCommented Feb 8, 2019 at 12:04
-
1$\begingroup$ @kraZug Mathematica has already named it : reference.wolfram.com/language/guide/ElementaryFunctions.html $\endgroup$– user49047Commented Feb 8, 2019 at 12:08
-
1$\begingroup$ I think it is safe to say that if there is an elementary function, then Mathematica has it. Now you get to decide what functions are elementary. $\endgroup$– SomosCommented Feb 8, 2019 at 18:30
2 Answers
There doesn't seem to be a direct way to use WolframLanguageData
to get only the functions listed on the referenced page of elementary functions. The expression
WolframLanguageData[
EntityClass[
"WolframLanguageSymbol", {"FunctionalityArea", "BasicFunctions"}]]
gives rather more than asked for. There doesn't seem to be a functionality area closer to what is wanted.
Never mind, we can always read the documentation and do a little string hacking maybe:
n1 = Import[$InstallationDirectory ~~ "/Documentation/English/System/Guides/ElementaryFunctions.nb", "Text"];
and then after a little data-tasting ...
StringCases[n1,
"HelpLookup[\"paclet:ref/" ~~ fn : WordCharacter .. ~~ "\"" :> fn]
Another way to enumerate the elementary functions would be through MathematicalFunctionData[]
:
FromEntity /@ MathematicalFunctionData["ElementaryFunctions"]
{ArcCos, ArcCosh, ArcCot, ArcCoth, ArcCsc, ArcCsch, ArcSec, ArcSech, ArcSin, ArcSinh,
ArcTan, ArcTanh, ArcTan[#1, #2] &, Cos, Cosh, Cot, Coth, Csc, Csch, Exp, Haversine,
Log10, Log2, Log[#1, #2] &, Log, #1^#2 &, ProductLog, ProductLog[#1, #2] &, Sec, Sech,
Sin, Sinc, Sinh, Sqrt, Tan, Tanh}
Note the separate entries for the one-argument and two-argument versions of Log[]
, ArcTan[]
, and ProductLog[]
.
One might argue that the Lambert function ProductLog[]
is not actually elementary, but this is the convention followed by Mathematica. Similarly, one might also wonder why e.g. Gudermannian[]
, InverseGudermannian[]
, InverseHaversine[]
, and LogisticSigmoid[]
aren't in the returned list.