# D-Algebraic Functions

This notebook accompagnies the paper “D-Algebraic Functions” by Rida Ait El Manssour, Anna-Laura Sattelberger, and Bertrand Teguia Tabuguia. Our Maple package NLDE uses the Maple packages

• PolynomialIdeals

• Groebner

for elimination with Gröbner bases. The source file of the package can be found here or here. At the moment Jupyter notebook only works with Maple 2022. For more details see Maple-kernel-for-Jupyter. Those interested in trying the computations of this file in a Maple session (or worksheet) can download the file DalgebraicFunc-Examples-Maple-Worksheet.mw on the main page D-Algebraic Functions.

In order to be able to use NLDE, one can just put the file NLDE.mla in the same directory with the notebook or the Maple worksheet.

We start by setting the (current) working directory as a directory for libraries.

[1]:

libname:=currentdir(),libname:


Then we load the NLDE package. It has 4 procedures, and we present some examples for each of them.

[2]:

with(NLDE)

[2]:

$[\mathit{SystoMinDiffPoly}, \mathit{arithmeticDalg}, \mathit{composeDalg}, \mathit{unaryDalg}]$

## Example 2.3

From the linear ODE of $$\sin(x)$$ one derives an ADE satisfied by its reciprocal using unaryDalg as below.

The equation for $$\sin(x)$$ can be computed using DEtools:-FindODE.

[3]:

ODE:=DEtools:-FindODE(sin(x),y(x))

[3]:

$y \left(x \right)+\frac{d^{2}}{d x^{2}}y \left(x \right)$

where ADEin is an algebraic differential equation (so contains “=”), y(x) is its dependent variable, and x is its independent variable. z is the name of dependent variable for the output (like y for y(x)), and r is a rational expression in x and y. The output is an ADE satisfies by all r(x,f(x)), where f(x) satisfies ADEin.

Hence the ADE for the reciprocal $$\sin(x)$$

[4]:

unaryDalg(ODE=0,y(x),z=1/y)

[4]:

$z \left(x \right)^{2}-\left(\frac{d^{2}}{d x^{2}}z \left(x \right)\right) z \left(x \right)+2 \left(\frac{d}{d x}z \left(x \right)\right)^{2} = 0$

## Example 2.8

We now consider the Painlevé transcendent of type I that fullfils the ADE:

$\frac{d^2}{dx^2} y(x) = 6 y(x)^2 + x.$

[5]:

unaryDalg(diff(y(x),x,x)=6*y(x)^2+x,y(x),z=y^2)

[5]:

$-16 x^{2} z \left(x \right)^{3}-192 x z \left(x \right)^{4}-576 z \left(x \right)^{5}+4 z \left(x \right)^{2} \left(\frac{d^{2}}{d x^{2}}z \left(x \right)\right)^{2}-4 z \left(x \right) \left(\frac{d^{2}}{d x^{2}}z \left(x \right)\right) \left(\frac{d}{d x}z \left(x \right)\right)^{2}+\left(\frac{d}{d x}z \left(x \right)\right)^{4} = 0$

## Example 4.3

where ADE1 and ADE2 are two algebraic differential equations of the dependent variable y(x) and z(x), resp. w(x) is the dependent variable for the output. The latter is an ADE satisfies by all f(g(x)), where f(x) satisfies ADE1, and g(x) satisfies ADE2.

[6]:

ADE1:=diff(y(x),x)-y(x)=0

[6]:

$\frac{d}{d x}y \left(x \right)-y \left(x \right) = 0$
[7]:

ADE2:=z(x)^2+2*diff(z(x),x)=0

[7]:

$z \left(x \right)^{2}+2 \frac{d}{d x}z \left(x \right) = 0$
[8]:

composeDalg([ADE1,ADE2],[y(x),z(x)],w(x))

[8]:

$w \left(x \right)^{2} \left(\frac{d^{2}}{d x^{2}}w \left(x \right)\right)^{2}+2 w \left(x \right) \left(\frac{d}{d x}w \left(x \right)\right)^{3}-2 w \left(x \right) \left(\frac{d}{d x}w \left(x \right)\right)^{2} \left(\frac{d^{2}}{d x^{2}}w \left(x \right)\right)+\left(\frac{d}{d x}w \left(x \right)\right)^{4} = 0$

## Example 4.5

[9]:

ADE1:=diff(y(x),x,x)+y(x)=0

[9]:

$y \left(x \right)+\frac{d^{2}}{d x^{2}}y \left(x \right) = 0$
[10]:

ADE2:=diff(z(x),x)-x*z(x)=0

[10]:

$\frac{d}{d x}z \left(x \right)-z \left(x \right) x = 0$
[11]:

composeDalg([ADE1,ADE2],[y(x),z(x)],w(x))

[11]:

$\left(2 x^{4}+3 x^{2}+3\right) w \left(x \right) \left(\frac{d}{d x}w \left(x \right)\right)+\left(-3 x^{3}-3 x \right) w \left(x \right) \left(\frac{d^{2}}{d x^{2}}w \left(x \right)\right)+\left(\frac{d^{3}}{d x^{3}}w \left(x \right)\right) x^{2} w \left(x \right)+\left(\frac{d}{d x}w \left(x \right)\right)^{2} \left(x^{3}+x \right)-\left(\frac{d}{d x}w \left(x \right)\right) x^{2} \left(\frac{d^{2}}{d x^{2}}w \left(x \right)\right) = 0$

## Example 5.1

to be understood as for unaryDalg, but here we can deal with n-ary (n operands) operations with D-algebraic functions.

[12]:

ADE1:=diff(y(x),x)^3+y(x)+1=0

[12]:

$\left(\frac{d}{d x}y \left(x \right)\right)^{3}+y \left(x \right)+1 = 0$
[13]:

ADE2:=diff(z(x),x)^2-z(x)-1=0

[13]:

$\left(\frac{d}{d x}z \left(x \right)\right)^{2}-z \left(x \right)-1 = 0$
[14]:

arithmeticDalg([ADE1,ADE2],[y(x),z(x)],w=y+z)

kilobytes used=19117, alloc=18738, time=2.86

[14]:

$-24 \left(\frac{d^{2}}{d x^{2}}w \left(x \right)\right)^{3}+36 \left(\frac{d^{2}}{d x^{2}}w \left(x \right)\right)^{2}-18 \frac{d^{2}}{d x^{2}}w \left(x \right)+8 \frac{d^{3}}{d x^{3}}w \left(x \right)+3 = 0$

## Remark 5.3 and Remark 5.4

[15]:

ADE1:=diff(y(x),x,x)*y(x)-diff(y(x),x)^2=0

[15]:

$\left(\frac{d^{2}}{d x^{2}}y \left(x \right)\right) y \left(x \right)-\left(\frac{d}{d x}y \left(x \right)\right)^{2} = 0$
[16]:

ADE2:=diff(z(x),x)^2+z(x)^2+1=0

[16]:

$\left(\frac{d}{d x}z \left(x \right)\right)^{2}+z \left(x \right)^{2}+1 = 0$
[17]:

arithmeticDalg([ADE1,ADE2],[y(x),z(x)],w=y+z)

[17]:

$w \left(x \right) \left(\frac{d^{2}}{d x^{2}}w \left(x \right)\right)+w \left(x \right) \left(\frac{d^{4}}{d x^{4}}w \left(x \right)\right)-\left(\frac{d}{d x}w \left(x \right)\right)^{2}-2 \left(\frac{d}{d x}w \left(x \right)\right) \left(\frac{d^{3}}{d x^{3}}w \left(x \right)\right)+\left(\frac{d^{2}}{d x^{2}}w \left(x \right)\right)^{2}+\left(\frac{d^{2}}{d x^{2}}w \left(x \right)\right) \left(\frac{d^{4}}{d x^{4}}w \left(x \right)\right)-\left(\frac{d^{3}}{d x^{3}}w \left(x \right)\right)^{2} = 0$

One can verify that $$f\pm i$$ is not a solution of the previous output ADE, where $$f$$ is a solution of ADE1, eg: $$f(x)=\exp(x)$$, and $$i$$ is the imaginary number, which is a constant solution of ADE2. This special case can be treated separately as shown below.

[18]:

unaryDalg(ADE1,y(x),w=y+I)

[18]:

$w \left(x \right) \left(\frac{d^{2}}{d x^{2}}w \left(x \right)\right)-\mathrm{I} \left(\frac{d^{2}}{d x^{2}}w \left(x \right)\right)-\left(\frac{d}{d x}w \left(x \right)\right)^{2} = 0$

An algebraic equation is seen as a zeroth-order differential equation.

[19]:

arithmeticDalg([ADE1,z(x)^2+1=0],[y(x),z(x)],w=y+z)

[19]:

$\left(\frac{d}{d x}w \left(x \right)\right) \left(\frac{d^{3}}{d x^{3}}w \left(x \right)\right)-\left(\frac{d^{2}}{d x^{2}}w \left(x \right)\right)^{2} = 0$

## Example 5.6 (SIR model)

Syntax of SystoMinDiffPoly: SystoMinDiffPoly([dy1,…,dyn],r(x,y1,…yn),[y1,…yn],w(x)),

where dy1,…,dyn, are the derivatives of y1,…yn, in terms of y1,…,yn, given rationally. x is the independent variable, and w is the name of the dependent variable for the output differential equation. The output is also called input-output equation.

[20]:

SystoMinDiffPoly([-beta*S*T-delta*S + mu, beta*S*T - gamma*T + nu, delta*S+gamma*T],R,[S,T,R],w(t))

kilobytes used=43192, alloc=18738, time=6.25

[20]:

$\left(-\beta \,\delta^{2}+2 \beta \delta \gamma -\beta \,\gamma^{2}\right) \left(\frac{d^{2}}{d t^{2}}w \left(t \right)\right) \left(\frac{d}{d t}w \left(t \right)\right) \left(\frac{d^{3}}{d t^{3}}w \left(t \right)\right)+\left(\beta^{2} \delta^{2} \gamma -\beta^{2} \delta \,\gamma^{2}\right) \left(\frac{d}{d t}w \left(t \right)\right)^{4}+\left(-2 \beta^{2} \delta^{2} \gamma \mu -2 \beta^{2} \delta^{2} \gamma \nu +2 \beta^{2} \delta \,\gamma^{2} \mu +2 \beta^{2} \delta \,\gamma^{2} \nu +2 \beta \,\delta^{3} \gamma^{2}+2 \beta \,\delta^{2} \gamma^{3}\right) \left(\frac{d}{d t}w \left(t \right)\right)^{3}+\left(\beta^{2} \delta^{2} \gamma \,\mu^{2}+2 \beta^{2} \delta^{2} \gamma \mu \nu +\beta^{2} \delta^{2} \gamma \,\nu^{2}-\beta^{2} \delta \,\gamma^{2} \mu^{2}-2 \beta^{2} \delta \,\gamma^{2} \mu \nu -\beta^{2} \delta \,\gamma^{2} \nu^{2}-8 \beta \,\delta^{3} \gamma^{2} \mu -4 \beta \,\delta^{3} \gamma^{2} \nu -4 \beta \,\delta^{2} \gamma^{3} \mu -8 \beta \,\delta^{2} \gamma^{3} \nu +\delta^{4} \gamma^{3}-\delta^{3} \gamma^{4}\right) \left(\frac{d}{d t}w \left(t \right)\right)^{2}+\left(10 \beta \,\delta^{3} \gamma^{2} \mu^{2}+12 \beta \,\delta^{3} \gamma^{2} \mu \nu +2 \beta \,\delta^{3} \gamma^{2} \nu^{2}+2 \beta \,\delta^{2} \gamma^{3} \mu^{2}+12 \beta \,\delta^{2} \gamma^{3} \mu \nu +10 \beta \,\delta^{2} \gamma^{3} \nu^{2}-2 \delta^{4} \gamma^{3} \mu -2 \delta^{4} \gamma^{3} \nu +2 \delta^{3} \gamma^{4} \mu +2 \delta^{3} \gamma^{4} \nu \right) \left(\frac{d}{d t}w \left(t \right)\right)-4 \beta \,\delta^{2} \gamma^{3} \mu^{2} \nu -8 \beta \,\delta^{2} \gamma^{3} \mu \,\nu^{2}-8 \beta \,\delta^{3} \gamma^{2} \mu^{2} \nu -4 \beta \,\delta^{3} \gamma^{2} \mu \,\nu^{2}+2 \delta^{4} \gamma^{3} \mu \nu -2 \delta^{3} \gamma^{4} \mu \nu -4 \beta \,\delta^{3} \gamma^{2} \mu^{3}-4 \beta \,\delta^{2} \gamma^{3} \nu^{3}+\left(\beta^{2} \delta^{2}-\beta^{2} \gamma^{2}\right) \left(\frac{d}{d t}w \left(t \right)\right)^{3} \left(\frac{d^{2}}{d t^{2}}w \left(t \right)\right)+\left(\beta^{2} \delta -\beta^{2} \gamma \right) \left(\frac{d}{d t}w \left(t \right)\right)^{2} \left(\frac{d^{2}}{d t^{2}}w \left(t \right)\right)^{2}+\left(-\beta^{2} \delta^{2} \mu -\beta^{2} \delta^{2} \nu +\beta^{2} \gamma^{2} \mu +\beta^{2} \gamma^{2} \nu +2 \beta \,\delta^{3} \gamma +8 \beta \,\delta^{2} \gamma^{2}+2 \beta \delta \,\gamma^{3}\right) \left(\frac{d}{d t}w \left(t \right)\right)^{2} \left(\frac{d^{2}}{d t^{2}}w \left(t \right)\right)+\left(6 \beta \,\delta^{2} \gamma +6 \beta \delta \,\gamma^{2}\right) \left(\frac{d^{2}}{d t^{2}}w \left(t \right)\right)^{2} \left(\frac{d}{d t}w \left(t \right)\right)+\left(-6 \beta \,\delta^{3} \gamma \mu -2 \beta \,\delta^{3} \gamma \nu -16 \beta \,\delta^{2} \gamma^{2} \mu -16 \beta \,\delta^{2} \gamma^{2} \nu -2 \beta \delta \,\gamma^{3} \mu -6 \beta \delta \,\gamma^{3} \nu +\delta^{4} \gamma^{2}-\delta^{2} \gamma^{4}\right) \left(\frac{d}{d t}w \left(t \right)\right) \left(\frac{d^{2}}{d t^{2}}w \left(t \right)\right)+\left(-\delta^{3} \gamma +\delta \,\gamma^{3}\right) \left(\frac{d^{2}}{d t^{2}}w \left(t \right)\right) \left(\frac{d^{3}}{d t^{3}}w \left(t \right)\right)+\delta^{4} \gamma^{3} \mu^{2}+\delta^{4} \gamma^{3} \nu^{2}-\delta^{3} \gamma^{4} \mu^{2}-\delta^{3} \gamma^{4} \nu^{2}+\left(\beta \,\delta^{2}+2 \beta \delta \gamma +\beta \,\gamma^{2}\right) \left(\frac{d^{2}}{d t^{2}}w \left(t \right)\right)^{3}+\left(-\beta \,\delta^{3} \mu -6 \beta \,\delta^{2} \gamma \mu -5 \beta \,\delta^{2} \gamma \nu -5 \beta \delta \,\gamma^{2} \mu -6 \beta \delta \,\gamma^{2} \nu -\beta \,\gamma^{3} \nu \right) \left(\frac{d^{2}}{d t^{2}}w \left(t \right)\right)^{2}+\left(4 \beta \,\delta^{3} \gamma \,\mu^{2}+4 \beta \,\delta^{3} \gamma \mu \nu +8 \beta \,\delta^{2} \gamma^{2} \mu^{2}+16 \beta \,\delta^{2} \gamma^{2} \mu \nu +8 \beta \,\delta^{2} \gamma^{2} \nu^{2}+4 \beta \delta \,\gamma^{3} \mu \nu +4 \beta \delta \,\gamma^{3} \nu^{2}-\delta^{4} \gamma^{2} \mu -\delta^{4} \gamma^{2} \nu +\delta^{2} \gamma^{4} \mu +\delta^{2} \gamma^{4} \nu \right) \left(\frac{d^{2}}{d t^{2}}w \left(t \right)\right)+\left(-\delta^{2} \gamma +\delta \,\gamma^{2}\right) \left(\frac{d^{3}}{d t^{3}}w \left(t \right)\right)^{2} = 0$

## Example 4.4

[21]:

ADE1:=diff(y(x),x)-y(x)=0:

[21]:

$w \left(x \right)^{2} \left(\frac{d^{2}}{d x^{2}}w \left(x \right)\right)^{2}+2 w \left(x \right) \left(\frac{d}{d x}w \left(x \right)\right)^{3}-2 w \left(x \right) \left(\frac{d}{d x}w \left(x \right)\right)^{2} \left(\frac{d^{2}}{d x^{2}}w \left(x \right)\right)+\left(\frac{d}{d x}w \left(x \right)\right)^{4} = 0$

## Example 5.5

[22]:

#The Weierstrass elliptic function:
DEp:=diff(p(x),x)^2=4*p(x)^3-g2*p(x)-g3:
#The rational function of it from the study of Feynman integrals:
K:=(-3*a1*a13*a24*p+a1^2*s1-2*a1*s2+3*s3)/(-3*a13*a24*p+3*a1^2-2*a1*s1+s2)

[22]:

$\frac{-3 \mathit{a1} \mathit{a13} \mathit{a24} p +\mathit{a1}^{2} \mathit{s1} -2 \mathit{a1} \mathit{s2} +3 \mathit{s3}}{-3 \mathit{a13} \mathit{a24} p +3 \mathit{a1}^{2}-2 \mathit{a1} \mathit{s1} +\mathit{s2}}$
[23]:

unaryDalg(DEp,p(x),w=K)

[23]:

$\left(27 \mathit{a1}^{6} \mathit{a13} \mathit{a24} -54 \mathit{a1}^{5} \mathit{a13} \mathit{a24} \mathit{s1} +27 \mathit{a1}^{4} \mathit{a13} \mathit{a24} \,\mathit{s1}^{2}+54 \mathit{a1}^{4} \mathit{a13} \mathit{a24} \mathit{s2} -54 \mathit{a1}^{3} \mathit{a13} \mathit{a24} \mathit{s1} \mathit{s2} -54 \mathit{a1}^{3} \mathit{a13} \mathit{a24} \mathit{s3} +54 \mathit{a1}^{2} \mathit{a13} \mathit{a24} \mathit{s1} \mathit{s3} +27 \mathit{a1}^{2} \mathit{a13} \mathit{a24} \,\mathit{s2}^{2}-54 \mathit{a1} \mathit{a13} \mathit{a24} \mathit{s2} \mathit{s3} +27 \mathit{a13} \mathit{a24} \,\mathit{s3}^{2}\right) \left(\frac{d}{d x}w \left(x \right)\right)^{2}+\left(27 \mathit{a1}^{2} \mathit{a13}^{2} \mathit{a24}^{2} \mathit{g2} -18 \mathit{a1} \,\mathit{a13}^{2} \mathit{a24}^{2} \mathit{g2} \mathit{s1} +27 \mathit{g3} \,\mathit{a13}^{3} \mathit{a24}^{3}-108 \mathit{a1}^{6}+216 \mathit{a1}^{5} \mathit{s1} -144 \mathit{a1}^{4} \mathit{s1}^{2}+32 \mathit{a1}^{3} \mathit{s1}^{3}+9 \mathit{a13}^{2} \mathit{a24}^{2} \mathit{g2} \mathit{s2} -108 \mathit{a1}^{4} \mathit{s2} +144 \mathit{a1}^{3} \mathit{s1} \mathit{s2} -48 \mathit{a1}^{2} \mathit{s1}^{2} \mathit{s2} -36 \mathit{a1}^{2} \mathit{s2}^{2}+24 \mathit{a1} \mathit{s1} \,\mathit{s2}^{2}-4 \mathit{s2}^{3}\right) w \left(x \right)^{4}+\left(-81 \mathit{a1}^{3} \mathit{a13}^{2} \mathit{a24}^{2} \mathit{g2} +45 \mathit{a1}^{2} \mathit{a13}^{2} \mathit{a24}^{2} \mathit{g2} \mathit{s1} -108 \mathit{a1} \,\mathit{a13}^{3} \mathit{a24}^{3} \mathit{g3} +108 \mathit{a1}^{7}-108 \mathit{a1}^{6} \mathit{s1} +16 \mathit{a1}^{4} \mathit{s1}^{3}-9 \mathit{a1} \,\mathit{a13}^{2} \mathit{a24}^{2} \mathit{g2} \mathit{s2} -108 \mathit{a1}^{5} \mathit{s2} +216 \mathit{a1}^{4} \mathit{s1} \mathit{s2} -96 \mathit{a1}^{3} \mathit{s1}^{2} \mathit{s2} -27 \mathit{a13}^{2} \mathit{a24}^{2} \mathit{g2} \mathit{s3} +324 \mathit{a1}^{4} \mathit{s3} -432 \mathit{a1}^{3} \mathit{s1} \mathit{s3} -108 \mathit{a1}^{3} \mathit{s2}^{2}+144 \mathit{a1}^{2} \mathit{s1}^{2} \mathit{s3} +84 \mathit{a1}^{2} \mathit{s1} \,\mathit{s2}^{2}+216 \mathit{a1}^{2} \mathit{s2} \mathit{s3} -144 \mathit{a1} \mathit{s1} \mathit{s2} \mathit{s3} -20 \mathit{a1} \,\mathit{s2}^{3}+36 \mathit{s2}^{2} \mathit{s3} \right) w \left(x \right)^{3}+\left(81 \mathit{a1}^{4} \mathit{a13}^{2} \mathit{a24}^{2} \mathit{g2} -27 \mathit{a1}^{3} \mathit{a13}^{2} \mathit{a24}^{2} \mathit{g2} \mathit{s1} +162 \mathit{a1}^{2} \mathit{a13}^{3} \mathit{a24}^{3} \mathit{g3} -108 \mathit{a1}^{7} \mathit{s1} +108 \mathit{a1}^{6} \mathit{s1}^{2}-24 \mathit{a1}^{5} \mathit{s1}^{3}-27 \mathit{a1}^{2} \mathit{a13}^{2} \mathit{a24}^{2} \mathit{g2} \mathit{s2} +216 \mathit{a1}^{6} \mathit{s2} -216 \mathit{a1}^{5} \mathit{s1} \mathit{s2} +36 \mathit{a1}^{4} \mathit{s1}^{2} \mathit{s2} +81 \mathit{a1} \,\mathit{a13}^{2} \mathit{a24}^{2} \mathit{g2} \mathit{s3} -324 \mathit{a1}^{5} \mathit{s3} +216 \mathit{a1}^{4} \mathit{s1} \mathit{s3} +36 \mathit{a1}^{3} \mathit{s1} \,\mathit{s2}^{2}+216 \mathit{a1}^{3} \mathit{s2} \mathit{s3} -216 \mathit{a1}^{2} \mathit{s1} \mathit{s2} \mathit{s3} -24 \mathit{a1}^{2} \mathit{s2}^{3}-324 \mathit{a1}^{2} \mathit{s3}^{2}+216 \mathit{a1} \mathit{s1} \,\mathit{s3}^{2}+108 \mathit{a1} \,\mathit{s2}^{2} \mathit{s3} -108 \mathit{s2} \,\mathit{s3}^{2}\right) w \left(x \right)^{2}+\left(-27 \mathit{a1}^{5} \mathit{a13}^{2} \mathit{a24}^{2} \mathit{g2} -9 \mathit{a1}^{4} \mathit{a13}^{2} \mathit{a24}^{2} \mathit{g2} \mathit{s1} -108 \mathit{a1}^{3} \mathit{a13}^{3} \mathit{a24}^{3} \mathit{g3} +36 \mathit{a1}^{7} \mathit{s1}^{2}-20 \mathit{a1}^{6} \mathit{s1}^{3}+45 \mathit{a1}^{3} \mathit{a13}^{2} \mathit{a24}^{2} \mathit{g2} \mathit{s2} -144 \mathit{a1}^{6} \mathit{s1} \mathit{s2} +84 \mathit{a1}^{5} \mathit{s1}^{2} \mathit{s2} -81 \mathit{a1}^{2} \mathit{a13}^{2} \mathit{a24}^{2} \mathit{g2} \mathit{s3} +216 \mathit{a1}^{5} \mathit{s1} \mathit{s3} +144 \mathit{a1}^{5} \mathit{s2}^{2}-108 \mathit{a1}^{4} \mathit{s1}^{2} \mathit{s3} -96 \mathit{a1}^{4} \mathit{s1} \,\mathit{s2}^{2}-432 \mathit{a1}^{4} \mathit{s2} \mathit{s3} +216 \mathit{a1}^{3} \mathit{s1} \mathit{s2} \mathit{s3} +16 \mathit{a1}^{3} \mathit{s2}^{3}+324 \mathit{a1}^{3} \mathit{s3}^{2}-108 \mathit{a1}^{2} \mathit{s1} \,\mathit{s3}^{2}-108 \mathit{a1} \mathit{s2} \,\mathit{s3}^{2}+108 \mathit{s3}^{3}\right) w \left(x \right)+9 \mathit{a1}^{5} \mathit{a13}^{2} \mathit{a24}^{2} \mathit{g2} \mathit{s1} +27 \mathit{a1}^{4} \mathit{a13}^{3} \mathit{a24}^{3} \mathit{g3} -4 \mathit{a1}^{7} \mathit{s1}^{3}-18 \mathit{a1}^{4} \mathit{a13}^{2} \mathit{a24}^{2} \mathit{g2} \mathit{s2} +24 \mathit{a1}^{6} \mathit{s1}^{2} \mathit{s2} +27 \mathit{a1}^{3} \mathit{a13}^{2} \mathit{a24}^{2} \mathit{g2} \mathit{s3} -36 \mathit{a1}^{5} \mathit{s1}^{2} \mathit{s3} -48 \mathit{a1}^{5} \mathit{s1} \,\mathit{s2}^{2}+144 \mathit{a1}^{4} \mathit{s1} \mathit{s2} \mathit{s3} +32 \mathit{a1}^{4} \mathit{s2}^{3}-108 \mathit{a1}^{3} \mathit{s1} \,\mathit{s3}^{2}-144 \mathit{a1}^{3} \mathit{s2}^{2} \mathit{s3} +216 \mathit{a1}^{2} \mathit{s2} \,\mathit{s3}^{2}-108 \mathit{a1} \,\mathit{s3}^{3} = 0$

## Example 5.7

[24]:

ADE1:= diff(y(x), x) - y(x) = 0:

kilobytes used=62463, alloc=18738, time=8.56

[24]:

$24 x \left(\frac{d}{d x}w \left(x \right)\right)^{2} w \left(x \right)^{4}+w \left(x \right)^{6}-2 w \left(x \right)^{5} \left(\frac{d^{3}}{d x^{3}}w \left(x \right)\right)+6 \left(\frac{d^{2}}{d x^{2}}w \left(x \right)\right) \left(\frac{d}{d x}w \left(x \right)\right) w \left(x \right)^{4}+\left(\frac{d^{3}}{d x^{3}}w \left(x \right)\right)^{2} w \left(x \right)^{4}-4 \left(\frac{d}{d x}w \left(x \right)\right)^{3} w \left(x \right)^{3}-24 \left(\frac{d^{2}}{d x^{2}}w \left(x \right)\right) \left(\frac{d}{d x}w \left(x \right)\right)^{2} w \left(x \right)^{3}-6 \left(\frac{d^{3}}{d x^{3}}w \left(x \right)\right) \left(\frac{d^{2}}{d x^{2}}w \left(x \right)\right) \left(\frac{d}{d x}w \left(x \right)\right) w \left(x \right)^{3}+24 \left(\frac{d}{d x}w \left(x \right)\right)^{4} w \left(x \right)^{2}+4 \left(\frac{d^{3}}{d x^{3}}w \left(x \right)\right) \left(\frac{d}{d x}w \left(x \right)\right)^{3} w \left(x \right)^{2}+9 \left(\frac{d^{2}}{d x^{2}}w \left(x \right)\right)^{2} \left(\frac{d}{d x}w \left(x \right)\right)^{2} w \left(x \right)^{2}-12 \left(\frac{d^{2}}{d x^{2}}w \left(x \right)\right) \left(\frac{d}{d x}w \left(x \right)\right)^{4} w \left(x \right)+4 \left(\frac{d}{d x}w \left(x \right)\right)^{6} = 0$
[25]:

ADE3:= 2*x*diff(y(x), x) - y(x) = 0:

kilobytes used=9085777, alloc=251376, time=1064.03

[25]:

$48 x^{2} w \left(x \right)^{3} \left(\frac{d}{d x}w \left(x \right)\right)^{2}-24 x w \left(x \right)^{4} \left(\frac{d}{d x}w \left(x \right)\right)+2 x w \left(x \right)^{3} \left(\frac{d^{3}}{d x^{3}}w \left(x \right)\right)^{2}+4 x w \left(x \right)^{2} \left(\frac{d}{d x}w \left(x \right)\right) \left(\frac{d^{2}}{d x^{2}}w \left(x \right)\right) \left(\frac{d^{3}}{d x^{3}}w \left(x \right)\right)-8 x w \left(x \right) \left(\frac{d}{d x}w \left(x \right)\right)^{3} \left(\frac{d^{3}}{d x^{3}}w \left(x \right)\right)-6 x w \left(x \right) \left(\frac{d}{d x}w \left(x \right)\right)^{2} \left(\frac{d^{2}}{d x^{2}}w \left(x \right)\right)^{2}-24 x \left(\frac{d}{d x}w \left(x \right)\right)^{4} \left(\frac{d^{2}}{d x^{2}}w \left(x \right)\right)+3 w \left(x \right)^{5}-2 \left(\frac{d^{3}}{d x^{3}}w \left(x \right)\right) \left(\frac{d^{2}}{d x^{2}}w \left(x \right)\right) w \left(x \right)^{3}-2 \left(\frac{d^{3}}{d x^{3}}w \left(x \right)\right) \left(\frac{d}{d x}w \left(x \right)\right)^{2} w \left(x \right)^{2}+2 \left(\frac{d^{2}}{d x^{2}}w \left(x \right)\right)^{2} \left(\frac{d}{d x}w \left(x \right)\right) w \left(x \right)^{2}+10 \left(\frac{d}{d x}w \left(x \right)\right)^{3} \left(\frac{d^{2}}{d x^{2}}w \left(x \right)\right) w \left(x \right)+8 \left(\frac{d}{d x}w \left(x \right)\right)^{5} = 0$

## Bonus material: checking the validity of the outputs

We here demonstrate how one can verify the correctness of the outputs when the solutions of the input ADEs can be found. Given two algebraic differential equations ADE1 and ADE2, such that $$f$$ fulfils ADE1 and $$g$$ fulfills ADE2, the output ADE is valid if it vanishes at $$\alpha(f,g)=f\alpha g$$, where $$\alpha$$ (e.g.: $$+, \times, /, \circ$$) is the operation used to compute the output ADE.

[26]:

ADE1:=(1 + x)*diff(y(x), x)=1

[26]:

$\left(1+x \right) \left(\frac{d}{d x}y \left(x \right)\right) = 1$

We solve ADEs using Maple’s dsolve command.

[27]:

dsolve(ADE1,y(x))

[27]:

$y \left(x \right) = \ln \left(1+x \right)+\textit{\_C1}$
[28]:

ADE2:=-z(x)^2 - 2*diff(z(x), x)^2 + diff(z(x), x, x)*z(x) = 0

[28]:

$-z \left(x \right)^{2}-2 \left(\frac{d}{d x}z \left(x \right)\right)^{2}+\left(\frac{d^{2}}{d x^{2}}z \left(x \right)\right) z \left(x \right) = 0$
[29]:

dsolve(ADE2,z(x))

[29]:

$z \left(x \right) = \frac{1}{\textit{\_C1} \sin \left(x \right)-\textit{\_C2} \cos \left(x \right)}$

We will verify our result with $$1/\sin(x)$$ from ADE2 and $$\log(1+x)$$ from ADE1

[30]:

ADE3:=composeDalg([ADE1,ADE2],[y(x),z(x)],w(x))

kilobytes used=9329700, alloc=250352, time=1105.47

[30]:

$-\left(\frac{d}{d x}w \left(x \right)\right)^{7}-3 \left(\frac{d}{d x}w \left(x \right)\right)^{5} \left(\frac{d^{2}}{d x^{2}}w \left(x \right)\right)+7 \left(\frac{d}{d x}w \left(x \right)\right)^{5}+\left(\frac{d}{d x}w \left(x \right)\right)^{4} \left(\frac{d^{3}}{d x^{3}}w \left(x \right)\right)-3 \left(\frac{d}{d x}w \left(x \right)\right)^{3} \left(\frac{d^{2}}{d x^{2}}w \left(x \right)\right)^{2}+6 \left(\frac{d}{d x}w \left(x \right)\right)^{3} \left(\frac{d^{2}}{d x^{2}}w \left(x \right)\right)+6 \left(\frac{d}{d x}w \left(x \right)\right)^{2} \left(\frac{d^{2}}{d x^{2}}w \left(x \right)\right) \left(\frac{d^{3}}{d x^{3}}w \left(x \right)\right)-9 \left(\frac{d}{d x}w \left(x \right)\right) \left(\frac{d^{2}}{d x^{2}}w \left(x \right)\right)^{3}+8 \left(\frac{d}{d x}w \left(x \right)\right)^{3}-8 \left(\frac{d}{d x}w \left(x \right)\right)^{2} \left(\frac{d^{3}}{d x^{3}}w \left(x \right)\right)+15 \left(\frac{d^{2}}{d x^{2}}w \left(x \right)\right)^{2} \left(\frac{d}{d x}w \left(x \right)\right)+2 \left(\frac{d}{d x}w \left(x \right)\right) \left(\frac{d^{3}}{d x^{3}}w \left(x \right)\right)^{2}-3 \left(\frac{d^{2}}{d x^{2}}w \left(x \right)\right)^{2} \left(\frac{d^{3}}{d x^{3}}w \left(x \right)\right) = 0$
[31]:

simplify(eval(ADE3,w(x)=log(1+1/sin(x))))

[31]:

$0 = 0$
[32]:

ADE4:=arithmeticDalg([ADE1,ADE2],[y(x),z(x)],w=y+z)

kilobytes used=9401693, alloc=250352, time=1113.92

[32]:

$\left(\frac{d}{d x}w \left(x \right)\right)^{3} \left(8 x^{7}+56 x^{6}+168 x^{5}+280 x^{4}+280 x^{3}+168 x^{2}+56 x +8\right)+\left(\frac{d}{d x}w \left(x \right)\right)^{2} \left(\frac{d^{3}}{d x^{3}}w \left(x \right)\right) \left(-8 x^{7}-56 x^{6}-168 x^{5}-280 x^{4}-280 x^{3}-168 x^{2}-56 x -8\right)+\left(\frac{d}{d x}w \left(x \right)\right)^{2} \left(-24 x^{6}-144 x^{5}-344 x^{4}-416 x^{3}-264 x^{2}-80 x -8\right)+\left(\frac{d^{2}}{d x^{2}}w \left(x \right)\right)^{2} \left(\frac{d}{d x}w \left(x \right)\right) \left(15 x^{7}+105 x^{6}+315 x^{5}+525 x^{4}+525 x^{3}+315 x^{2}+105 x +15\right)+\left(\frac{d}{d x}w \left(x \right)\right) \left(\frac{d^{2}}{d x^{2}}w \left(x \right)\right) \left(30 x^{5}+150 x^{4}+300 x^{3}+300 x^{2}+150 x +30\right)+\left(\frac{d}{d x}w \left(x \right)\right) \left(\frac{d^{3}}{d x^{3}}w \left(x \right)\right)^{2} \left(2 x^{7}+14 x^{6}+42 x^{5}+70 x^{4}+70 x^{3}+42 x^{2}+14 x +2\right)+\left(\frac{d}{d x}w \left(x \right)\right) \left(\frac{d^{3}}{d x^{3}}w \left(x \right)\right) \left(16 x^{6}+96 x^{5}+232 x^{4}+288 x^{3}+192 x^{2}+64 x +8\right)+\left(\frac{d}{d x}w \left(x \right)\right) \left(24 x^{5}+120 x^{4}+223 x^{3}+189 x^{2}+77 x +15\right)+\left(\frac{d^{2}}{d x^{2}}w \left(x \right)\right)^{2} \left(\frac{d^{3}}{d x^{3}}w \left(x \right)\right) \left(-3 x^{7}-21 x^{6}-63 x^{5}-105 x^{4}-105 x^{3}-63 x^{2}-21 x -3\right)+\left(\frac{d^{2}}{d x^{2}}w \left(x \right)\right)^{2} \left(-15 x^{6}-90 x^{5}-219 x^{4}-276 x^{3}-189 x^{2}-66 x -9\right)+\left(\frac{d^{2}}{d x^{2}}w \left(x \right)\right) \left(\frac{d^{3}}{d x^{3}}w \left(x \right)\right) \left(-6 x^{5}-30 x^{4}-60 x^{3}-60 x^{2}-30 x -6\right)+\left(\frac{d^{2}}{d x^{2}}w \left(x \right)\right) \left(-30 x^{4}-120 x^{3}-168 x^{2}-96 x -18\right)+\left(\frac{d^{3}}{d x^{3}}w \left(x \right)\right)^{2} \left(-2 x^{6}-12 x^{5}-30 x^{4}-40 x^{3}-30 x^{2}-12 x -2\right)+\left(\frac{d^{3}}{d x^{3}}w \left(x \right)\right) \left(-8 x^{5}-40 x^{4}-75 x^{3}-65 x^{2}-25 x -3\right)-8 x^{4}-32 x^{3}-47 x^{2}-30 x -9 = 0$
[33]:

simplify(eval(ADE4,w(x)=1/sin(x)+log(1+x)))

[33]:

$0 = 0$
[34]:

ADE5:=arithmeticDalg([ADE1,ADE2],[y(x),z(x)],w=y*z)

kilobytes used=14742881, alloc=262640, time=1613.45

[34]:

$\left(-x^{2}-2 x -3\right) w \left(x \right)^{2}+\left(-2-2 x \right) w \left(x \right) \left(\frac{d}{d x}w \left(x \right)\right)+\left(4 x^{2}+8 x +6\right) w \left(x \right) \left(\frac{d^{2}}{d x^{2}}w \left(x \right)\right)+\left(1+x \right) \left(\frac{d^{3}}{d x^{3}}w \left(x \right)\right) w \left(x \right)+\left(-6 x^{2}-12 x -10\right) \left(\frac{d}{d x}w \left(x \right)\right)^{2}+\left(-3 x -3\right) \left(\frac{d}{d x}w \left(x \right)\right) \left(\frac{d^{2}}{d x^{2}}w \left(x \right)\right)+\left(2 x^{2}+4 x +2\right) \left(\frac{d}{d x}w \left(x \right)\right) \left(\frac{d^{3}}{d x^{3}}w \left(x \right)\right)+\left(-3 x^{2}-6 x -3\right) \left(\frac{d^{2}}{d x^{2}}w \left(x \right)\right)^{2} = 0$
[35]:

simplify(eval(ADE5,w(x)=1/sin(x)*log(1+x)))

[35]:

$0 = 0$
[36]:

ADE6:=arithmeticDalg([ADE1,ADE2],[y(x),z(x)],w=y/z)

kilobytes used=14996087, alloc=262640, time=1640.47

[36]:

$\left(8 x^{4}+32 x^{3}+47 x^{2}+30 x +9\right) w \left(x \right)^{2}+\left(20 x^{3}+60 x^{2}+58 x +18\right) w \left(x \right) \left(\frac{d}{d x}w \left(x \right)\right)+\left(8 x^{4}+32 x^{3}+56 x^{2}+48 x +18\right) w \left(x \right) \left(\frac{d^{2}}{d x^{2}}w \left(x \right)\right)+\left(8 x^{3}+24 x^{2}+25 x +9\right) \left(\frac{d^{3}}{d x^{3}}w \left(x \right)\right) w \left(x \right)+\left(12 x^{4}+48 x^{3}+70 x^{2}+44 x +10\right) \left(\frac{d}{d x}w \left(x \right)\right)^{2}+\left(24 x^{3}+72 x^{2}+69 x +21\right) \left(\frac{d}{d x}w \left(x \right)\right) \left(\frac{d^{2}}{d x^{2}}w \left(x \right)\right)+\left(16 x^{4}+64 x^{3}+94 x^{2}+60 x +14\right) \left(\frac{d}{d x}w \left(x \right)\right) \left(\frac{d^{3}}{d x^{3}}w \left(x \right)\right)+\left(9 x^{2}+18 x +9\right) \left(\frac{d^{2}}{d x^{2}}w \left(x \right)\right)^{2}+\left(12 x^{3}+36 x^{2}+36 x +12\right) \left(\frac{d^{2}}{d x^{2}}w \left(x \right)\right) \left(\frac{d^{3}}{d x^{3}}w \left(x \right)\right)+\left(4 x^{4}+16 x^{3}+24 x^{2}+16 x +4\right) \left(\frac{d^{3}}{d x^{3}}w \left(x \right)\right)^{2} = 0$
[37]:

simplify(eval(ADE6,w(x)=sin(x)*log(1+x)))

[37]:

$0 = 0$
[38]:

ADE7:=unaryDalg(ADE1,y(x),w=(y+1)^3)

[38]:

$-27 w \left(x \right)^{2}+\left(x^{3}+3 x^{2}+3 x +1\right) \left(\frac{d}{d x}w \left(x \right)\right)^{3} = 0$
[39]:

simplify(eval(ADE7,w(x)=(log(1+x)^3)))

[39]:

$0 = 0$

## Conclusion

The package is useful for practical computations with D-algebraic functions, i.e., solutions to algebraic differential equations. However, we point out that sometimes the running time can be very high due to elimination computations happening internally.