Skip to content

DifferentialRootReduce ​

Reduces a function f(x)f(x) to its holonomic (D-finite) representation — DifferentialRoot\mathrm{DifferentialRoot}, a linear ODE with polynomial(x) coefficients plus enough derivatives at one point, applied straight back to xx. Covers eaxe^{ax}, sin⁡(ax)\sin(ax), cos⁡(ax)\cos(ax), polynomials, a single-pole rational function, ln⁡(1+x)\ln(1{+}x), arctan⁡(x)\arctan(x), erf(x)\mathrm{erf}(x), BesselJ, AiryAi and AiryBi; declines sums, products, and anything else. Provided by @enumeratio/analytic.

✓ checked against that system · ! checked, with disagreements (hover a chip)Wolfram LanguageDifferentialRootReduce✓
DifferentialRootReduce(f(x), x)the D-finite reduction of f(x)f(x), as DifferentialRoot(…)(x)\mathrm{DifferentialRoot}(\ldots)(x).
Typed signatures
TypePackageApplies
(expression, symbol) -> expressionanalyticalways

Domain: Special functions

Details
  • Expands about x0=0x_0 = 0 wherever that's an ordinary point of the ODE (every case except BesselJ, whose coefficient of y′′y'' vanishes at x=0x=0); BesselJ expands about x0=1x_0=1 instead, matching a local wolframscript's own choice there. A single-pole rational function A/(x−a)A/(x{-}a) also moves off aa itself.
  • Every reduction's initial conditions come from evaluating ff and its derivatives (via compute-engine's own D) at the expansion point directly, so they stay exact wherever compute-engine's own arithmetic is (e.g. AiryAi(0), or 2/π2/\sqrt\pi for erf); BesselJ's derivative uses the standard identity Jν′(x)=(Jν−1(x)−Jν+1(x))/2J_\nu'(x) = (J_{\nu-1}(x) - J_{\nu+1}(x))/2.
  • Verified by evaluating the reduction back (via DifferentialRoot's own Taylor-series stepper) against the original function at several points inside the radius of convergence, in both this package's own tests and against a local wolframscript.
  • Declines a rational function whose denominator isn't a single linear factor, a BesselJ/AiryAi/AiryBi argument that isn't the plain variable, and any sum or product of two of these (no small closure algorithm for D-finite sums is implemented here — see difference-root.ts's own sum rule for the hypergeometric case, which doesn't carry over to a general ODE).

Examples

4 more kept as data, checked against the oracles
Basic #

eaxe^{ax}: y′−ay=0y' - a y = 0, y(0)=1y(0){=}1

live ↗
InDifferentialRootReduce(exp⁡(ax),x)\mathrm{DifferentialRootReduce}(\exp(ax), x)OutDifferentialRoot((y,t)↦{y′(t)−ay(t)=0y(0)=1)⊲x\mathrm{DifferentialRoot}((y, t)↦\begin{cases}y^{\prime}(t)-ay(t)=0\\y(0)=1\end{cases})\lhd x

sin⁡x\sin x: y′′+y=0y'' + y = 0, y(0)=0,y′(0)=1y(0){=}0, y'(0){=}1

live ↗
InDifferentialRootReduce(sin⁡(x),x)\mathrm{DifferentialRootReduce}(\sin(x), x)OutDifferentialRoot((y,t)↦{y(t)+y′′(t)=0y(0)=0y′(0)=1)⊲x\mathrm{DifferentialRoot}((y, t)↦\begin{cases}y(t)+y^{\prime\prime}(t)=0\\y(0)=0\\y^{\prime}(0)=1\end{cases})\lhd x
live ↗
InDifferentialRootReduce(J⁡1(x),x)\mathrm{DifferentialRootReduce}(\operatorname{J}_{1}(x), x)OutDifferentialRoot((y,t)↦{(t2−1)y(t)+y′′(t)t2+ty′(t)=0y(1)=J⁡1(1)y′(1)=J⁡0(1)/2−J⁡2(1)/2)⊲x\mathrm{DifferentialRoot}((y, t)↦\begin{cases}(t^2-1)y(t)+y^{\prime\prime}(t)t^2+ty^{\prime}(t)=0\\y(1)=\operatorname{J}_{1}(1)\\y^{\prime}(1)=\operatorname{J}_{0}(1)/2-\operatorname{J}_{2}(1)/2\end{cases})\lhd x
Scope #

ln⁡(1+x)\ln(1{+}x): (1+x)y′′+y′=0(1{+}x) y'' + y' = 0

live ↗
InDifferentialRootReduce(ln⁡(1+x),x)\mathrm{DifferentialRootReduce}(\ln(1+x), x)OutDifferentialRoot((y,t)↦{(t+1)y′′(t)+y′(t)=0y(0)=0y′(0)=1)⊲x\mathrm{DifferentialRoot}((y, t)↦\begin{cases}(t+1)y^{\prime\prime}(t)+y^{\prime}(t)=0\\y(0)=0\\y^{\prime}(0)=1\end{cases})\lhd x

1/(x−2)1/(x{-}2): (x−2)y′+y=0(x{-}2) y' + y = 0, exact at x0=0x_0=0

live ↗
InDifferentialRootReduce(1x−2,x)\mathrm{DifferentialRootReduce}(\frac{1}{x-2}, x)OutDifferentialRoot((y,t)↦{(t−2)y′(t)+y(t)=0y(0)=−1/2)⊲x\mathrm{DifferentialRoot}((y, t)↦\begin{cases}(t-2)y^{\prime}(t)+y(t)=0\\y(0)=-1/2\end{cases})\lhd x

BesselJ(2, x): x=0x=0 is singular, so this anchors at x0=1x_0=1 instead — the same choice Wolfram makes

live ↗
InDifferentialRootReduce(J⁡2(x),x)\mathrm{DifferentialRootReduce}(\operatorname{J}_{2}(x), x)OutDifferentialRoot((y,t)↦{(t2−4)y(t)+y′′(t)t2+ty′(t)=0y(1)=J⁡2(1)y′(1)=J⁡1(1)/2−J⁡3(1)/2)⊲x\mathrm{DifferentialRoot}((y, t)↦\begin{cases}(t^2-4)y(t)+y^{\prime\prime}(t)t^2+ty^{\prime}(t)=0\\y(1)=\operatorname{J}_{2}(1)\\y^{\prime}(1)=\operatorname{J}_{1}(1)/2-\operatorname{J}_{3}(1)/2\end{cases})\lhd x
live ↗
InDifferentialRootReduce(x2+1,x)\mathrm{DifferentialRootReduce}(x^2+1, x)OutDifferentialRoot((y,t)↦{y′′′(t)=0y(0)=1y′(0)=0y′′(0)=2)⊲x\mathrm{DifferentialRoot}((y, t)↦\begin{cases}y^{\prime\prime\prime}(t)=0\\y(0)=1\\y^{\prime}(0)=0\\y^{\prime\prime}(0)=2\end{cases})\lhd x
About
Examples11
Checked againstWolfram Language 8 agree1 unevaluated
CrosswalkWolfram Language

See also: DifferentialRoot, DifferenceRootReduce, BesselJ, AiryAi, AiryBi, Erf