Function Repository Resource:

# FunctionParity

Determine the parity of a function, even or odd, with respect to one or more variables

Contributed by: Wolfram|Alpha Math Team
 ResourceFunction["FunctionParity"][expr,x] gives an integer indicating the parity of expr with respect to x, or Undefined. ResourceFunction["FunctionParity"][expr,{x1,x2,…}] gives the overall parity of expr with respect to multiple variables xi.

## Details and Options

ResourceFunction["FunctionParity"] returns one of the following results:
 -1 expr is an odd function of x 1 expr is an even function of x 0 expr is both an even and an odd function of x Undefined none of the above is true
A function is considered even if for all x and is considered odd if .
For a function of multiple variables, parity is determined by its behavior under the transformation {x,y,..}{-x,-y,..}. It is considered even if it maintains its value under this transformation and odd if it changes sign.

## Examples

### Basic Examples (12)

Find the parity of a basic power function:

 In[1]:=
 Out[1]=

Test another power function:

 In[2]:=
 Out[2]=

Show that a constant function has even parity:

 In[3]:=
 Out[3]=

Find the parity of a rational function:

 In[4]:=
 Out[4]=

Find the parity of the absolute value function:

 In[5]:=
 Out[5]=

Find the parity of a trigonometric function:

 In[6]:=
 Out[6]=

Find the parity of a Gaussian function:

 In[7]:=
 Out[7]=

Test a signed Gaussian function:

 In[8]:=
 Out[8]=

Find the parity of the hyperbolic tangent function:

 In[9]:=
 Out[9]=

Find the parity of the error function:

 In[10]:=
 Out[10]=

Find the parity of a Fresnel integral:

 In[11]:=
 Out[11]=

Find the parity of a shifted Fresnel integral:

 In[12]:=
 Out[12]=

### Scope (3)

For a function of multiple variables, parity is determined based on the behavior of the function under the transformation {x,y,..}{-x,-y,..}. Find the parity of a function of two variables:

 In[13]:=
 Out[13]=

Find the parity of a function of three variables:

 In[14]:=
 Out[14]=

Wrapping z in Abs converts this to an even function:

 In[15]:=
 Out[15]=

Show that an implicitly defined circle is even in both x and y:

 In[16]:=
 Out[16]=

### Properties and Relations (2)

FunctionParity returns Undefined for functions that are neither even nor odd:

 In[17]:=
 Out[17]=

The constant function f(x)=0 is both even and odd:

 In[18]:=
 Out[18]=

## Publisher

Wolfram|Alpha Math Team

## Version History

• 4.0.0 – 23 March 2023
• 3.0.0 – 01 April 2020
• 2.0.0 – 06 September 2019
• 1.0.0 – 10 July 2019