{
  "id": "area-between-curves",
  "version": "e966ebbb14c8",
  "status": "published",
  "name": "Area Between Curves Calculator",
  "question": "What is the area between two curves?",
  "summary": "Finds the area between y = f(x) and y = g(x), from a to b or between their crossings.",
  "category": "math",
  "subcategory": "calculus",
  "url": "https://www.acalculator.org/math/area-between-curves-calculator",
  "markdown": "https://www.acalculator.org/math/area-between-curves-calculator.md",
  "kind": "function",
  "method": "Area = ∫ |f(x) − g(x)| dx from a to b, split where the curves cross.",
  "assumptions": [
    "Crossings searched for in ±10^6."
  ],
  "inputs": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
      "f": {
        "title": "Curve y = f(x)",
        "description": "The first curve.",
        "type": "string",
        "maxLength": 200
      },
      "g": {
        "title": "Curve y = g(x)",
        "description": "The second curve.",
        "type": "string",
        "maxLength": 200
      },
      "a": {
        "title": "From x = a (optional)",
        "description": "Left end, or empty for the crossings.",
        "type": "string",
        "maxLength": 40
      },
      "b": {
        "title": "To x = b (optional)",
        "description": "Right end.",
        "type": "string",
        "maxLength": 40
      }
    }
  },
  "outputs": {
    "area": {
      "label": "Area",
      "description": "The integral of |f(x) − g(x)| from a to b.",
      "format": "number"
    },
    "exact": {
      "label": "Exact area",
      "description": "The area, exactly.",
      "format": "math"
    },
    "lower": {
      "label": "From x =",
      "description": "Left end used.",
      "format": "number"
    },
    "upper": {
      "label": "To x =",
      "description": "Right end used.",
      "format": "number"
    }
  },
  "defaultAnswer": {
    "inputs": {
      "f": "9 - (x/2)^2",
      "g": "6 - x"
    },
    "outputs": {
      "area": 21.333333333333332,
      "exact": "64/3",
      "lower": -2,
      "upper": 6
    },
    "text": "The area between 9 - (x/2)^2 and 6 - x is 21.33333333."
  },
  "examples": [
    {
      "given": {
        "f": "9 - (x/2)^2",
        "g": "6 - x"
      },
      "expect": {
        "area": 21.333333333333332,
        "exact": "64/3",
        "lower": -2,
        "upper": 6
      },
      "source": "OpenStax (Strang and Herman, 2016), Calculus Volume 1, section 6.1 Areas between Curves, Example 6.2"
    },
    {
      "given": {
        "f": "x + 4",
        "g": "3 - x/2",
        "a": "1",
        "b": "4"
      },
      "expect": {
        "area": 14.25,
        "exact": "57/4"
      },
      "source": "OpenStax (Strang and Herman, 2016), Calculus Volume 1, section 6.1 Areas between Curves, Example 6.1"
    }
  ],
  "sources": [
    "OpenStax, Calculus Volume 1, section 6.1 Areas between Curves: https://openstax.org/books/calculus-volume-1/pages/6-1-areas-between-curves"
  ],
  "related": [
    "integral",
    "improper-integral",
    "critical-number",
    "area"
  ],
  "changelog": []
}
