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)
| 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)' |