§4.0.2 (p. 107) · §4.0.3 (p. 110) · §4.0.8 (p. 113)
Root parametrization
Unified: , () or (). The form needs two positive roots; negative or mixed-sign real roots are handled by partial fractions.
Lab 04 · Chapter 4
How does the position of the roots give every derivative of a rational function in closed form?
What the book proves
§4.0.2 (p. 107) · §4.0.3 (p. 110) · §4.0.8 (p. 113)
Unified: , () or (). The form needs two positive roots; negative or mixed-sign real roots are handled by partial fractions.
§4.0.10 (p. 115)
Since , the book sets
so , , , and .
§4.0.2 (p. 107) · §4.0.3 (p. 110)
§4.0.12 (p. 117)
For , , , as above, , every and every real x:
§4.0.12 (p. 117) · §4.0.20 (p. 128)
For , , on the right exterior branch with :
For every real , without a branch choice:
The hyperbolic form must not be used unchanged across the poles or on the left branch (§4.0.20). On the left branch it is off by the factor — verified below.
§4.0.5 (p. 112) · §4.0.6 (p. 112)
Any rational function reduces to a polynomial part plus , so = polynomial part + linear laws + quadratic (trigonometric/hyperbolic) laws.
§4.0.20 (p. 128) · §4.0.5 (p. 112)
Book limit () for : . With a general linear numerator, the linear law with gives (used here; the numerator is kept):
§4.0.13 (p. 117)
, , the real root q independent of r and θ, :
§4.0.14 (p. 118) · §4.0.15 (p. 119)
, q independent of r, ; on :
On the other real intervals: partial fractions over the three real roots.
§4.0.15 (p. 119)
Corrected superposition for the quartic example:
§4.0.16 (p. 124) · §4.0.17 (p. 125)
For a polynomial (r a real root): , i.e. at and at the critical points of g. Cubic (Cor. 4.0.6): the vertex ; quartic (Cor. 4.0.7): the extrema of the cubic g.
§4.0.19 (p. 127)
For with , roots , :
If r = α the three roots are collinear and no finite circle exists.
§4.0.21 (p. 129) · §4.0.22 (p. 130)
Valid for , the distance to the nearest (complex) root. Amplitude–phase form of the book's example (§4.0.22): , .
Compute
Loading the root-geometry calculator… It runs entirely in your browser and needs JavaScript.
From the book
§4.0.2 (p. 107)
; at : , so .
Recomputed here ✓ f′(1) = -1, f‴(1) = 6 (exact).
§4.0.3 (p. 110)
; .
Recomputed here ✓ f(0) = 1, f′(0) = 3. (x = 0 lies on the left branch, so the lab evaluates the branch-free form there.)
§4.0.22 (p. 130)
, , , :
Recomputed here ✓ exact = −7·18!/59049; floating-point closed form −7.5897332622222 × 10¹¹.
§4.0.22 (p. 130) · §4.0.20 (p. 128)
, . Since x = 2 lies between the poles, the book continues the hyperbolic form with a consistent complex branch, :
The lab uses the branch-free real formula, valid for every real x away from the poles:
Recomputed here ✓ exact (series and Q(√5) closed form agree); branch-free float −2.2046573855674 × 10²⁰.
§4.0.13 (p. 117)
: , .
Recomputed here ✓ F′(0) = −1/8 exactly; Theorem 4.0.3 in floating point gives −0.125.
§4.0.15 (p. 119)
, ; for :
Recomputed here ✓ at x = 4, n = 2: exact 112/675; Theorem 4.0.4 gives 0.16592592592593.
§4.0.15 (p. 119)
: , zeros . : .
Recomputed here ✓ -1, 0, 1 and -1, 1, 3.
§4.0.15 (p. 119)
, ; at 0: . For n = 4 each bracket equals :
Recomputed here ✓ exact −24 (from 1/(1 + x⁴) = 1 − x⁴ + …); superposition −24.
§4.0.20 (p. 128)
, : .
Recomputed here ✓ n = 0…4: 1, 2, 6, 24, 120.00000000000001.
§4.0.21 (p. 129) · §4.0.22 (p. 130)
at 0: , , radius of convergence 1.
; integrating the 12- and 20-term polynomials gives 2.0719086202 and 2.5024633697. The series itself diverges at x = 1; these are integrated finite truncations, not a convergent equality.
Recomputed here ✓ c₀…c₅ = 3, 5, 2, -3, -5, -2; period 6 through c₁₉; ϕ* = 53.41°.
§4.0.16 (p. 124) · §4.0.17 (p. 125)
: → (0, 2), (2, 6). : → (−1, 2), (1, −2), (3, 18).
Recomputed here ✓ (0, 2), (2, 6); (-1, 2), (1, -2), (3, 18).
§4.0.19 (p. 127)
, : .
Recomputed here ✓ x_c = 1.25, R = 1.75.
Independent checks
Every row below is recomputed by the lab's engine when this page is rendered and compared with a value obtained independently (the book's stated value, direct evaluation of F, or a second method). Exact values come from BigInt rational arithmetic: the Taylor coefficient of the rational function by exact power-series division, and — separately — the book's closed form evaluated exactly in the quadratic field Q(√Δ), where its irrational part must cancel. The closed form column is the floating-point evaluation of the displayed theorem (overflow-safe up to n = 200). The same checks, and 90+ further values recomputed with sympy/mpmath (scratch/ch4/sympy_check.py → lib/math/ch4/fixtures/reference.json), are asserted by the unit tests in lib/math/ch4/.
26 of 26 checks pass.
| Check | Expected | Exact (computed) | Closed form (floating point) | Verdict |
|---|---|---|---|---|
| F(x) = 1/((x−2)(x²+2)): F′(0) by Theorem 4.0.3 §4.0.13 · p. 117 | −1/8 | −1/8 | −0.125 (Theorem 4.0.3) | Pass |
| 1/(x⁴+1): f⁽⁴⁾(0) from the corrected superposition (independently: 1/(1+x⁴) = 1 − x⁴ + … gives −4! = −24) §4.0.15 · p. 119 | −24 | −24 | −24 | Pass |
| (2x+3)/(x²−3x+1): F⁽¹⁸⁾(2), between the poles §4.0.22 · p. 130 | −220465738556743680000 | −220465738556743680000 | −2.2046573855674 × 10²⁰ (branch-free) | Pass |
| (2x+3)/(x²−x+1): F⁽¹⁸⁾(2) = −7·18!/59049 §4.0.22 · p. 130 | −6830759936000/9 | −6830759936000/9 | −7.5897332622222 × 10¹¹ (trig) | Pass |
| n = 0 returns F(x₀): Δ < 0 (trigonometric), x₀ = 2 robustness | 7/3 | 7/3 | 2.3333333333333 (trig) | Pass |
| n = 0 returns F(x₀): Δ > 0, right branch (hyperbolic form), x₀ = 3 robustness | 9 | 9 | 9 (hyperbolic) | Pass |
| n = 0 returns F(x₀): Δ > 0, between the poles, x₀ = 2 robustness | −7 | −7 | −7 (branch-free) | Pass |
| n = 0 returns F(x₀): Δ > 0, left branch, x₀ = -1 robustness | 1/5 | 1/5 | 0.2 (branch-free) | Pass |
| n = 0 returns F(x₀): Δ = 0 (double root, linear numerator), x₀ = 3 robustness | 9/4 | 9/4 | 2.25 (double) | Pass |
| n = 0 returns F(x₀): negative real roots, x₀ = 1/2 robustness | 2 | 2 | 2 (branch-free) | Pass |
| n = 0 returns F(x₀): roots of opposite sign (c < 0), x₀ = 1 robustness | −1/6 | −1/6 | −0.16666666666667 (branch-free) | Pass |
| n = 0 returns F(x₀): a zero root (c = 0), x₀ = 1 robustness | −1 | −1 | −1 (branch-free) | Pass |
| n = 0 returns F(x₀): non-monic denominator, x₀ = 1/3 robustness | −9/50 | −9/50 | −0.18 (trig) | Pass |
| n = 0 returns F(x₀): cubic (Thm 4.0.4 at x₀ = 4, Thm 4.0.3 at x₀ = 0) and quartic superposition at x₀ = 1/2 robustness | 1/15, −1/4, 16/17 | 1/15, −1/4, 16/17 | 0.0666666666667, −0.25, 0.941176470588 | Pass |
| n = 0, 1, 2 and n = 200 for five functions (all regimes) at three points robustness | 60 agreements | 60 agreements | exact closed form = exact series; float closed form within 10⁻⁹ × cancellation | Pass |
| (x+1)/(x²−2x+c), x₀ = 3, n = 3 with c = 1 ± 10⁻¹⁰ (Δ = ∓4·10⁻¹⁰) and c = 1 (Δ = 0) robustness | continuous through Δ = 0: −1.875 | Δ<0: −1.87499999972; Δ>0: −1.87500000028 | trig −1.87499999972; hyperbolic −1.87500000028 (cancellation ≈ 4.0e+4) | Pass |
| 1/(x²−3x+1) at x₀ = 2.618034, 1.1·10⁻⁸ right of the pole r e^η, n = 2 robustness | 6.28167189282 × 10²³ | 156250002358375000000000000000000000/248739515569 | 6.2816718928212 × 10²³ (hyperbolic) | Pass |
| (x+1)/(x²−5x+4), r e^η = 4: x₀ = 4 (boundary), 4 ± 10⁻⁶, n = 3 §4.0.20 · p. 128 | x₀ = 4 rejected (pole); hyperbolic form only for x₀ > 4 | rejected; 4.000001 → hyperbolic; 3.999999 → branch-free | −1 × 10²⁵ vs exact −1 × 10²⁵ | Pass |
| (x+5)/(x²+3x+1) (roots (−3 ± √5)/2 < 0), x₀ = -5, n = 7 robustness | 99978480/19487171 | 99978480/19487171 | 5.1304768660366 (branch-free) | Pass |
| (x+5)/(x²+3x+1) (roots (−3 ± √5)/2 < 0), x₀ = -1, n = 7 robustness | −488880 | −488880 | −488880 (branch-free) | Pass |
| (x+5)/(x²+3x+1) (roots (−3 ± √5)/2 < 0), x₀ = 1/2, n = 7 robustness | −554022604800/19487171 | −554022604800/19487171 | −28430.119733644 (branch-free) | Pass |
| (2x+3)/(x−1)², double root with the linear numerator kept, x₀ = 3, n = 5 §4.0.20 · p. 128 | −255/8 | −255/8 | −31.875 (double) | Pass |
| 1/((x−1)²(x−2)): q is also a factor root (g(q) = 0), x₀ = 3, n = 4 §4.0.5 · p. 112 | 171/8 | 171/8 | 21.375 (partial-fractions) | Pass |
| (2x+3)/(x²−3x+1) at x₀ = −1 (left branch): hyperbolic form used outside its domain §4.0.20 · p. 128 | F⁽0⁾ = 0.19999999999999998, F⁽1⁾ = 0.6, F⁽2⁾ = 1.1199999999999999 | unrestricted hyperbolic form: -0.2, 0.6, -1.12 | equals (−1)ⁿ⁺¹ × true value → the restriction x > r e^η is necessary | Pass |
| (2x+3)/(x²−x+1) at 0: c₀…c₁₉ and cₙ = (2√19/√3) cos(πn/3 − ϕ*) §4.0.21 · p. 129 | 3, 5, 2, −3, −5, −2 (period 6); ϕ* = arctan(7/(3√3)) ≈ 53.41° | 3, 5, 2, −3, −5, −2 …; period 6 | generator agrees; ϕ* = 53.4132° | Pass |
| ∫₀¹ (2x+3)/(x²−x+1)·sin x dx and its integrated 12- and 20-term Taylor truncations §4.0.22 · p. 130 | I ≈ 2.3902, I₁₂ ≈ 2.0719086202, I₂₀ ≈ 2.5024633697 | I = 2.3901777907, I₁₂ = 2.0719086202, I₂₀ = 2.5024633697 | Gauss–Kronrod quadrature (truncations are approximations; the series diverges at x = 1) | Pass |
The interactive calculator repeats these comparisons for any input: exact closed form vs exact series, floating-point closed form, Taylor-mode automatic differentiation and (n ≤ 60) a Cauchy-integral derivative on a circle inside the disc of convergence.
When the formulas hold
Where this comes from
Analytical Methods for Higher-Order Derivatives, Integral Transforms, and Matrix-Based Techniques (corrected edition). Section numbers and printed pages below are generated from the corrected PDF.
The interactive cases on this page are ported from the author's open-source lab. Where the repository and the corrected book disagree, the book is followed and the difference is listed below.
https://github.com/rida313jamal-source/A-Unified-Geometric-Framework-for-Higher-Derivatives-of-Rational-Functions
| Item | Earlier text (GitHub / old site) | Corrected book (used here) |
|---|---|---|
| Angle φ(x) in the trigonometric law §4.0.10 | GitHub (, ) and the old site's lab compute (old site: ) and show it in the formula. | The displayed theorem uses the arctangent ratio with the explicit quadrant rule: for , at equality, for ; . |
| Notation of the two regimes §4.0.12 | GitHub: with "r value (real root / modulus)", and undefined outside the code; old site: centre/half-gap , , reciprocal only. | Trigonometric regime: with ; hyperbolic/real-root regime: with numerator coefficients (, for a general ). |
| Domain of the real hyperbolic formula §4.0.20 | GitHub applies for every , continuing and into : for it returns and (true ; off by on the left branch). | Hyperbolic form only on the right exterior branch ; elsewhere the branch-free real-root formula , which gives . |
| 18th-derivative hyperbolic example §4.0.22 | GitHub's continuation gives the wrong sign and a spurious imaginary part at (between the poles). | with the consistent branch , ; verified exactly here. |
| Double root (Δ = 0) §4.0.20 | GitHub returns for every numerator and every (e.g. : , true ; also the wrong sign for a root at ). | General linear numerator kept: (linear law §4.0.5); the book's at is the case , . |
| Negative or mixed-sign real roots, c ≤ 0 §4.0.8 | GitHub raises "math domain error" ( of a value ) for two negative roots and refuses ; the old site wrote the negative pair as . | The parametrization is used only for two positive roots; other real-root cases use the branch-free partial-fraction formula, with the book's representation , () shown for information. |
| Taylor generator in the hyperbolic regime §4.0.21 | GitHub uses , at (left branch): for it lists | Coefficients from the branch-appropriate closed form: , checked against exact series division. |
| Cubic theorem parameters §4.0.13 | Writing the cubic as (the notation of §4.0.18) uses one letter for the real root and the modulus, which silently imposes . | Theorem 4.0.3 uses an independent real root , modulus and angle , with ; Theorem 4.0.4 likewise with on . |
| Quartic partial-fraction superposition §4.0.15 | Superseded superposition for (the corrected book labels the new formula "the corrected superposition"); neither GitHub nor the old site implemented the quartic. | with quadrant-corrected ; (verified exactly). |
| Amplitude–phase form of the Taylor coefficients §4.0.22 | GitHub shows only with from atan2. | , ; written on this site to keep it distinct from (the book reuses the letter ). |
| Scope of the calculator §4.0.12 | Old site: only, , plus a generic Durand–Kerner root viewer. GitHub: fixed monic denominator, no exact values, no cubic or quartic. | Linear numerator over any quadratic, , exact BigInt values, Taylor generator, cubic Theorems 4.0.3–4.0.4, quartic superposition, Theorem 4.0.5; Durand–Kerner kept only as a supporting root finder. |
| Book section references §4.0.15 | Old site: page numbers for §4.0.2, §4.0.3, §4.0.8 and §4.0.15 taken from an earlier layout (all offset from the corrected PDF), and §4.0.15 titled "Trigonometric Formulation (Complex Conjugate Roots)". | Section numbers, titles and pages are generated from the corrected PDF (listed above); §4.0.15 is "Hyperbolic Formulation (Three Real Roots)". |
Both sections of the Streamlit app are ported: the higher-order derivative calculator (inputs A, B, b, c, n, x₀ → here α, β, a, b, c, n, x₀ with a general leading coefficient, exact rational inputs and the book's regime rules) and the Taylor-series generator (closed-form coefficients, the list of coefficients and the partial series). The app's root type, r, θ/η, ρ(x₀), φ/ψ(x₀) readouts and its “general formula” panel appear in the “Root regime” and “Closed form” panels. Where the app and the corrected book differ (atan2, the unrestricted hyperbolic branch, the double root, negative roots) the book is followed; see the corrections above.