User-defined functions. Here’s an example that defines a function that in more or less standard mathematical notation would be given as f(x,y) = x^2 + y^2. The Mathematica syntax is similar, but pay attention to the square brackets around the variables on the left side of the equality sign, the underscore after each variable name, and the “:=” instead of “=”.

myFunction[x_,y_] := x^2 + y^2

myFunction[ 2, 6 ]

D[ myFunction[x,y], y ]

Solving equations with the Solve function.

Solve[ x +1 == 3, x ]

Solve[ D[ myFunction[x,y], x] == 0, x ]

Solve[ x^2 - 4 == 0, x ]

Solve[ 2*x*y == 0, {x,y}]