The method of undetermined coefficients (symmetry5) is the most successful methods of the paper of Cheb-terrab and Roche [2]. In the paper, the symmetry generators $\xi$ and $\eta$ are assumed to be bivariate: $\xi=a_1x+a_2y+a_3$, $\eta=b_1x+b_2y+b_3$ and the coefficients $a_1..a_3,b_1..b_3$ are solved using the method of undetermined coefficients. The default in our maxima implementation is a bivariate polynomial of degree 2. For $\xi$ this means $\xi=a_1x + a_2y + a_3 + a_4x^2 + a_5xy + a_6y^2$. This means we can solve many more odes with the method of undetermined coefficients than mentioned in the paper. we load the file containing the list of Kamke ODEs and the file ode1_lie.mac
In [ ]:
kill(all);batch("~/mathematics/maxima_files/kamke1_1.mac");batch("~/mathematics/maxima_files/ode1_lie.mac");
In [2]:
ode:kamke1[23];
Out[2]:
In [7]:
DEBUGFLAG:1;returnSymmetries:true;returnIntegratingFactor:true;returnSolution:true;
assume(a*b>0);
ode1solve(ode,y,x,'useMethod="muc");
forget(a*b>0);
method;
Out[7]:
Out[7]:
Out[7]:
Out[7]:
Out[7]:
Out[7]:
Out[7]:
Out[7]:
The ODE has a simple polynomial symmetry due to being separable, but also a polynomial symmetry of degree 2, which is given in the first item of the output list.
Polynomial symmetries occur frequently and the method of undetermined coefficients is one of the most successfull algorithms for finding symmetries. The method of undetermined coefficients sees rational variables like log(), sqrt() and exp() as additional variables. A multivariate polynomial is constructed that includes these variables. For instance for Kamke ODE 1.59:
In [8]:
ode:kamke1[59];
Out[8]:
This ODE has a square root term. First, we try to factor the term. In this case, we can factor into $\sqrt{y^2+1}=\sqrt{y+i}\sqrt{y-i}$. The factors are complex, and we value real over complex. This is why we ignore the complex factorization and introduce the new variable $z=\sqrt{y^2+1}$ and we construct a second degree polynomial in $x,y,z$. Note that if the ode had a term of the form $\sqrt{y^2-1}=\sqrt{y+1}\sqrt{y-1}$, we would have introduced 2 new variables $z_1=\sqrt{y+1}$ and $z_2=\sqrt{y-1}$. Factorization gives us more variables and a more general shape of the determining equations.
In [9]:
ode1solve(ode,y,x,'useMethod="symmetry5");
Out[9]:
The method of undetermined coefficients finds a polynomial symmetry and an implicit solution (we asked for an explicit solution, hence the warning).
Additionally, the method of undetermined coefficients searches for rational polynomial symmetries of the form $\xi=Q_1/P_1$ and $\eta=Q_2/P_2$, with $P,Q$ bivariate polynomials. Because the search for such symmetries is much more expensive, the default is to search only for rational symmetries of the form $[\xi,\eta]=[0,\frac{Q}{P}]$ and $[\xi,\eta]=[\frac{Q}{P},0]$. It turns out that there is a class of ODEs of the form $y'=\frac{Q(x,y)}{P(x,y)}$ and $y'=\frac{Q(x,y)}{xP(x,y)}$ whose symmetries have the form $[\xi,\eta]=[0,\frac{F(x,y)}{P(x,y)}]$, so symmetries whose denominator is the denominator (or denominator times $x$) of the right-hand side of the differential equation. We are also looking for these symmetries.
In [10]:
ode:kamke1[346];
Out[10]:
This ODE can be written as $y'=Q/P$, with $P=x(\log(xy)+y-ax)$. So we are factoring out the $x$, and are looking for symmetries of the form $[\xi,\eta] =[0,\frac{F(x,y)}{\log(xy)+y-ax}]$. The method symmetry5b will look for such symmetries.
In [11]:
ode1solve(ode,y,x,'useMethod="symmetry5b");
Out[11]:
note that the denominator of the symmetry does not match the original denominator of the ODE. This is because internally, ode1solve tries to simplify the ODE by rewriting $\log(xy)$ in terms of $\log(x)$ and $\log(y)$. These canonical forms can be obtained as follows:
In [12]:
ode1CanonicalForm(ode,y,x);
Out[12]:
In [13]:
P:factor_list(denom(rhs(%[1])));
Out[13]:
In [14]:
ode:kamke1[62];
Out[14]:
In [15]:
returnSolution:false;returnIntegratingFactor:false;returnSymmetries:true;DEBUGFLAG:1;
Out[15]:
Out[15]:
Out[15]:
Out[15]:
In [16]:
ode1solve(ode,y,x);
Out[16]:
We did not find any nontrivial symmetries of the ODE. Actually, we found some trivial symmetries, which internally lead to the expt: undefined: 0 to a negative exponent error message. We can use the method of undetermined coefficients with a user defined function for the shape of the symmetries. The ODE contains the term $\sqrt{x^2-y^2}$. If the symmetry contains such a term, it will not be recognized by any of the methods. With the method of undetermined coefficients, we can look for a symmetry containing this term. Let's define a shortcut:
In [17]:
V1:sqrt(x^2-y^2);
Out[17]:
Let's also define a shortcut for $\sqrt{x^2+y^2}$:
In [18]:
V2:sqrt(x^2+y^2);
Out[18]:
We could define a very general multivariate polynomial with the variables $x,y,V_1,V_2$, but after some trial and error you will find that this one works:
In [19]:
X:ode1solve(ode,y,x,'useMethod="symmetry5",'xi=a1*x/V1^2+a2*x/V2^2,'eta=b1*y/V1^2+b2*y/V2^2);
Out[19]:
In [20]:
print("X=",X,"is a symmetry of ODE ",ode,": ", is(checkSymmetries(X,ode,y,x)=0))$
we could have tried a symmetry search for a general rational symmetry of degree 2. However, this computation is very expensive. The search for such symmetries is not done automatically. With the symmetry that we have just found, we can construct an integrating factor for the ODE. Note that our symmetry is valid for the canonical form of the ODE, but in this case the ODE is already in canonical form. If it is not, you can use the function ode1CanonicalForm(ode,y,x) to place the ODE in canonical form.
In [21]:
ode:ode1CanonicalForm(ode,y,x)[1];
mu:ode1IntegratingFactor(X,ode,y,x);
isIntegratingFactor(mu,ode,y,x);
mu:ratsimp(%i*mu);
isIntegratingFactor(mu,ode,y,x);
Out[21]:
Out[21]:
Out[21]:
Out[21]:
Out[21]:
A manual computation of the integrating factor from the symmetry will reveal that the integrating factor is complex. It turns out that if we multiply the integrating factor with $i$, it is still an integrating factor, which might lead to a more elegant solution later in the computation. Internally, we try this if the integrating factor is complex. Unfortunately, computing an elegant solution using this integrating factor was not possible, but a solution can certainly be computed using ode1SolveWithIntegratingFactor(ode,mu,y,x,returnExplicit) where (bool) returnExplicit=true means that we want to compute an explicit solution.
[1] E.S. Cheb-Terrab and T. Kolokolnikov, First-order ordinary differential equations, symmetries and linear transformations, Euro. J. of Applied Mathematics 14 (2003)
[2] E.S. Cheb-Terrab and A.D. Roche, Symmetries and first order ODE patterns, Computer Physics Communications 113 (1998)
[3] E.S. Cheb-Terrab, L.G.S. Duarte and L.A.C.P. da Mota, Computer algebra solving of first order ODEs using symmetry methods, Computer Physics Communications 101 (1997)
[4] F. Schwarz, Symmetry analysis of Abel's equation, Studies in applied mathematics 100 (1998)
[5] F. Schwarz, Algorithmic solution of Abel's equation, Computing 61 (1998)
[6] E. Kamke, Differentialgleichungen, L$\mathrm{\ddot o}$sungsmethoden und L$\mathrm{\ddot o}$sungen, Leipzig (1959)