{
    "nbformat": 4,
    "nbformat_minor": 5,
    "metadata": {
        "kernelspec": {
            "display_name": "Python",
            "language": "python",
            "name": "python"
        },
        "language_info": {
            "name": "python"
        }
    },
    "cells": [
        {
            "id": "9b9d55b2",
            "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": "f95984bf",
            "cell_type": "code",
            "metadata": {},
            "execution_count": null,
            "source": "import numpy as np\nimport scipy.special as sc",
            "outputs": []
        },
        {
            "id": "dac192c6",
            "cell_type": "markdown",
            "source": "It has poles when `c` is a negative integer.\n",
            "metadata": {}
        },
        {
            "id": "372e5139",
            "cell_type": "code",
            "metadata": {},
            "execution_count": null,
            "source": "sc.hyp2f1(1, 1, -2, 1)",
            "outputs": [
                {
                    "output_type": "execute_result",
                    "metadata": {},
                    "data": {
                        "text/plain": "inf"
                    },
                    "execution_count": null
                }
            ]
        },
        {
            "id": "f150be3a",
            "cell_type": "markdown",
            "source": "It is a polynomial when `a` or `b` is a negative integer.\n",
            "metadata": {}
        },
        {
            "id": "6fd30580",
            "cell_type": "code",
            "metadata": {},
            "execution_count": null,
            "source": "a, b, c = -1, 1, 1.5\nz = np.linspace(0, 1, 5)\nsc.hyp2f1(a, b, c, z)",
            "outputs": [
                {
                    "output_type": "execute_result",
                    "metadata": {},
                    "data": {
                        "text/plain": "array([1.        , 0.83333333, 0.66666667, 0.5       , 0.33333333])"
                    },
                    "execution_count": null
                }
            ]
        },
        {
            "id": "d1e11e25",
            "cell_type": "code",
            "metadata": {},
            "execution_count": null,
            "source": "1 + a * b * z / c",
            "outputs": [
                {
                    "output_type": "execute_result",
                    "metadata": {},
                    "data": {
                        "text/plain": "array([1.        , 0.83333333, 0.66666667, 0.5       , 0.33333333])"
                    },
                    "execution_count": null
                }
            ]
        },
        {
            "id": "072b2518",
            "cell_type": "markdown",
            "source": "It is symmetric in `a` and `b`.\n",
            "metadata": {}
        },
        {
            "id": "0d3406ea",
            "cell_type": "code",
            "metadata": {},
            "execution_count": null,
            "source": "a = np.linspace(0, 1, 5)\nb = np.linspace(0, 1, 5)\nsc.hyp2f1(a, b, 1, 0.5)",
            "outputs": [
                {
                    "output_type": "execute_result",
                    "metadata": {},
                    "data": {
                        "text/plain": "array([1.        , 1.03997334, 1.1803406 , 1.47074441, 2.        ])"
                    },
                    "execution_count": null
                }
            ]
        },
        {
            "id": "82718bb5",
            "cell_type": "code",
            "metadata": {},
            "execution_count": null,
            "source": "sc.hyp2f1(b, a, 1, 0.5)",
            "outputs": [
                {
                    "output_type": "execute_result",
                    "metadata": {},
                    "data": {
                        "text/plain": "array([1.        , 1.03997334, 1.1803406 , 1.47074441, 2.        ])"
                    },
                    "execution_count": null
                }
            ]
        },
        {
            "id": "86a194ee",
            "cell_type": "markdown",
            "source": "It contains many other functions as special cases.\n",
            "metadata": {}
        },
        {
            "id": "1515777c",
            "cell_type": "code",
            "metadata": {},
            "execution_count": null,
            "source": "z = 0.5\nsc.hyp2f1(1, 1, 2, z)",
            "outputs": [
                {
                    "output_type": "execute_result",
                    "metadata": {},
                    "data": {
                        "text/plain": "1.3862943611198901"
                    },
                    "execution_count": null
                }
            ]
        },
        {
            "id": "8983e66f",
            "cell_type": "code",
            "metadata": {},
            "execution_count": null,
            "source": "-np.log(1 - z) / z",
            "outputs": [
                {
                    "output_type": "execute_result",
                    "metadata": {},
                    "data": {
                        "text/plain": "1.3862943611198906"
                    },
                    "execution_count": null
                }
            ]
        },
        {
            "id": "75375348",
            "cell_type": "code",
            "metadata": {},
            "execution_count": null,
            "source": "sc.hyp2f1(0.5, 1, 1.5, z**2)",
            "outputs": [
                {
                    "output_type": "execute_result",
                    "metadata": {},
                    "data": {
                        "text/plain": "1.098612288668109"
                    },
                    "execution_count": null
                }
            ]
        },
        {
            "id": "47789c3d",
            "cell_type": "code",
            "metadata": {},
            "execution_count": null,
            "source": "np.log((1 + z) / (1 - z)) / (2 * z)",
            "outputs": [
                {
                    "output_type": "execute_result",
                    "metadata": {},
                    "data": {
                        "text/plain": "1.0986122886681098"
                    },
                    "execution_count": null
                }
            ]
        },
        {
            "id": "9db937bc",
            "cell_type": "code",
            "metadata": {},
            "execution_count": null,
            "source": "sc.hyp2f1(0.5, 1, 1.5, -z**2)",
            "outputs": [
                {
                    "output_type": "execute_result",
                    "metadata": {},
                    "data": {
                        "text/plain": "0.9272952180016117"
                    },
                    "execution_count": null
                }
            ]
        },
        {
            "id": "d0d76713",
            "cell_type": "code",
            "metadata": {},
            "execution_count": null,
            "source": "np.arctan(z) / z",
            "outputs": [
                {
                    "output_type": "execute_result",
                    "metadata": {},
                    "data": {
                        "text/plain": "0.9272952180016122"
                    },
                    "execution_count": null
                }
            ]
        }
    ]
}