{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "今回扱うガウスの超幾何関数$F(a,b,c,z)$は次のセルの式で定義されます。ここで登場する$(a)_n$はポッホハマー記号と呼ばれ次の式で定義されます。\n", "$$(a)_n=\\prod_{k=0}^{n-1}(a+k)=\\frac{\\Gamma(a+n)}{\\Gamma(a)}$$" ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [ { "data": { "text/latex": [ "\\[\\tag{${\\it \\%o}_{1}$}F\\left( \\left. \\begin{array}{c}a,\\;b\\\\c\\end{array} \\right |,z\\right)=\\sum_{n=0}^{\\infty }{\\frac{\\left(a\\right)_{n}\\,\\left(b\\right)_{n}\\,z^{n}}{\\left(c\\right)_{n}\\,n!}}\\]" ], "text/plain": [ " inf n\n", " ==== (a) (b) z\n", " \\ n n\n", "(%o1) hypergeometric([a, b], [c], z) = > ------------\n", " / (c) n!\n", " ==== n\n", " n = 0" ], "text/x-maxima": [ "hypergeometric([a,b],[c],z) = 'sum((pochhammer(a,n)*pochhammer(b,n)*z^n)\n", " /(pochhammer(c,n)*n!),n,0,inf)" ] }, "execution_count": 1, "metadata": {}, "output_type": "execute_result" }, { "name": "stdout", "output_type": "stream", "text": [ "SB-KERNEL:REDEFINITION-WITH-DEFUN: redefining MAXIMA::SIMP-HYPERGEOMETRIC in DEFUN\n", "SB-KERNEL:REDEFINITION-WITH-DEFUN: redefining MAXIMA::SIMP-UNIT-STEP in DEFUN\n", "SB-KERNEL:REDEFINITION-WITH-DEFUN: redefining MAXIMA::SIMP-POCHHAMMER in DEFUN\n" ] } ], "source": [ "hypergeometric([a,b],[c],z)=sum(pochhammer(a,n)*pochhammer(b,n)/(pochhammer(c,n)*n!)*z^n,n,0,inf);" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "超幾何関数は$a,b,c,z$に様々な値や式を代入することで、多くの初等関数や特殊関数を表すことができます。ここでは$\\cos{z}$が次の超幾何関数で表されることを見てます。確認のために次の超幾何関数と$\\cos{z}$をテイラー展開して係数が一致することを見てみましょう。" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [ { "data": { "text/latex": [ "\\[\\tag{${\\it \\%o}_{2}$}F\\left( \\left. \\begin{array}{c}\\\\\\frac{1}{2}\\end{array} \\right |,-\\frac{z^2}{4}\\right)\\]" ], "text/plain": [ " 2\n", " 1 z\n", "(%o2) hypergeometric([], [-], - --)\n", " 2 4" ], "text/x-maxima": [ "hypergeometric([],[1/2],-z^2/4)" ] }, "execution_count": 2, "metadata": {}, "output_type": "execute_result" } ], "source": [ "hypergeometric([],[1/2],-z^2/4);" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [ { "data": { "text/latex": [ "\\[\\tag{${\\it \\%o}_{3}$}-\\frac{z^{14}}{87178291200}+\\frac{z^{12}}{479001600}-\\frac{z^{10}}{3628800}+\\frac{z^8}{40320}-\\frac{z^6}{720}+\\frac{z^4}{24}-\\frac{z^2}{2}+1\\]" ], "text/plain": [ " 14 12 10 8 6 4 2\n", " z z z z z z z\n", "(%o3) (- -----------) + --------- - ------- + ----- - --- + -- - -- + 1\n", " 87178291200 479001600 3628800 40320 720 24 2" ], "text/x-maxima": [ "(-z^14/87178291200)+z^12/479001600-z^10/3628800+z^8/40320-z^6/720+z^4/24-z^2/2\n", " +1" ] }, "execution_count": 3, "metadata": {}, "output_type": "execute_result" } ], "source": [ "taylor(%o2,z,0,15);" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [ { "data": { "text/latex": [ "\\[\\tag{${\\it \\%o}_{4}$}-\\frac{z^{14}}{87178291200}+\\frac{z^{12}}{479001600}-\\frac{z^{10}}{3628800}+\\frac{z^8}{40320}-\\frac{z^6}{720}+\\frac{z^4}{24}-\\frac{z^2}{2}+1\\]" ], "text/plain": [ " 14 12 10 8 6 4 2\n", " z z z z z z z\n", "(%o4) (- -----------) + --------- - ------- + ----- - --- + -- - -- + 1\n", " 87178291200 479001600 3628800 40320 720 24 2" ], "text/x-maxima": [ "(-z^14/87178291200)+z^12/479001600-z^10/3628800+z^8/40320-z^6/720+z^4/24-z^2/2\n", " +1" ] }, "execution_count": 4, "metadata": {}, "output_type": "execute_result" } ], "source": [ "taylor(cos(z),z,0,15);" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "超幾何関数が初等関数や特殊関数で表せる場合に、Maximaではそのような簡約を実行することができます。%o2として定義した超幾何関数を簡約してみましょう。" ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [ { "data": { "text/latex": [ "\\[\\tag{${\\it \\%o}_{6}$}\\cos z\\]" ], "text/plain": [ "(%o6) cos(z)" ], "text/x-maxima": [ "cos(z)" ] }, "execution_count": 5, "metadata": {}, "output_type": "execute_result" } ], "source": [ "besselexpand:true$\n", "hypergeometric_simp(%o2);" ] }, { "cell_type": "code", "execution_count": 6, "metadata": {}, "outputs": [ { "data": { "text/latex": [ "\\[\\tag{${\\it \\%o}_{7}$}F\\left( \\left. \\begin{array}{c}\\\\\\frac{1}{2}\\end{array} \\right |,-\\frac{z^2}{4}\\right)\\]" ], "text/plain": [ " 2\n", " 1 z\n", "(%o7) hypergeometric([], [-], - --)\n", " 2 4" ], "text/x-maxima": [ "hypergeometric([],[1/2],-z^2/4)" ] }, "execution_count": 6, "metadata": {}, "output_type": "execute_result" } ], "source": [ "hypergeometric([],[1/2],-z^2/4);" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "上記の式で定義された超幾何関数が$\\cos{z}$に等しいことを級数展開の係数が一致することで証明します。\n", "$$\\cos{z}=\\sum_{n=0}^{\\infty}\\frac{(-1)^n\\,z^{2\\,n}}{(2\\,n)!}$$\n", "は既知とします。\n", "超幾何関数の定義式より、$F\\left( \\left. \\begin{array}{c}\\\\c\\end{array} \\right |,x\\right)=\\sum_{n=0}^{\\infty}\\frac{x^n}{(c)_n\\,n!}$ですから、この総和記号の中身と$\\cos{z}$の展開式の総和記号の中身が一致することを示します。" ] }, { "cell_type": "code", "execution_count": 7, "metadata": {}, "outputs": [ { "data": { "text/latex": [ "\\[\\tag{${\\it \\%o}_{9}$}\\frac{x^{n}}{\\left(c\\right)_{n}\\,n!}\\]" ], "text/plain": [ " n\n", " x\n", "(%o9) -------\n", " (c) n!\n", " n" ], "text/x-maxima": [ "x^n/(pochhammer(c,n)*n!)" ] }, "execution_count": 7, "metadata": {}, "output_type": "execute_result" } ], "source": [ "declare(n,integer)$\n", "1/pochhammer(c,n)*x^n/n!;" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "ポッホハマー記号および階乗記号をガンマ関数に書き直してみます。" ] }, { "cell_type": "code", "execution_count": 8, "metadata": {}, "outputs": [ { "data": { "text/latex": [ "\\[\\tag{${\\it \\%o}_{10}$}\\frac{\\Gamma\\left(c\\right)\\,x^{n}}{\\Gamma\\left(n+1\\right)\\,\\Gamma\\left(n+c\\right)}\\]" ], "text/plain": [ " n\n", " gamma(c) x\n", "(%o10) -------------------------\n", " gamma(n + 1) gamma(n + c)" ], "text/x-maxima": [ "(gamma(c)*x^n)/(gamma(n+1)*gamma(n+c))" ] }, "execution_count": 8, "metadata": {}, "output_type": "execute_result" } ], "source": [ "makegamma(%);" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "ここに$c=\\frac{1}{2}, x=-\\frac{z^2}{4}$を代入してみます。" ] }, { "cell_type": "code", "execution_count": 9, "metadata": {}, "outputs": [ { "data": { "text/latex": [ "\\[\\tag{${\\it \\%o}_{11}$}\\frac{\\sqrt{\\pi}\\,\\left(-1\\right)^{n}\\,z^{2\\,n}}{4^{n}\\,\\Gamma\\left(n+\\frac{1}{2}\\right)\\,\\Gamma\\left(n+1\\right)}\\]" ], "text/plain": [ " n 2 n\n", " sqrt(%pi) (- 1) z\n", "(%o11) ----------------------------\n", " n 1\n", " 4 gamma(n + -) gamma(n + 1)\n", " 2" ], "text/x-maxima": [ "(sqrt(%pi)*(-1)^n*z^(2*n))/(4^n*gamma(n+1/2)*gamma(n+1))" ] }, "execution_count": 9, "metadata": {}, "output_type": "execute_result" } ], "source": [ "CTERM:%,c=1/2,x=-z^2/4;" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "半整数に対するガンマ関数の計算をルールとして定義してそれを適用します。定義しているルールは、\n", "$$\\Gamma(n+\\frac{1}{2})=\\sqrt{\\pi}\\,\\frac{(2\\,n-1)!!}{2^n}$$\n", "です。ただ、Maximaの2重階乗の処理の都合でgenfact関数に変換されて表示されます。" ] }, { "cell_type": "code", "execution_count": 10, "metadata": {}, "outputs": [ { "data": { "text/latex": [ "\\[\\tag{${\\it \\%o}_{13}$}{\\it gamma\\_half\\_int}:\\Gamma\\left(\\exp +\\frac{1}{2}\\right)\\rightarrow \\frac{\\sqrt{\\pi}\\,{\\it genfact}\\left(2\\,\\exp -1 , \\frac{2\\,\\exp -1}{2} , 2\\right)}{2^{\\exp }}\\]" ], "text/plain": [ " 1\n", "(%o13) gamma_half_int : gamma(exp + -) -> \n", " 2\n", " 2 exp - 1\n", " sqrt(%pi) genfact(2 exp - 1, ---------, 2)\n", " 2\n", " ------------------------------------------\n", " exp\n", " 2" ], "text/x-maxima": [ "gamma_half_int:marrow(gamma(exp+1/2),\n", " (sqrt(%pi)*''genfact(2*exp-1,(2*exp-1)/2,2))/2^exp)" ] }, "execution_count": 10, "metadata": {}, "output_type": "execute_result" } ], "source": [ "matchdeclare(exp,lambda([exp],featurep(exp,integer)))$\n", "defrule(gamma_half_int,gamma(exp+1/2),sqrt(%pi)*(2*exp-1)!!/2^exp);" ] }, { "cell_type": "code", "execution_count": 11, "metadata": {}, "outputs": [ { "data": { "text/latex": [ "\\[\\tag{${\\it \\%o}_{14}$}\\frac{\\left(-1\\right)^{n}\\,2^{n}\\,z^{2\\,n}}{4^{n}\\,\\Gamma\\left(n+1\\right)\\,{\\it genfact}\\left(2\\,n-1 , \\frac{2\\,n-1}{2} , 2\\right)}\\]" ], "text/plain": [ " n n 2 n\n", " (- 1) 2 z\n", "(%o14) --------------------------------------------\n", " n 2 n - 1\n", " 4 gamma(n + 1) genfact(2 n - 1, -------, 2)\n", " 2" ], "text/x-maxima": [ "((-1)^n*2^n*z^(2*n))/(4^n*gamma(n+1)*genfact(2*n-1,(2*n-1)/2,2))" ] }, "execution_count": 11, "metadata": {}, "output_type": "execute_result" } ], "source": [ "apply1(CTERM,gamma_half_int);" ] }, { "cell_type": "code", "execution_count": 12, "metadata": {}, "outputs": [ { "data": { "text/latex": [ "\\[\\tag{${\\it \\%o}_{15}$}\\frac{\\left(-1\\right)^{n}\\,z^{2\\,n}}{2^{n}\\,\\Gamma\\left(n+1\\right)\\,{\\it genfact}\\left(2\\,n-1 , \\frac{2\\,n-1}{2} , 2\\right)}\\]" ], "text/plain": [ " n 2 n\n", " (- 1) z\n", "(%o15) --------------------------------------------\n", " n 2 n - 1\n", " 2 gamma(n + 1) genfact(2 n - 1, -------, 2)\n", " 2" ], "text/x-maxima": [ "((-1)^n*z^(2*n))/(2^n*gamma(n+1)*genfact(2*n-1,(2*n-1)/2,2))" ] }, "execution_count": 12, "metadata": {}, "output_type": "execute_result" } ], "source": [ "%,radcan;" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "色々と約分されてようやくここまで変形できました。$genfact(2\\,n-1,\\frac{(2\\,n-1)}{2},2)=(2\\,n-1)!!$であることを思い出してください。これは$2\\,n-1$以下の全ての奇数の積です。\n", "\n", "$\\Gamma(n+1)=n!$なのでこれは$n$以下の全ての自然数の積です。最初の$2^n$をこの$n!$に分けてかけると、$2\\,n$以下の全ての偶数の積が得られます。つまり$2^n\\cdot \\Gamma(n+1)=(2\\,n)!!$です。\n", "\n", "したがって上記の式の分母は$(2\\,n)!!\\cdot(2\\,n-1)!!$となるのですが、この積は結局$2\\,n$以下の全ての自然数の積になります。つまり$(2\\,n)!$に等しくなります。というわけで上記の式は次の式に等しくなります。\n", "$$\\frac{\\left(-1\\right)^{n}\\,z^{2\\,n}}{(2\\,n)!}$$\n", "\n", "$\\cos{z}$のテイラー展開と一致していることが分かります。\n", "(証明終了)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## 超幾何関数の定義とcos zの超幾何関数表現\n", "\n", "Copyright 2021 Yasuaki Honda (yasuaki.honda@gmail.com)\n", "GPL2\n", "\n", "If you want to use this file with different licensing terms, please email me." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Maxima", "language": "maxima", "name": "maxima" }, "language_info": { "codemirror_mode": "maxima", "file_extension": ".mac", "mimetype": "text/x-maxima", "name": "maxima", "pygments_lexer": "maxima", "version": "5.45.1" } }, "nbformat": 4, "nbformat_minor": 4 }