In this example we use the package IntroToSymmetry.m to work out point and nonlocalgroups of the potential Korteweg-de Vries equation,

Uxxx-(1/2)Ux^3-(1/b)Ut=0.

The nonlocal groups are checked by direct substitution in the invariance condition using Mathematica built-in functions. The solution of the potential KdV equation generated by summing the Lie series is also checked by direct substitution.

This next command turns off spurious spelling error warnings.

Off[General::spell]

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 input equation as a string. Don't include the ==0 at the end.

inputequation=
"D[U[x,t],x,x,x]-(1/2)*D[U[x,t],x]^3-(1/b)*D[U[x,t],t]";

The function U[x,t] 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,t],x,x,x]->(1/2)*D[U[x,t],x]^3+(1/b)*D[U[x,t],t]"};

Enter the list of independent variables.

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

Enter the list of dependent variables.

dependentvariables={"U"};

Enter the list of function and/or constant names that need to be preserved when the equations are expressed in terms of generic variables.

frozennames={""};

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

porder=3;

The maximum derivative order that the infinitesimals are assumed to depend on is specified by the input parameter rorder. 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 rorder=0.

rorder=0;

When searching for Lie-Backlund groups (rorder=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 to produce derivatives of order porder+rorder and append these higher order differential consequences 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,porder,rorder,xseon,inputequation,rulesarray,internalrules]]

Let's look at the partial derivatives of the potential KdV equation that appear in the invariance condition.

invarconditiontable

Here are the determining equations in terms of z-variables.

zdeterminingequations;

Length[zdeterminingequations]

Here is the correspondence between z-variables and conventional variables.

ztableofrules

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,rorder,xseon,zdeterminingequations,polyorder=4]]

Here are the infinitesimal transformation functions for the independent variables.

xsefunctions

and for the dependent variables.

etafunctions

Usually the equation is expressed in terms of x, t and U.Express the xse functions in terms of these variables.

ToExpression[xsefunctions]/.{z1->x,z2->t,z3->U}

Express the eta function in terms of these variables.

ToExpression[etafunctions]/.{z1->x,z2->t,z3->U}

infinitesimalgroups1=infinitesimalgroups/.{z1->x,z2->t,z3->U}

Check the groups. xse's are on the left, eta's are on the right.

Column[infinitesimalgroups1]

Check the infinitesimals in the determining equations.

Simplify[ToExpression[zdeterminingequations]]

This is the four-parameter point group of the potential KdV equation. This equation is discussed extensively in Chapter 14 and Chapter 16.

MakeCommutatorTable[independentvariables,dependentvariables,infinitesimalgroups1]

MatrixForm[commutatortable]

*****************************************************************

The package captures the basic point groups of the equation but there is also a nonlocal group that we need to determine. Let's check this group in the invariance condition. Here is the infinitesimal.

eta1nonlocal1[x_,t_]:=Integrate[Exp[-U[x,t]],x]

D[eta1nonlocal1[x,t],t]+(3*b/2)*D[U[x,t],x]^2*D[eta1nonlocal1[x,t],x]-b*D[eta1nonlocal1[x,t],x,x,x]

ExpandAll[%]

Cancel[%]

This is the integral with respect to x of the potential KdV equation multiplied by Exp[-u[x,t]] and so the invariance condition is satisfied by the assumed form of the infinitesimal. Alternatively, we can use the positive form of the exponential.

eta1nonlocal2[x_,t_]:=Integrate[Exp[U[x,t]],x]

D[eta1nonlocal2[x,t],t]+(3*b/2)*D[U[x,t],x]^2*D[eta1nonlocal2[x,t],x]-b*D[eta1nonlocal2[x,t],x,x,x]

ExpandAll[%]

Cancel[%]

Again, this is the integral with respect to x of the potential KdV equation multiplied by Exp[u[x,t]]. The invariance checks.

Or we can use combinations of the exponential for example.

eta1nonlocal3[x_,t_]:=Integrate[Sinh[U[x,t]],x]

D[eta1nonlocal3[x,t],t]+(3*b/2)*D[U[x,t],x]^2*D[eta1nonlocal3[x,t],x]-b*D[eta1nonlocal3[x,t],x,x,x]

ExpandAll[%]

Cancel[%]

This is the integral respect to x of the potential KdV equation multiplied by Cosh[u[x,t]. The invariance checks.

eta1nonlocal4[x_,t_]:=Integrate[Cosh[U[x,t]],x]

D[eta1nonlocal4[x,t],t]+(3*b/2)*D[U[x,t],x]^2*D[eta1nonlocal4[x,t],x]-b*D[eta1nonlocal4[x,t],x,x,x]

ExpandAll[%]

Cancel[%]

This is the integral respect to x of the potential KdV equation multiplied by Sinh[u[x,t]. The invariance checks.

By summing the Lie series, this infinitesimal group generates a solution of the KdV potential equation in the form of the corresponding finite transformation. Let's check this solution in the equation. The solution is

Utilda[x_,t_]:=U[x,t]+2*Log[1-s*Integrate[Exp[-U[x,t]],x]]

D[Utilda[x,t],t]+(b/2)*D[Utilda[x,t],x]^3-b*D[Utilda[x,t],x,x,x]

ExpandAll[%]

Cancel[%]

This is the KdV potential equation plus a term proportional to the integral with respect to x of the potential KdV equation multiplied by Exp[-u[x,t]. As long as U[x,t] is a solution of the KdV potential equation then Utilda is a solution.

MaxMemoryUsed[ ]