{
  "id": "improper-integral",
  "version": "4b84f34cf490",
  "status": "published",
  "name": "Improper Integral Calculator",
  "question": "Does the improper integral converge?",
  "summary": "Evaluates integrals over infinite intervals or with an infinite end, or shows that they diverge, checked numerically.",
  "category": "math",
  "subcategory": "calculus",
  "url": "https://www.acalculator.org/math/improper-integral-calculator",
  "markdown": "https://www.acalculator.org/math/improper-integral-calculator.md",
  "kind": "function",
  "method": "∫ from a to ∞ of f = lim (R → ∞) ∫ from a to R of f, and alike at −∞ or at an end where f is infinite. A computer algebra system finds the antiderivative and its limits; each value is checked by numeric integration.",
  "assumptions": [
    "The variable is x; angles are in radians; ln is the natural logarithm.",
    "f has no pole strictly between a and b.",
    "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 integrand, typed like 1/x^2, e^(-x) or 1/sqrt(4 - x).",
        "type": "string",
        "maxLength": 200
      },
      "a": {
        "title": "Lower limit a",
        "description": "A number, a constant such as pi, or -inf.",
        "type": "string",
        "maxLength": 40
      },
      "b": {
        "title": "Upper limit b",
        "description": "A number, a constant such as pi, or inf.",
        "type": "string",
        "maxLength": 40
      }
    }
  },
  "outputs": {
    "verdict": {
      "label": "The integral",
      "description": "Converges (a finite value) or diverges.",
      "format": "text"
    },
    "value": {
      "label": "Value",
      "description": "The integral of f from a to b, to 10 significant figures.",
      "format": "number"
    },
    "exact": {
      "label": "Exact value",
      "description": "The integral written exactly.",
      "format": "math"
    }
  },
  "defaultAnswer": {
    "inputs": {
      "f": "1/x^2",
      "a": "1",
      "b": "inf"
    },
    "outputs": {
      "verdict": "Converges",
      "value": 1,
      "exact": "1"
    },
    "text": "The integral of 1/x^2 from 1 to inf is 1."
  },
  "examples": [
    {
      "given": {
        "f": "pi/x^2",
        "a": "1",
        "b": "inf"
      },
      "expect": {
        "verdict": "Converges",
        "value": 3.141592653589793,
        "exact": "π"
      },
      "source": "OpenStax, Calculus Volume 2, section 3.7 Improper Integrals, Example 3.48. https://openstax.org/books/calculus-volume-2/pages/3-7-improper-integrals"
    },
    {
      "given": {
        "f": "1/(x^2 + 4)",
        "a": "-inf",
        "b": "0"
      },
      "expect": {
        "verdict": "Converges",
        "value": 0.7853981633974483
      },
      "source": "OpenStax, Calculus Volume 2, section 3.7 Improper Integrals, Example 3.50"
    },
    {
      "given": {
        "f": "1/sqrt(4 - x)",
        "a": "0",
        "b": "4"
      },
      "expect": {
        "verdict": "Converges",
        "value": 4,
        "exact": "4"
      },
      "source": "OpenStax, Calculus Volume 2, section 3.7 Improper Integrals, Example 3.52"
    },
    {
      "given": {
        "f": "1/x",
        "a": "1",
        "b": "inf"
      },
      "expect": {
        "verdict": "Diverges"
      },
      "source": "OpenStax, Calculus Volume 2, section 3.7 Improper Integrals, Example 3.47"
    }
  ],
  "sources": [
    "OpenStax, Calculus Volume 2, section 3.7 Improper Integrals: https://openstax.org/books/calculus-volume-2/pages/3-7-improper-integrals"
  ],
  "related": [
    "integral",
    "lhopitals-rule",
    "series",
    "area-between-curves"
  ],
  "changelog": []
}
