ApproximatelyEqual - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

MultivariatePowerSeries

 ApproximatelyEqual
 determine equality up to some precision

 Calling Sequence ApproximatelyEqual(p, q, deg, f) ApproximatelyEqual(u, v, deg, f)

Parameters

 p, q - power series generated by this package u, v - univariate polynomials over power series generated by this package deg - (optional) the precision up to which to compare the inputs f - (optional) the keyword option force or force = true or force = false

Description

 • Two power series p and q are said to be equal up to a degree deg, called the precision, if for each degree d <= deg, the homogeneous components of p and q of degree d are equal.
 • The command ApproximatelyEqual(p,q) returns true if the two power series are equal up to the minimum of their currently computed precisions, otherwise false.
 • The command ApproximatelyEqual(p,q,deg) returns true if the two power series are equal up to precision deg, otherwise false. This calling sequence computes any coefficients needed that have not been computed so far.
 • The command ApproximatelyEqual(u,v) returns true if the two univariate polynomials over power series are equal up to the currently computed precision of each coefficient power series, otherwise false.
 • The command ApproximatelyEqual(u,v,deg) returns true if the two univariate polynomials over power series are equal by comparing each power series coefficient up to precision deg, otherwise false.
 • By default, if p and q know their analytic expressions and these analytic expressions are equal, the ApproximatelyEqual command will immediately return true. If you pass the force or force = true option, then the ApproximatelyEqual command will ignore the analytic expressions. The default behavior can be explicitly selected by passing the option force = false.
 • Any form of the force option passed to the ApproximatelyEqual command when comparing univariate polynomials over power series are used as described above when comparing the power series coefficients.
 • When using the MultivariatePowerSeries package, do not assign anything to the variables occurring in the power series, Puiseux series, and univariate polynomials over these series. If you do, you may see invalid results.

Examples

 > $\mathrm{with}\left(\mathrm{MultivariatePowerSeries}\right):$

Define a power series.

 > $a≔\mathrm{Inverse}\left(\mathrm{PowerSeries}\left(1+x+y\right)\right)$
 ${a}{≔}\left[{PowⅇrSⅇriⅇs of}\frac{{1}}{{1}{+}{x}{+}{y}}{:}{1}{+}{\dots }\right]$ (1)

Compute its linear truncation with the Truncate command.

 > $\mathrm{Truncate}\left(a,1\right)$
 ${1}{-}{x}{-}{y}$ (2)

We do the same twice more.

 > $b≔\mathrm{GeometricSeries}\left(\left[x,y\right]\right)$
 ${b}{≔}\left[{PowⅇrSⅇriⅇs of}\frac{{1}}{{1}{-}{x}{-}{y}}{:}{1}{+}{x}{+}{y}{+}{\dots }\right]$ (3)
 > $\mathrm{Truncate}\left(b,1\right)$
 ${1}{+}{x}{+}{y}$ (4)
 > $c≔\mathrm{Inverse}\left(\mathrm{SumOfAllMonomials}\left(\left[x,y\right]\right)\right)$
 ${c}{≔}\left[{PowⅇrSⅇriⅇs of}\left({1}{-}{x}\right){}\left({1}{-}{y}\right){:}{1}{+}{\dots }\right]$ (5)
 > $\mathrm{Truncate}\left(c,1\right)$
 ${1}{-}{x}{-}{y}$ (6)

The power series $a$, $b$, and $c$ all have the terms up to homogeneous degree 1 computed. As we see above, these are the same for $a$ and $c$ but different for $b$.

 > $\mathrm{ApproximatelyEqual}\left(a,b\right)$
 ${\mathrm{false}}$ (7)
 > $\mathrm{ApproximatelyEqual}\left(a,c\right)$
 ${\mathrm{true}}$ (8)

However, the homogeneous degree 2 parts of $a$ and $c$ are different.

 > $\mathrm{ApproximatelyEqual}\left(a,c,2\right)$
 ${\mathrm{false}}$ (9)

In order to test this, we needed to compute the terms of homogeneous degree 2, as we can see by calling Truncate again.

 > $\mathrm{Truncate}\left(a\right)$
 ${{x}}^{{2}}{+}{2}{}{x}{}{y}{+}{{y}}^{{2}}{-}{x}{-}{y}{+}{1}$ (10)
 > $\mathrm{Truncate}\left(c\right)$
 ${x}{}{y}{-}{x}{-}{y}{+}{1}$ (11)

We define two univariate polynomials over power series, both linear in their with main variable $z$. The constant coefficient in $z$ is 0. The coefficient of $z$ is also the same, even though this is not immediately obvious from their definition.

 > $f≔\mathrm{UnivariatePolynomialOverPowerSeries}\left(\left[\mathrm{PowerSeries}\left(0\right),\mathrm{GeometricSeries}\left(\left[x,y\right]\right)\right],z\right):$
 > $g≔\mathrm{UnivariatePolynomialOverPowerSeries}\left(\left[\mathrm{PowerSeries}\left(0\right),\mathrm{Inverse}\left(\mathrm{PowerSeries}\left(1-x-y\right)\right)\right],z\right):$
 > $\mathrm{ApproximatelyEqual}\left(f,g\right)$
 ${\mathrm{true}}$ (12)
 > $\mathrm{ApproximatelyEqual}\left(f,g,10\right)$
 ${\mathrm{true}}$ (13)

In this case, the analytic expressions for the coefficients are all pairwise equal. We can use the force option to make Maple do the actual comparisons.

 > $\mathrm{ApproximatelyEqual}\left(f,g,10,\mathrm{force}\right)$
 ${\mathrm{true}}$ (14)

Compatibility

 • The MultivariatePowerSeries[ApproximatelyEqual] command was introduced in Maple 2021.
 • For more information on Maple 2021 changes, see Updates in Maple 2021.
 • The MultivariatePowerSeries[ApproximatelyEqual] command was updated in Maple 2022.
 • The force option was introduced in Maple 2022.
 • For more information on Maple 2022 changes, see Updates in Maple 2022.