Method on @sym: hypergeom (a, b, z)

Symbolic generalized hypergeometric function.

Example:

syms z
hypergeom ([1, 2, 3], [4, 5], z)
  ⇒ (sym)
       ┌─  ⎛1, 2, 3 │  ⎞
       ├─  ⎜        │ z⎟
      3╵ 2 ⎝  4, 5  │  ⎠

Simplifying can be useful to express a hypergeometric function in terms of more elementary functions:

simplify (hypergeom ([1 1], 2, -z))
  ⇒ (sym)
      log(z + 1)
      ──────────
          z

The function can be ‘vectorized’ over z:

syms a b c
hypergeom([a b], c, [z 1/z 8])
  ⇒ (sym 1×3 matrix)
      ⎡ ┌─  ⎛a, b │  ⎞   ┌─  ⎛a, b │ 1⎞   ┌─  ⎛a, b │  ⎞⎤
      ⎢ ├─  ⎜     │ z⎟   ├─  ⎜     │ ─⎟   ├─  ⎜     │ 8⎟⎥
      ⎣2╵ 1 ⎝ c   │  ⎠  2╵ 1 ⎝ c   │ z⎠  2╵ 1 ⎝ c   │  ⎠⎦

The hypergeometric function can be differentiated, for example:

w = hypergeom([a b], c, z)
  ⇒ w = (sym)
       ┌─  ⎛a, b │  ⎞
       ├─  ⎜     │ z⎟
      2╵ 1 ⎝ c   │  ⎠

diff(w, z)
  ⇒ (sym)
           ┌─  ⎛a + 1, b + 1 │  ⎞
      a⋅b⋅ ├─  ⎜             │ z⎟
          2╵ 1 ⎝   c + 1     │  ⎠
      ───────────────────────────
                   c

Package: symbolic