### Basic Examples

Basic Examples

In[]:=

Test whether an expression represents a linear function of a given variable:

[ax+b,x]

In[]:=

True

Out[]=

[4x-Pi,x]

In[]:=

True

Out[]=

Test for linearity with respect to a list of variables:

[(x+1)Log[y],{x}]

In[]:=

True

Out[]=

[(x+1)Log[y],{x,y}]

In[]:=

False

Out[]=

[(x+2y),{x,y}]

In[]:=

True

Out[]=

### Scope

Scope

In[]:=

Variables listed in the second argument are considered together in the test for linearity:

[xy,{x,y}]

In[]:=

False

Out[]=

### Possible Issues

Possible Issues

In[]:=

Expressions which are constant with respect to a variable are NOT considered linear:

[4,y]

In[]:=

False

Out[]=

[aLog[x],{y}]

In[]:=

False

Out[]=