Forms of Input and Output

Here is one way to enter a particular expression:

x^2+Sqrt[y]

Here is another way to enter the same expression:

Plus[Power[x,2],Sqrt[y]]

With a notebook front end, you can also enter the expression directly in this way:

(x^2)+(Sqrt[y])

The Wolfram Language allows you to output expressions in many different ways.

In Wolfram System notebooks, expressions are by default output in (RefLink[StandardForm, paclet:ref/StandardForm]):

x^2+Sqrt[y]

(RefLink[OutputForm, paclet:ref/OutputForm]) uses only ordinary keyboard characters and is the default for text-based interfaces to the Wolfram Language:

OutputForm[x^2+Sqrt[y]]

(RefLink[InputForm, paclet:ref/InputForm]) yields a form that can be typed directly on a keyboard:

InputForm[x^2+Sqrt[y]]

(RefLink[FullForm, paclet:ref/FullForm]) shows the internal form of an expression in explicit functional notation:

FullForm[x^2+Sqrt[y]]

Some output forms for expressions.

Output forms provide textual representations of Wolfram Language expressions. In some cases these textual representations are also suitable for input to the Wolfram Language. But in other cases they are intended just to be looked at, or to be exported to other programs, rather than to be used as input to the Wolfram Language.

(RefLink[TraditionalForm, paclet:ref/TraditionalForm]) uses a large collection of ad hoc rules to produce an approximation to traditional mathematical notation:

TraditionalForm[x^2+Sqrt[y]+Gamma[z] EllipticK[z]]

(RefLink[TeXForm, paclet:ref/TeXForm]) yields output suitable for export to TeX:

TeXForm[x^2+Sqrt[y]]

(RefLink[MathMLForm, paclet:ref/MathMLForm]) yields output in MathML:

MathMLForm[x^2+Sqrt[y]]

(RefLink[CForm, paclet:ref/CForm]) yields output that can be included in a C program. Macros for objects like (RefLink[Power, paclet:ref/Power]) are included in the header file mdefs.h:

CForm[x^2+Sqrt[y]]

(RefLink[FortranForm, paclet:ref/FortranForm]) yields output suitable for export to Fortran:

FortranForm[x^2+Sqrt[y]]

Output forms not normally used for Wolfram Language input.

"Low-Level Input and Output Rules" discusses how you can create your own output forms. You should realize however that in communicating with external programs it is often better to use the Wolfram Symbolic Transfer Protocol (WSTP) to send expressions directly than to generate a textual representation for these expressions.

Two ways to communicate between the Wolfram System and other programs.