---
title: "Element Operations on Differential Ring Elements"
canonical: "https://docs.magma-maths.org/v2.30-1/CommutativeAlgebra/DifferentialRings/element-operations.html"
source: "https://docs.magma-maths.org/v2.30-1/CommutativeAlgebra/DifferentialRings/element-operations.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": "Structure Operations on Differential Rings", "source": "https://docs.magma-maths.org/v2.30-1/CommutativeAlgebra/DifferentialRings/structure-operations-diff-rings.md"}
next: {"title": "Changing Related Structures", "source": "https://docs.magma-maths.org/v2.30-1/CommutativeAlgebra/DifferentialRings/changing-attributes-diff-rings.md"}
intrinsics:
  - {"name": "Category", "signature": "Category(s): RngDiffElt -> RngDiffElt"}
  - {"name": "Type", "signature": "Type(s): RngDiffElt -> RngDiffElt"}
  - {"name": "Parent", "signature": "Parent(s): RngDiffElt -> RngDiff"}
  - {"name": "+", "signature": "s + t: RngDiffElt, RngDiffElt -> RngDiffElt"}
  - {"name": "-", "signature": "- s: RngDiffElt -> RngDiffElt"}
  - {"name": "-", "signature": "s - t: RngDiffElt, RngDiffElt -> RngDiffElt"}
  - {"name": "*", "signature": "s * t: RngDiffElt, RngDiffElt -> RngDiffElt"}
  - {"name": "^", "signature": "s ^ n: RngDiffElt, RngIntElt -> RngDiffElt"}
  - {"name": "div", "signature": "s div t: RngDiffElt, RngDiffElt -> RngDiffElt"}
  - {"name": "/", "signature": "s / t: RngDiffElt, RngDiffElt -> RngDiffElt"}
  - {"name": "eq", "signature": "s eq t: RngDiffElt, RngDiffElt -> BoolElt"}
  - {"name": "IsZero", "signature": "IsZero(s): RngDiffElt -> BoolElt"}
  - {"name": "IsOne", "signature": "IsOne(s): RngDiffElt -> BoolElt"}
  - {"name": "IsWeaklyEqual", "signature": "IsWeaklyEqual(s, t): RngDiffElt, RngDiffElt -> BoolElt"}
  - {"name": "IsWeaklyZero", "signature": "IsWeaklyZero(s): RngDiffElt -> BoolElt"}
  - {"name": "IsOrderTerm", "signature": "IsOrderTerm(s): RngDiffElt -> BoolElt"}
  - {"name": "IsOrderTerm", "signature": "IsOrderTerm(s): RngSerElt -> BoolElt"}
  - {"name": "O", "signature": "O(s): RngDiffElt -> RngDiffElt"}
  - {"name": "Truncate", "signature": "Truncate(s): RngDiffElt -> RngDiffElt"}
  - {"name": "Eltseq", "signature": "Eltseq(s): RngDiffElt -> SeqEnum"}
  - {"name": "Exponents", "signature": "Exponents(s): RngDiffElt -> SeqEnum"}
  - {"name": "Exponents", "signature": "Exponents(s): RngSerElt -> SeqEnum"}
  - {"name": "MinimalPolynomial", "signature": "MinimalPolynomial(s): RngDiffElt -> RngUPolElt"}
  - {"name": "Derivative", "signature": "Derivative(s): RngDiffElt -> RngDiffElt"}
  - {"name": "Differential", "signature": "Differential(s): RngDiffElt -> RngDiffElt"}
examples:
  - "ex-61c4b6"
  - "ex-18d9d7"
  - "ex-4eef4b"
  - "ex-ecfdbc"
  - "ex-396a0f"
---

# Element Operations on Differential Ring Elements

## Category and Parent

<a id="function-category-rngdiffelt"></a>
### `Category(s): RngDiffElt -> RngDiffElt`

<a id="function-type-rngdiffelt"></a>
### `Type(s): RngDiffElt -> RngDiffElt`

The category, or type, of the differential ring element $s$.

<a id="function-parent-rngdiffelt"></a>
### `Parent(s): RngDiffElt -> RngDiff`

The parent of the differential ring element $s$.

## Arithmetic

All the usual arithmetic operations are possible for differential ring elements.

<a id="operation-op-plus-rngdiffelt-rngdiffelt"></a>
### `s + t: RngDiffElt, RngDiffElt -> RngDiffElt`

The sum of the two differential ring elements $s$ and $t$.

<a id="operation-operation-rngdiffelt-rngdiffelt"></a>
### `- s: RngDiffElt -> RngDiffElt`

The negation of the differential ring element $s$.

<a id="operation-op-minus-rngdiffelt-rngdiffelt"></a>
### `s - t: RngDiffElt, RngDiffElt -> RngDiffElt`

The difference between the differential ring elements $s$ and $t$.

<a id="operation-op-times-rngdiffelt-rngdiffelt"></a>
### `s * t: RngDiffElt, RngDiffElt -> RngDiffElt`

The product of the differential ring elements $s$ and $t$.

<a id="operation-op-pow-rngdiffelt-rngintelt"></a>
### `s ^ n: RngDiffElt, RngIntElt -> RngDiffElt`

Given a differential ring element $s$ and an integer $n$, return the $n$-th power of $s$. If $s$ is invertible, $n$ may be negative.

<a id="operation-operation-div-rngdiffelt-rngdiffelt-rngdiffelt"></a>
### `s div t: RngDiffElt, RngDiffElt -> RngDiffElt`

Given the differential ring elements $s$ and $t$, return the exact division of $s$ by $t$, if $s$ is divisible by $t$.

<a id="operation-op-div-rngdiffelt-rngdiffelt"></a>
### `s / t: RngDiffElt, RngDiffElt -> RngDiffElt`

Given the differential field elements $s$ and $t$, return $s$ divided by $t$.

## Predicates and Booleans

<a id="operation-op-eq-rngdiffelt-rngdiffelt"></a>
### `s eq t: RngDiffElt, RngDiffElt -> BoolElt`

Return `true` iff the differential ring elements $s$ and $t$ are exactly the same.

<a id="function-iszero-rngdiffelt"></a>
### `IsZero(s): RngDiffElt -> BoolElt`

Return `true` iff the differential ring element $s$ is the zero element of its parent.

<a id="function-isone-rngdiffelt"></a>
### `IsOne(s): RngDiffElt -> BoolElt`

Return `true` iff the differential ring element $s$ is the unity element of its parent.

<a id="function-isweaklyequal-rngdiffelt-rngdiffelt"></a>
### `IsWeaklyEqual(s, t): RngDiffElt, RngDiffElt -> BoolElt`

Return `true` if and only if the differential ring element $s$ is weakly equal to the differential ring element $t$.

<a id="function-isweaklyzero-rngdiffelt"></a>
### `IsWeaklyZero(s): RngDiffElt -> BoolElt`

Return `true` if and only if the differential ring element $s$ is weakly equal to the zero element of its parent.

<a id="function-isorderterm-rngdiffelt"></a>
### `IsOrderTerm(s): RngDiffElt -> BoolElt`

<a id="function-isorderterm-rngserelt"></a>
### `IsOrderTerm(s): RngSerElt -> BoolElt`

Return `true` if and only if the differential ring element $s$ is purely an order term of a differential series ring.

<a id="example-ex-61c4b6"></a>
### `Example: Predicates for Differential Ring Elements (ex-61c4b6)`

This examples shows the booleans for various differential rings.

```magma
> F<z> := RationalDifferentialField(Rationals());
> S<t> := DifferentialLaurentSeriesRing(Rationals());
> IsOne(F!1);
true
> t eq t+O(t^2);
false
> IsWeaklyEqual(t, t+O(t^2));
true
> IsWeaklyZero(t^(-1));
false
> IsWeaklyZero(O(t));
true
> IsOrderTerm(t+O(t^2));
false
> IsOrderTerm(O(t));
true
```

## Coefficients and Terms

<a id="function-o-rngdiffelt"></a>
### `O(s): RngDiffElt -> RngDiffElt`

Creates the order term of the differential series $s$.

<a id="function-truncate-rngdiffelt"></a>
### `Truncate(s): RngDiffElt -> RngDiffElt`

The known part of the differential series $s$.

<a id="function-eltseq-rngdiffelt"></a>
### `Eltseq(s): RngDiffElt -> SeqEnum`

Returns the coefficients of the differential ring element $s$.

<a id="function-exponents-rngdiffelt"></a>
### `Exponents(s): RngDiffElt -> SeqEnum`

<a id="function-exponents-rngserelt"></a>
### `Exponents(s): RngSerElt -> SeqEnum`

Returns the interval from the valuation of $s$ to (including) the degree of $s$.

<a id="example-ex-18d9d7"></a>
### `Example: Coefficients of Algebraic Differential Elements (ex-18d9d7)`

```magma
> F<z> := RationalDifferentialField(Rationals());
> _<X> := PolynomialRing(F);
> K<x>, mp := ext<F|X^2+X+1>;
> seq := Eltseq(x^2);
> seq;
[ -1, -1 ]
> Universe(seq) eq F;
true
```

<a id="example-ex-4eef4b"></a>
### `Example: Coefficients of Differential Series (ex-4eef4b)`

```magma
> S<t> := DifferentialLaurentSeriesRing(Rationals());
> O(t+t^2);
O(t)
> Parent(O(t)) eq S;
true
> trunc := Truncate(t^(-1)+5*t^2 +O(t^4));
> trunc;
t^-1 + 5*t^2
> Parent(trunc) eq S;
true
> seq := Eltseq(trunc);
> seq;
[ 1, 0, 0, 5 ]
> Universe(seq) eq Rationals();
true
> Exponents(trunc);
[ -1 .. 2 ]
```

## Conjugates, Norm, and Trace

<a id="function-minimalpolynomial-rngdiffelt"></a>
### `MinimalPolynomial(s): RngDiffElt -> RngUPolElt`

The minimal polynomial of the differential field element $s$ over the base field.

<a id="example-ex-ecfdbc"></a>
### `Example: Minimal Polynomial of an Algebraic Element (ex-ecfdbc)`

```magma
> F<z> := RationalDifferentialField(Rationals());
> P<X> := PolynomialRing(F);
> K<x>, mp := ext<F|X^2+X+1>;
> f := MinimalPolynomial(x^2);
> f;
X^2 + X + 1
> Parent(f) eq P;
true
> g := MinimalPolynomial(x+3/2);
> g;
X^2 + -2*X + 7/4
```

## Derivatives and Differentials

<a id="function-derivative-rngdiffelt"></a>
### `Derivative(s): RngDiffElt -> RngDiffElt`

The image of $s$ under the derivation of the parent of $s$. Notice that it can be different to the “usual” derivative, as it relies on the defined derivation.

<a id="function-differential-rngdiffelt"></a>
### `Differential(s): RngDiffElt -> RngDiffElt`

Returns the differential of $s$ in the algebraic differential field $F$, as a differential in the differential space of the underlying ring of $F$.

<a id="example-ex-396a0f"></a>
### `Example: Derivatives and Differentials of Elements (ex-396a0f)`

```magma
> F<z> := RationalDifferentialField(Rationals());
> Derivative(z^2 + 7/z);
(2*z^3 - 7)/z^2
> Differential(z);
(1) d(z)
> Differential(1/z+6+5*z);
((5*z^2 - 1)/z^2) d(z)
> S<t> := DifferentialLaurentSeriesRing(Rationals());
> Derivative(5 + 2*t + 3*t^2);
2*t + 6*t^2
```
