In this example we use the package IntroToSymmetry.m to work out the four dimensional Lie algebra of the equation 

Uyy+Ux^2+UUxx=0. 

This equation is equivalent to the system

        Vx-Uy=0
        Vy+UUx=0

Forming the mixed derivative Vxy and eliminating terms leads to the original equation. This system is found to admit a six dimensional Lie algebra of simple groups plus an infinite dimensional group. This is a fairly common occurence when a single equation is replaced by several equivalent equations. The additional symmetries that are revealed when the equation is broken into an equivalent system are called hidden symmetries.

First read in the package which is located in a folder called SymmetryAnalysis inside the Mathematica folder.

Needs["SymmetryAnalysis`IntroToSymmetry`"]

Enter the input equation as a string. Don't include the ==0 at the end.

\(\(inputequation = 
"D[u[x,y],y,y]+D[u[x,y],x]^2+u[x,y]*D[u[x,y],x,x]";\)\)

The function u[x,y] is a solution of the equation and this constraint must be applied in the form of a rule to the invariance condition. Be careful to check signs.

\(\(rulesarray = 
{"D[u[x,y],y,y]->-D[u[x,y],x]^2-u[x,y]*D[u[x,y],x,x]"};\)\)

Enter the list of independent variables.

independentvariables = {"x", "y"};

Enter the number of dependent variables.

dependentvariables = {"u"};

Enter the list of function and constant names that must be protected when the equation is converted to generic y1[x1,x2] variables.

frozennames = {};

Enter the maximum derivative order of the input equation(s).

p = 2;

The maximum derivative order that the infinitesimals are assumed to depend on is specified by the input parameter r. This parameter is only nonzero when the user is looking for Lie contact groups or Lie-Backlund groups. For the usual case where one is searching for point groups set r=0.

r = 0;

When searching for Lie-Backlund groups (r=1 or greater) one can, without loss of generality, leave the independent variables untransformed. The corresponding infinitesimals (the xse's) are set to zero by setting xseon=0. If one is searching for point groups then set xseon=1. The choice xseon=1 is also an option when looking for Lie-Backlund groups and this can be useful when  looking for contact symmetries.

xseon = 1;

When searching for Lie-Backlund groups it is necessary to differentiate the input equation with respect to each of the independent variables producing derivatives of order p+r. These higher order differential consequences are appended to the set of rules applied to the invariance condition. This process is carried out automatically when internalrules=1. For point groups the equation or equation system is the only rule or set of rules needed and one sets internalrules=0.

internalrules = 0;

Now work out the determining equations of the Lie point group that leaves the equation  invariant. The output is available as a table of strings called zdeterminingequations.

Timing[
      FindDeterminingEquations[
independentvariables, 
        dependentvariables, frozennames, p, r, xseon, inputequation, 
        rulesarray, internalrules]]

equationgenericvariables

invarconditiontable

The program expresses the determining equations in terms of zvariables. Here is the correspondence between z-variables and conventional variables.

ztableofrules

Here are the determining equations expressed in terms of z-variables. This output may be quite long. The equations in the table can be distinguished by the == 0 at the end of each item.

zdeterminingequations

How many determining equations are there?

Length[zdeterminingequations]

Now solve the determining equations in terms of multivariable polynomials. The Mathematica function Solve uses Gaussian elimination to solve a large number of linear equations for the polynomial coefficients.  The time roughly follows

time/timeref=((number of equations)/(number of equationsref))^n

where the exponent is between 2.4 and 2.7. The Mathematica  function Timing outputs the time required for the SolveDeterminingEquations function to execute.

Timing[
      SolveDeterminingEquations[
independentvariables, 
        dependentvariables, r, xseon, zdeterminingequations, 
        order = 3]]

Here are the infinitesimals for the independent variables expressed in terms of z-variables.

xsefunctions

and the infinitesimals for the dependent variables.

etafunctions

Express the xse functions in terms of x,y variables.

ToExpression[xsefunctions] /. ztableofrules

Express the eta function in terms of these variables.

ToExpression[etafunctions] /. ztableofrules

List the groups.

ColumnForm[infinitesimalgroups] /. ztableofrules

The equation admits a four dimensional Lie algebra. Let's work out the commutator table of the group.

infinitesimalgroupsxy = 
        infinitesimalgroups /. {z1 -> x, z2 -> y, 
            z3 -> u};

Now generate the commutator table.

MakeCommutatorTable[
independentvariables, 
      dependentvariables, infinitesimalgroupsxy]

Put the commutator table in readable form.

MatrixForm[commutatortable]

MaxMemoryUsed[ ]

Now let's work out the symmetries of the equivalent system

           Vx-Uy=0
           Vy+UUx=0

\(\(inputequation1 = 
"D[v[x,y],x]-D[u[x,y],y]";\)\)

\(\(inputequation2 = 
"D[v[x,y],y]+u[x,y]*D[u[x,y],x]";\)\)

\(\(rulesarray = 
{"D[v[x,y],x]->D[u[x,y],y]", \ "D[v[x,y],y]->-u[x,y]*D[u[x,y],x]"};\)\)

newdependentvariables = {u, v};

p = 1;

r = 0;

xseon = 1;

internalrules = 0;

Timing[
      FindDeterminingEquations[
independentvariables, 
        newdependentvariables, frozennames, p, r, 
        xseon, 
inputequation1, rulesarray, 
        internalrules]]

zdeterminingequations1 = zdeterminingequations;

Timing[
      FindDeterminingEquations[
independentvariables, 
        newdependentvariables, frozennames, p, r, 
        xseon, 
inputequation2, rulesarray, 
        internalrules]]

zdeterminingequations2 = zdeterminingequations;

zdeterminingequations3 = 
        Join[zdeterminingequations1, zdeterminingequations2];

Length[zdeterminingequations3]

Timing[
      SolveDeterminingEquations[
independentvariables, 
        newdependentvariables, r, xseon, zdeterminingequations3, 
        order = 4]]

Here are the infinitesimals for the independent variables expressed in terms of z-variables.

xsefunctions

and the infinitesimals for the dependent variables.

etafunctions

Express the xse functions in terms of x,y variables.

ToExpression[xsefunctions] /. {z1 -> x, z2 -> y, 
        z3 -> u,  z4 -> v}

Express the eta function in terms of these variables.

ToExpression[etafunctions] /. {z1 -> x, z2 -> y, 
        z3 -> u,  z4 -> v}

List the groups.

ColumnForm[infinitesimalgroups] /. {z1 -> x, z2 -> y, 
        z3 -> u,  z4 -> v}

The presence of fourth order terms indicates that the infinitesimals may include arbitrary functions. This will take some sorting out.  It turns out that the equation set is invariant under the group
 
      (xse1,xse2,eta1,eta2)=(F[u,v],G[u,v],0,0) 
      
  where the functions satisfy 
    
              Fv=Gu 
               Fu=-uGv
     
Let's remove the terms corresponding to this infinite dimensional  group and work out the commutator table of the remaining groups.

infinitesimalgroupsuv = 
        infinitesimalgroups /. {z1 -> x, z2 -> y, z3 -> u,  
            z4 -> v};

infinitesimalgroupsreduced = 
Drop[
          infinitesimalgroupsuv, {4, 8}];

numberofgroups = Length[infinitesimalgroupsreduced]

ColumnForm[infinitesimalgroupsreduced]

Note that the the fourth and last groups do not appear among the groups of the combined single equation worked out above. Now generate the commutator table.

MakeCommutatorTable[
independentvariables, 
      newdependentvariables, infinitesimalgroupsreduced]

Put the commutator table in readable form.

MatrixForm[Simplify[commutatortable]]

MaxMemoryUsed[ ]