---
title: "Differential Rings and Fields"
canonical: "https://docs.magma-maths.org/v2.30-1/CommutativeAlgebra/DifferentialRings/creation-diff-rings.html"
source: "https://docs.magma-maths.org/v2.30-1/CommutativeAlgebra/DifferentialRings/creation-diff-rings.md"
part: "Commutative Algebra"
chapter: "Differential Rings"
breadcrumbs:
  - {"title": "Magma Handbook", "source": "https://docs.magma-maths.org/v2.30-1/index.md"}
  - {"title": "Commutative Algebra", "source": "https://docs.magma-maths.org/v2.30-1/CommutativeAlgebra/index-commutative-algebra.md"}
  - {"title": "Differential Rings", "source": "https://docs.magma-maths.org/v2.30-1/CommutativeAlgebra/DifferentialRings/index-differential-rings.md"}
prev: {"title": "Introduction", "source": "https://docs.magma-maths.org/v2.30-1/CommutativeAlgebra/DifferentialRings/introduction.md"}
next: {"title": "Structure Operations on Differential Rings", "source": "https://docs.magma-maths.org/v2.30-1/CommutativeAlgebra/DifferentialRings/structure-operations-diff-rings.md"}
intrinsics:
  - {"name": "DifferentialRing", "signature": "DifferentialRing(P, f, C): Rng, Map, Rng -> RngDiff"}
  - {"name": "RationalDifferentialField", "signature": "RationalDifferentialField(C): Fld -> RngDiff"}
  - {"name": "DifferentialLaurentSeriesRing", "signature": "DifferentialLaurentSeriesRing(C): Fld -> RngDiff"}
  - {"name": "RingOfFractions", "signature": "RingOfFractions(R): RngDiff -> RngDiff, Map"}
  - {"name": "FieldOfFractions", "signature": "FieldOfFractions(R): RngDiff -> RngDiff, Map"}
  - {"name": "AssignNames", "signature": "AssignNames(~R, S): RngDiff, [MonStgElt]"}
  - {"name": "Name", "signature": "Name(R, i): RngDiff, RngIntElt -> RngDiffElt"}
  - {"name": ".", "signature": "R . i: RngDiff, RngIntElt -> RngDiffElt"}
  - {"name": "!", "signature": "R ! s: RngDiff, RngElt -> RngDiffElt"}
  - {"name": "Zero", "signature": "Zero(R): RngDiff -> RngDiffElt"}
  - {"name": "One", "signature": "One(R): RngDiff -> RngDiffElt"}
  - {"name": "Identity", "signature": "Identity(R): RngDiff -> RngDiffElt"}
  - {"name": "SeparatingElement", "signature": "SeparatingElement(F): RngDiff -> RngDiffElt"}
examples:
  - "ex-dba016"
  - "ex-c5e585"
  - "ex-d698ec"
  - "ex-284f4d"
---

# Differential Rings and Fields

## Creation

There are two ways to create a differential ring. The first creation is a general creation of a differential ring, for which the user specifies the ring and its derivation. The second creates a differential field which has the structure of a rational function field of transcendence degree $1$ over its base field. Its derivation is specified by a differential.

Once a differential ring is created one can ask for its ring or field of fractions.

<a id="function-differentialring-rng-map-rng"></a>
### `DifferentialRing(P, f, C): Rng, Map, Rng -> RngDiff`

Given a ring $P$ and derivation $f$ acting on $P$, return the differential ring isomorphic to $P$, with induced derivation $f$ acting on it, and ring of constants $C$. The ring $C$ should be a subring of $P$ on which $f$ is zero.

<a id="example-ex-dba016"></a>
### `Example: Creating a General Differential Ring (ex-dba016)`

Here we illustrate the creation and printing of a general differential ring.

```magma
> P := PolynomialRing(Rationals());
> f := map<P->P | a:->5*Derivative(a)>;
> R := DifferentialRing(P, f, Rationals());
> R;
Differential Ring of Univariate Polynomial Ring over
Rational Field with derivation given by Mapping
from: RngUPol: P to RngUPol: P given by a rule [no inverse]
```

<a id="function-rationaldifferentialfield-fld"></a>
### `RationalDifferentialField(C): Fld -> RngDiff`

The differential field in one variable over the constant field $C$. If this field is called $F$, say, then the derivation on $F$ is given by ${d} / (1) {d} (F.1)$, where $F.1$ is the variable of $F$, and $(1) {d} (F.1)$ is its differential in the differential space of $F$. Any exact field with polynomial GCD is valid input for $C$.

<a id="example-ex-c5e585"></a>
### `Example: Creating a Rational Differential Field (ex-c5e585)`

Here we illustrate the creation and printing of the differential field obtained from the command `RationalDifferentialField`.

```magma
> F<z> := RationalDifferentialField(Rationals());
> F;
Differential Ring of Algebraic function field defined over
Rational Field by $.2 - 4711 with
derivation given by (1) d(z)
```

<a id="function-differentiallaurentseriesring-fld"></a>
### `DifferentialLaurentSeriesRing(C): Fld -> RngDiff`

The differential Laurent series ring (in one variable) over the constant field $C$. If this field is called $F$, say, then the derivation on $F$ is given by $F.1 \cdot {d} /  {d} (F.1)$, where $F.1$ is the variable of $F$.

<a id="example-ex-d698ec"></a>
### `Example: Creating a Differential Laurent Series Ring (ex-d698ec)`

This example illustrates the creation and printing of the differential Laurent series ring obtained from the command `DifferentialLaurentSeriesRing`.

```magma
> S<t> := DifferentialLaurentSeriesRing(Rationals());
> S;
Differential Ring of Laurent series field in t over Rational Field
with derivation given by Mapping from: Laurent series field in t over Rational
Field to Laurent series field in t over Rational Field given by a rule [no
inverse]
```

<a id="function-ringoffractions-rngdiff"></a>
### `RingOfFractions(R): RngDiff -> RngDiff, Map`

Returns the differential ring $R[r^{-1}: r \in R {\rm\ not \ a\ zero\ divisor}]$ of fractions of the differential ring $R$, together with the inclusion map from $R$ to the newly created ring.

<a id="function-fieldoffractions-rngdiff"></a>
### `FieldOfFractions(R): RngDiff -> RngDiff, Map`

Returns the differential field of fractions of the differential ring $R$, together with the inclusion map from $R$ to the newly created field.

<a id="procedure-assignnames-rngdiff-monstgelt-ref"></a>
### `AssignNames(~R, S): RngDiff, [MonStgElt]`

Given a differential ring $R$ with $n$ indeterminates and a sequence $S$ of $n$ strings, assign the elements of $S$ to the names of the variables of $R$.

This procedure only changes the names used in the printing of the elements of $R$.

## Creation of Differential Ring Elements

The easiest way to create an element in a given ring is to use the angle bracket construction to attach names to the indeterminates of the ring. Others are given below.

<a id="function-name-rngdiff-rngintelt"></a>
### `Name(R, i): RngDiff, RngIntElt -> RngDiffElt`

<a id="operation-operation-rngdiff-rngintelt-rngdiffelt"></a>
### `R . i: RngDiff, RngIntElt -> RngDiffElt`

The $i$-th indeterminate of the differential ring $R$, where $i$ is between $1$ and the number of generators of $R$.

<a id="operation-op-rngdiff-rngelt"></a>
### `R ! s: RngDiff, RngElt -> RngDiffElt`

Coerce the element $s$ in the differential ring $R$. Elements that are coercible are elements that are coercible in the underlying ring of the differential ring $R$.

<a id="function-zero-rngdiff"></a>
### `Zero(R): RngDiff -> RngDiffElt`

The zero element of the differential ring $R$.

<a id="function-one-rngdiff"></a>
### `One(R): RngDiff -> RngDiffElt`

<a id="function-identity-rngdiff"></a>
### `Identity(R): RngDiff -> RngDiffElt`

The identity element of the differential ring $R$.

<a id="function-separatingelement-rngdiff"></a>
### `SeparatingElement(F): RngDiff -> RngDiffElt`

Returns the separating element of the algebraic differential field $F$.

<a id="example-ex-284f4d"></a>
### `Example: Creating Differential Field Elements (ex-284f4d)`

We construct the differential field $F={\mathbb{Q}}(z)$ with derivation ${d}/ {d}z$ and show some of the elements that can be created.

```magma
> F<z> := RationalDifferentialField(Rationals());
> F.1;
z
> two := F!2;
> two;
2
> Parent(two) eq F;
true
> Zero(F); One(F);
0
1
> Parent(Zero(F)) eq F and Parent(Identity(F)) eq F;
true
> elt := SeparatingElement(F);
> elt;
z
> ISA(Type(elt),RngDiffElt);
true
> Parent(elt) eq F;
true
> elt eq F!SeparatingElement(UnderlyingRing(F));
true
```
