In this example we use the package IntroToSymmetry.m to work out the invariant groups of the nonlinear second-order ODE 

Yxx+bYx+(2b^2/9)Y+cY^3=0. 

This equation is discussed by Adam and Mahomed in a paper "A Nonlocal Symmetry Method for First-order Equations".  that appears in Modern Group Analysis VI, page 315. This notebook illustrates the use of Mathematica built-in functions to find the final form of the infinitesimals that turn out to contain the exponential.

Clear all symbols in the current context.

ClearAll[Evaluate[Context[]<>"*"]]

First read in the package which is located in User Home Folder/Library/Mathematica/Applications/SymmetryAnalysis.

Needs["SymmetryAnalysis`IntroToSymmetry`"]

Enter the list of independent variables.

independentvariables={"x"};

Enter the list of dependent variables.

dependentvariables={"y"};

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

inputequation=
"y''[x]+b*y'[x]+(2*b^2/9)*y[x]+c*y[x]^3";

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

rulesarray=
{"y''[x]->-b*y'[x]-(2*b^2/9)*y[x]-c*y[x]^3"};

Internally the package uses StringReplace to convert all of the user defined variables to generic x1,x2,x3..., y1,y2,y3... variables. When this is done it is important that function names and constant names that might appear in the equation are not erroneously modified. Enter the array of names that must be preserved when the equation is converted to generic (x1,y1) variables.

frozennames={"b","c"};

Enter the maximum derivative order of the equation.

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 one sets 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 r times 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

ztableofrules

ztableofrulesxy

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

zdeterminingequations

How many determining equations are there?

imax=Length[zdeterminingequations]

Lets look at the determining equations in a slightly more readable form.

zdeterminingequationscolumn=Column[ToExpression[zdeterminingequations],{Left,Below}]

Now solve the determining equations in terms of multivariable polynomials of a selected order.  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=4]]

Here are the infinitesimals for the independent 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

infinitesimalgroups

This process has captured the group (xse,eta)=(1, 0) corresponding to the parameter a10. But this equation contains an additional group. The determining equations themselves are correct but the SolveDeterminingEquations function is incapable of identifying the second group of this equation which  contains the exponential.

Considering the last two determining equations, use the following to simplify the system of determining equations.

xse1[z1_,z2_]:=a+f[z1]

eta1[z1_,z2_]:=z2*g[z1]

Substitute these functions into the expression form of the determining equations.

zdeterminingequationscolumn

The first determining equation splits into two. The terms multiplying z2^3 imply f'=-g. Mathematica has the capability of solving the equation formed by the terms multiplied by z2.

DSolve[g''[z1]+b*g'[z1]-(4*b^2/9)*g[z1]==0,g[z1],z1]

Now try a new form of the infinitesimals.

xse1[z1_,z2_]:=a+(3/(4*b))*c1*Exp[-4*b*z1/3]-(3/b)*c2*Exp[b*z1/3]

eta1[z1_,z2_]:=z2*c1*Exp[-4*b*z1/3]+z2*c2*Exp[b*z1/3]

Substitute these functions into the expression form of the determining equations.

zdeterminingequationscolumn

Simplify[%]

The second equation can only be satisfied if c1=0. Finally,

xse1[z1_,z2_]:=a-(3/b)*c2*Exp[b*z1/3]

eta1[z1_,z2_]:=z2*c2*Exp[b*z1/3]

zdeterminingequationscolumn

Finally, the infinitesimals that leave the original ODE invariant are
xse[x,y]=-a-(3/b) c2 Exp[bx/3]
eta[x,y]=c2 y Exp[bx/3]

Let's generate a commutator table for the group. First set up an array of the groups.

infinitesimalgroupsxy={{{1},{0}},{{-(3/b)*Exp[b*x/3]},{y*Exp[b*x/3]}}}

Column[infinitesimalgroupsxy]

MakeCommutatorTable[
independentvariables,dependentvariables,infinitesimalgroupsxy]

MatrixForm[commutatortable]

This is a two dimensional solvable Lie algebra that can be used to reduce the original ODE to quadrature.

MaxMemoryUsed[ ]