{
    "nbformat": 4,
    "nbformat_minor": 5,
    "metadata": {
        "kernelspec": {
            "display_name": "Python",
            "language": "python",
            "name": "python"
        },
        "language_info": {
            "name": "python"
        }
    },
    "cells": [
        {
            "id": "0cc84cc6",
            "cell_type": "markdown",
            "source": "<div class='alert alert-warning'>\n\nSciPy's interactive examples with Jupyterlite are experimental and may not always work as expected. Execution of cells containing imports may result in large downloads (up to 60MB of content for the first import from SciPy). Load times when importing from SciPy may take roughly 10-20 seconds. If you notice any problems, feel free to open an [issue](https://github.com/scipy/scipy/issues/new/choose).\n\n</div>",
            "metadata": {}
        },
        {
            "id": "9e9e02f5",
            "cell_type": "markdown",
            "source": "We can compute integrations of a vector-valued function:\n",
            "metadata": {}
        },
        {
            "id": "eeeef82f",
            "cell_type": "code",
            "metadata": {},
            "execution_count": null,
            "source": "from scipy.integrate import quad_vec\nimport numpy as np\nimport matplotlib.pyplot as plt\nalpha = np.linspace(0.0, 2.0, num=30)\nf = lambda x: x**alpha\nx0, x1 = 0, 2\ny, err = quad_vec(f, x0, x1)\nplt.plot(alpha, y)\nplt.xlabel(r\"$\\alpha$\")\nplt.ylabel(r\"$\\int_{0}^{2} x^\\alpha dx$\")\nplt.show()",
            "outputs": []
        },
        {
            "id": "0e73b3c3",
            "cell_type": "markdown",
            "source": "When using the argument `workers`, one should ensure\nthat the main module is import-safe, for instance\nby rewriting the example above as:\n\n.. code-block:: python\n\n    from scipy.integrate import quad_vec\n    import numpy as np\n    import matplotlib.pyplot as plt\n\n    alpha = np.linspace(0.0, 2.0, num=30)\n    x0, x1 = 0, 2\n    def f(x):\n        return x**alpha\n\n    if __name__ == \"__main__\":\n        y, err = quad_vec(f, x0, x1, workers=2)\n",
            "metadata": {}
        }
    ]
}