{
  "id": "taylor-series",
  "version": "ace90c66f669",
  "status": "published",
  "name": "Taylor Series Calculator",
  "question": "What is the Taylor series of a function?",
  "summary": "Finds the Taylor polynomial of a function about a point, with checked coefficients.",
  "category": "math",
  "subcategory": "calculus",
  "url": "https://www.acalculator.org/math/taylor-series-calculator",
  "markdown": "https://www.acalculator.org/math/taylor-series-calculator.md",
  "kind": "function",
  "method": "A computer algebra system finds each derivative of f(a + t) at t = 0; each derivative and coefficient is checked numerically.",
  "assumptions": [
    "Written in powers of (x − a), lowest first; order 0 to 10.",
    "An answer that fails its check is not shown."
  ],
  "inputs": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
      "f": {
        "title": "Function f(x)",
        "description": "The function, in one letter.",
        "type": "string",
        "maxLength": 200
      },
      "a": {
        "title": "Centre a",
        "description": "The point the series is built around; 0 gives a Maclaurin series.",
        "type": "string",
        "maxLength": 40
      },
      "n": {
        "title": "Order n",
        "description": "The highest power of (x − a), 0 to 10.",
        "type": "integer",
        "minimum": 0,
        "maximum": 10
      }
    }
  },
  "outputs": {
    "polynomial": {
      "label": "Taylor polynomial",
      "description": "The sum of f⁽ᵏ⁾(a)/k! (x − a)ᵏ for k = 0 to n.",
      "format": "math"
    }
  },
  "defaultAnswer": {
    "inputs": {
      "f": "ln(x)",
      "a": "1",
      "n": 3
    },
    "outputs": {
      "polynomial": "(x - 1) - (x - 1)^2/2 + (x - 1)^3/3"
    },
    "text": "The Taylor polynomial of order 3 of ln(x) about 1 is (x - 1) - (x - 1)^2/2 + (x - 1)^3/3."
  },
  "examples": [
    {
      "given": {
        "f": "ln(x)",
        "a": "1",
        "n": 3
      },
      "expect": {
        "polynomial": "(x - 1) - (x - 1)^2/2 + (x - 1)^3/3"
      },
      "source": "OpenStax Calculus Vol. 2, 6.3, Ex. 6.11. https://openstax.org/books/calculus-volume-2/pages/6-3-taylor-and-maclaurin-series"
    },
    {
      "given": {
        "f": "sin(x)",
        "a": "0",
        "n": 5
      },
      "expect": {
        "polynomial": "x - x^3/6 + x^5/120"
      },
      "source": "OpenStax Calculus Vol. 2, 6.3, Ex. 6.12(b)"
    },
    {
      "given": {
        "f": "cbrt(x)",
        "a": "8",
        "n": 2
      },
      "expect": {
        "polynomial": "2 + (x - 8)/12 - (x - 8)^2/288"
      },
      "source": "OpenStax Calculus Vol. 2, 6.3, Ex. 6.13"
    }
  ],
  "sources": [
    "OpenStax, Calculus Volume 2, section 6.3 Taylor and Maclaurin Series: https://openstax.org/books/calculus-volume-2/pages/6-3-taylor-and-maclaurin-series",
    "NIST Digital Library of Mathematical Functions, section 1.10 Functions of a Complex Variable (Taylor’s theorem): https://dlmf.nist.gov/1.10"
  ],
  "related": [
    "derivative",
    "limit",
    "calculus",
    "integral"
  ],
  "changelog": []
}
