MCPcopy Create free account
hub / github.com/cortex-js/compute-engine / seriesResidue

Function seriesResidue

test/compute-engine/series.test.ts:415–422  ·  view source on GitHub ↗

The residue (coefficient of `(x−x0)⁻¹`) extracted from the Series: the * constant term of `Series((x−x0)·f, x, x0, 0)`, which is `(x−x0)·f` evaluated * at the (removable) pole.

(fLatex: string, x0Latex: string)

Source from the content-addressed store, hash-verified

413 test('sqrt(1+x) to order 3: ascending degree starting with the constant term, O(x^4) last', () => {
414 const latex = series('\\sqrt{1+x}', '0', 3).latex;
415 expect(latex.startsWith('1+\\frac{x}{2}')).toBe(true);
416 expect(latex).toBe(
417 '1+\\frac{x}{2}-\\frac{x^2}{8}+\\frac{x^3}{16}+O\\left(x^4\\right)'
418 );
419 });
420
421 test('arctan x at +infinity: descending degree, O(x^{-7}) last', () => {
422 const latex = series('\\arctan x', '+\\infty').latex;
423 expect(latex.startsWith('\\frac{\\pi}{2}-\\frac{1}{x}')).toBe(true);
424 expect(latex).toBe(
425 '\\frac{\\pi}{2}-\\frac{1}{x}+\\frac{1}{3x^3}-\\frac{1}{5x^5}+O\\left(\\frac{1}{x^7}\\right)'

Callers 1

series.test.tsFile · 0.85

Calls 6

parseMethod · 0.65
functionMethod · 0.65
subMethod · 0.65
symbolMethod · 0.65
evaluateMethod · 0.65
subsMethod · 0.65

Tested by

no test coverage detected