# HG changeset patch # User Michael Godfrey # Date 1292974675 28800 # Node ID 7c7091ffe08e3a13b9078b021c8b0b81f90e7bc8 # Parent 36dbe5124d21237abdbd095642344e723eff4365 update doc gammainc and legendre diff -r 36dbe5124d21 -r 7c7091ffe08e scripts/specfun/legendre.m --- a/scripts/specfun/legendre.m Mon Dec 20 14:59:41 2010 -0800 +++ b/scripts/specfun/legendre.m Tue Dec 21 15:37:55 2010 -0800 @@ -33,6 +33,12 @@ ## ## The Legendre Function of degree @var{n} and order @var{m}: ## +## @tex +## $$ +## P^m_n(x) = (-1)^m (1-x^2)^{m/2}{d^m\over {dx^m}}P_n (x) +## $$ +## @end tex +## @ifnottex ## @example ## @group ## m m 2 m/2 d^m @@ -40,10 +46,17 @@ ## n dx^m n ## @end group ## @end example +## @end ifnottex ## ## @noindent ## with Legendre polynomial of degree @var{n}: ## +## @tex +## $$ +## P(x) = {1\over{2^n n!}}\biggl({d^n\over{dx^n}}(x^2 - 1)^n\biggr) +## $$ +## @end tex +## @ifnottex ## @example ## @group ## 1 d^n 2 n @@ -51,6 +64,7 @@ ## n 2^n n! dx^n ## @end group ## @end example +## @end ifnottex ## ## @noindent ## @code{legendre (3, [-1.0, -0.9, -0.8])} returns the matrix: @@ -73,6 +87,12 @@ ## ## For Legendre functions of degree n and order 0: ## +## @tex +## $$ +## SP^0_n (x) = P^0_n (x) +## $$ +## @end tex +## @ifnottex ## @example ## @group ## 0 0 @@ -80,9 +100,16 @@ ## n n ## @end group ## @end example +## @end ifnottex ## ## For Legendre functions of degree n and order m: ## +## @tex +## $$ +## SP^m_n (x) = P^m_n (x)(-1)^m\biggl({2(n-m)!\over{(n+m)!}}\biggl)^{0.5} +## $$ +## @end tex +## @ifnottex ## @example ## @group ## m m m 2(n-m)! 0.5 @@ -90,6 +117,7 @@ ## n n (n+m)! ## @end group ## @end example +## @end ifnottex ## ## If the optional argument @var{normalization} is @code{"norm"}, ## compute the fully normalized associated Legendre function. @@ -98,6 +126,12 @@ ## ## For Legendre functions of degree @var{n} and order @var{m} ## +## @tex +## $$ +## NP^m_n (x) = P^m_n (x)(-1)^m\biggl({(n+0.5)(n-m)!\over{(n+m)!}}\biggl)^{0.5} +## $$ +## @end tex +## @ifnottex ## @example ## @group ## m m m (n+0.5)(n-m)! 0.5 @@ -105,6 +139,7 @@ ## n n (n+m)! ## @end group ## @end example +## @end ifnottex ## @end deftypefn ## Author: Marco Caliari diff -r 36dbe5124d21 -r 7c7091ffe08e src/DLD-FUNCTIONS/gammainc.cc --- a/src/DLD-FUNCTIONS/gammainc.cc Mon Dec 20 14:59:41 2010 -0800 +++ b/src/DLD-FUNCTIONS/gammainc.cc Tue Dec 21 15:37:55 2010 -0800 @@ -41,7 +41,7 @@ Compute the normalized incomplete gamma function,\n\ @tex\n\ $$\n\ - \\gamma (x, a) = {\\displaystyle\\int_0^x e^{-t} t^{a-1} dt \\over \\Gamma (a)}\n\ + \\gamma (x, a) = {1 \\over {\\Gamma (a)}}\\displaystyle{\\int_0^x t^{a-1} e^{-t} dt}\n\ $$\n\ @end tex\n\ @ifnottex\n\