HilbertMatrix
✖
HilbertMatrix
Details and Options

- HilbertMatrix[n] or HilbertMatrix[{m,n}] gives a matrix with exact rational entries.
- The following options can be given:
-
TargetStructure Automatic the structure of the returned matrix WorkingPrecision Infinity precision at which to create entries - Possible settings for TargetStructure include:
-
Automatic automatically choose the representation returned "Dense" represent the matrix as a dense matrix "Cauchy" represent the matrix as a Cauchy matrix "Hankel" represent the matrix as a Hankel matrix "Hermitian" represent the matrix as a Hermitian matrix "Symmetric" represent the matrix as a symmetric matrix - HilbertMatrix[…,TargetStructureAutomatic] is equivalent to HilbertMatrix[…,TargetStructure"Dense"].
Examples
open allclose allBasic Examples (2)Summary of the most common use cases
Scope (2)Survey of the scope of standard use cases
Options (2)Common values & functionality for each option
TargetStructure (1)
Return the Hilbert matrix as a dense matrix:

https://wolfram.com/xid/0ywph23gnb72-e3t5fj

Return the Hilbert matrix as a Cauchy matrix:

https://wolfram.com/xid/0ywph23gnb72-numczz

Return the Hilbert matrix as a Hankel matrix:

https://wolfram.com/xid/0ywph23gnb72-g39js2

Applications (2)Sample problems that can be solved with this function
Hilbert matrices are often used to compare numerical algorithms:

https://wolfram.com/xid/0ywph23gnb72-b8c89a
Compare methods for solving for known
:

https://wolfram.com/xid/0ywph23gnb72-b4t8br

https://wolfram.com/xid/0ywph23gnb72-fpx8jq


Solve using LinearSolve with Gaussian elimination:

https://wolfram.com/xid/0ywph23gnb72-dxuf18


Solve using LinearSolve using a Cholesky decomposition:

https://wolfram.com/xid/0ywph23gnb72-izlt50

Solve using LeastSquares:

https://wolfram.com/xid/0ywph23gnb72-t7vas


https://wolfram.com/xid/0ywph23gnb72-hiwd7h

An expression for the Legendre polynomial in terms of the Hilbert matrix:

https://wolfram.com/xid/0ywph23gnb72-c4gkdd
Verify the expression for the first few cases:

https://wolfram.com/xid/0ywph23gnb72-f2uwb3

Properties & Relations (5)Properties of the function, and connections to other functions
Square Hilbert matrices are real symmetric and positive definite:

https://wolfram.com/xid/0ywph23gnb72-iqwch5

https://wolfram.com/xid/0ywph23gnb72-gqnx7n


https://wolfram.com/xid/0ywph23gnb72-csqajp


https://wolfram.com/xid/0ywph23gnb72-bea0c1

Hilbert matrices can be expressed in terms of HankelMatrix:

https://wolfram.com/xid/0ywph23gnb72-31ksf
Compare with HilbertMatrix:

https://wolfram.com/xid/0ywph23gnb72-9q9fj

Hilbert matrices can be expressed in terms of CauchyMatrix:

https://wolfram.com/xid/0ywph23gnb72-h0pems
Compare with HilbertMatrix:

https://wolfram.com/xid/0ywph23gnb72-iwn60i

The smallest eigenvalue of a square Hilbert matrix decreases exponentially with n:

https://wolfram.com/xid/0ywph23gnb72-b8vsdi

https://wolfram.com/xid/0ywph23gnb72-bsvcde


https://wolfram.com/xid/0ywph23gnb72-dkpfah

The model is a reasonable predictor of magnitude for larger values of n:

https://wolfram.com/xid/0ywph23gnb72-mfmlyb


https://wolfram.com/xid/0ywph23gnb72-02ig7

The condition number increases exponentially with n:

https://wolfram.com/xid/0ywph23gnb72-do3myn

The 2-norm condition number is the ratio of largest to smallest eigenvalue due to symmetry:

https://wolfram.com/xid/0ywph23gnb72-cj6ptt

https://wolfram.com/xid/0ywph23gnb72-s56fz

Neat Examples (4)Surprising or curious use cases
The determinant of the Hilbert matrix can be expressed in terms of the Barnes G-function:

https://wolfram.com/xid/0ywph23gnb72-fmpbzq
Verify the formula for the first few cases:

https://wolfram.com/xid/0ywph23gnb72-s7g6n

A function for computing the inverse of the Hilbert matrix:

https://wolfram.com/xid/0ywph23gnb72-b2bk6t
Verify the inverse for the first few cases:

https://wolfram.com/xid/0ywph23gnb72-fheflw

A function for computing the Cholesky decomposition of the Hilbert matrix:

https://wolfram.com/xid/0ywph23gnb72-b4axbb
Verify the Cholesky decomposition for the first few cases:

https://wolfram.com/xid/0ywph23gnb72-cynpmo

Visualize the decay of the entries of the Hilbert matrix:

https://wolfram.com/xid/0ywph23gnb72-c7amdt

Wolfram Research (2007), HilbertMatrix, Wolfram Language function, https://reference.wolfram.com/language/ref/HilbertMatrix.html (updated 2023).
Text
Wolfram Research (2007), HilbertMatrix, Wolfram Language function, https://reference.wolfram.com/language/ref/HilbertMatrix.html (updated 2023).
Wolfram Research (2007), HilbertMatrix, Wolfram Language function, https://reference.wolfram.com/language/ref/HilbertMatrix.html (updated 2023).
CMS
Wolfram Language. 2007. "HilbertMatrix." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2023. https://reference.wolfram.com/language/ref/HilbertMatrix.html.
Wolfram Language. 2007. "HilbertMatrix." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2023. https://reference.wolfram.com/language/ref/HilbertMatrix.html.
APA
Wolfram Language. (2007). HilbertMatrix. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/HilbertMatrix.html
Wolfram Language. (2007). HilbertMatrix. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/HilbertMatrix.html
BibTeX
@misc{reference.wolfram_2025_hilbertmatrix, author="Wolfram Research", title="{HilbertMatrix}", year="2023", howpublished="\url{https://reference.wolfram.com/language/ref/HilbertMatrix.html}", note=[Accessed: 08-June-2025
]}
BibLaTeX
@online{reference.wolfram_2025_hilbertmatrix, organization={Wolfram Research}, title={HilbertMatrix}, year={2023}, url={https://reference.wolfram.com/language/ref/HilbertMatrix.html}, note=[Accessed: 08-June-2025
]}