Pochhammer symbol
pochhammer(
returns
the Pochhammer Symbol (x)n.x
,n
)
Find the Pochhammer symbol for the numeric
inputs x = 3
at n = 2
.
pochhammer(3,2)
ans = 12
Find the Pochhammer symbol for the symbolic input x
at n =
3
. The pochhammer
function does not automatically
return the expanded form of the expression. Use expand
to force
pochhammer
to return the form of the expanded
expression.
syms x P = pochhammer(x, 3) P = expand(P)
P = pochhammer(x, 3) P = x^3 + 3*x^2 + 2*x
If conditions are satisfied, expand
rewrites
the solution using gamma
.
syms n x assume(x>0) assume(n>0) P = pochhammer(x, n); P = expand(P)
P = gamma(n + x)/gamma(x)
To use the variables in further computations, clear their assumptions by recreating them using
syms
.
syms n x
To convert expanded output of pochhammer
into
its factors, use factor
.
P = expand(pochhammer(x, 4)); P = factor(P)
P = [ x, x + 3, x + 2, x + 1]
Differentiate pochhammer
once
with respect to x
.
syms n x diff(pochhammer(x,n),x)
ans = pochhammer(x, n)*(psi(n + x) - psi(x))
Differentiate pochhammer
twice with respect
to n
.
diff(pochhammer(x,n),n,2)
ans = pochhammer(x, n)*psi(n + x)^2 + pochhammer(x, n)*psi(1, n + x)
Use taylor
to find the
Taylor series expansion of pochhammer
with n
= 3
around the expansion point x = 2
.
syms x taylor(pochhammer(x,3),x,2)
ans = 26*x + 9*(x - 2)^2 + (x - 2)^3 - 28
Plot the Pochhammer symbol from n = 0
to n = 4
for x
. Use axis
to display the region of interest.
syms x fplot(pochhammer(x,0:4)) axis([-4 4 -4 4]) grid on legend('n = 0','n = 1','n = 2','n = 3','n = 4','Location','Best') title('Pochhammer symbol (x)_n for n=0 to n=4')
If x
and n
are
numerical values, then an explicit numerical result is returned. Otherwise,
a symbolic function call is returned.
If both x
and x + n
are
nonpositive integers, then
The following special cases are implemented.
If n
is a positive integer, then expand(pochhammer(x,n))
returns
the expanded polynomial .
If n
is not an integer, then expand(pochhammer(x,n))
returns
a representation in terms of gamma
.