Sylvester Equation Solver
Calculate sylvester equation instantly with our math tool. Shows detailed work, formulas used, and multiple solution methods.
Calculator
Adjust values & calculateFormula
Where A, B, and C are known matrices and X is the unknown matrix. A unique solution exists if and only if the eigenvalues of A and the negatives of the eigenvalues of B are disjoint (no common values). The solver uses the Kronecker product vectorization approach for 2x2 matrices.
Last reviewed: December 2025
Worked Examples
Example 1: Diagonal Coefficient Matrices
Example 2: Non-Diagonal Sylvester Equation
Background & Theory
The Sylvester Equation Solver applies the following established principles and formulas. Mathematics rests on a hierarchy of number systems, each extending the previous. The natural numbers (1, 2, 3, ...) support counting and ordering. The integers add negative values and zero, enabling subtraction without restriction. The rational numbers, expressible as p/q where p and q are integers and q is nonzero, close the system under division. The real numbers fill the gaps left by irrationals such as the square root of 2 or pi, forming a complete ordered field. The complex numbers, written as a + bi where i is the square root of negative one, complete the algebraic closure of the reals and allow every polynomial to have a root. Prime factorization states that every integer greater than one is uniquely expressible as a product of primes, a result known as the Fundamental Theorem of Arithmetic. Computing the greatest common divisor (GCD) of two integers relies most efficiently on the Euclidean algorithm: repeatedly replace the larger number with the remainder when it is divided by the smaller, until the remainder is zero. The last nonzero remainder is the GCD. The least common multiple (LCM) follows from the identity LCM(a, b) = |a * b| / GCD(a, b). Modular arithmetic defines equivalence classes of integers that share the same remainder under division by a modulus n. Fermat's Little Theorem and Euler's Theorem arise from this structure and underpin modern cryptography. Logarithms are the inverses of exponential functions. If b raised to the power x equals y, then the logarithm base b of y equals x. The natural logarithm uses base e, approximately 2.71828. Combinatorics counts arrangements and selections. The number of ordered arrangements (permutations) of r objects from n distinct objects is nPr = n! / (n - r)!. The number of unordered selections (combinations) is nCr = n! / (r! * (n - r)!). Pascal's triangle arranges these binomial coefficients so that each entry equals the sum of the two entries directly above it. The Fibonacci sequence, defined by F(1) = 1, F(2) = 1, and F(n) = F(n-1) + F(n-2), appears throughout nature and connects deeply to the golden ratio via Binet's formula.
History
The history behind the Sylvester Equation Solver traces back through the following developments. Mathematics as a systematic discipline traces to ancient Mesopotamia. Babylonian clay tablets dating to around 1800 BCE demonstrate knowledge of quadratic equations, Pythagorean triples, and base-60 arithmetic, suggesting a practical mathematical tradition far preceding Greek formalism. Euclid of Alexandria compiled the Elements around 300 BCE, establishing the axiomatic method that would define rigorous mathematics for over two thousand years. His work organized plane geometry, number theory, and proportion into logically chained propositions derived from a small set of postulates. The algorithm bearing his name for computing GCDs appears in Book VII and remains in use today. In the 9th century, the Persian scholar Muhammad ibn Musa Al-Khwarizmi wrote Al-Kitab al-mukhtasar fi hisab al-jabr wal-muqabala, the treatise whose title gave algebra its name. He systematized the solution of linear and quadratic equations and described procedures that operated on unknowns as objects, a conceptual leap away from purely numerical calculation. Rene Descartes introduced coordinate geometry in 1637 by uniting algebra and Euclidean geometry, allowing curves to be studied through equations. This synthesis set the stage for calculus. Isaac Newton and Gottfried Wilhelm Leibniz independently developed calculus during the 1660s and 1670s, triggering a priority dispute that lasted decades and divided British and Continental mathematicians. Carl Friedrich Gauss proved the Fundamental Theorem of Algebra in 1799, showing that every nonconstant polynomial has at least one complex root. His Disquisitiones Arithmeticae of 1801 established modern number theory. David Hilbert's formalist program at the turn of the 20th century sought to place all of mathematics on an explicit axiomatic foundation, a project that Kurt Godel's incompleteness theorems of 1931 showed to be fundamentally limited. Alan Turing's work in the 1930s on computability introduced the theoretical model of the stored-program computer and linked mathematical logic directly to the limits of algorithmic calculation. His proof that no algorithm can decide in general whether an arbitrary program will halt or run forever placed fundamental boundaries on what mathematics can mechanically determine, and it opened the discipline now known as theoretical computer science.
Key Features
- Solves linear, quadratic, and higher-degree polynomial equations step by step, returning all real and complex roots with full working shown.
- Simplifies fractions to lowest terms and computes ratios and proportions, including cross-multiplication checks and equivalent fraction generation.
- Performs complete prime factorization of any integer and computes the Greatest Common Divisor and Least Common Multiple for sets of numbers.
- Handles matrix operations including addition, scalar multiplication, matrix multiplication, determinant calculation, and full matrix inversion for square matrices.
- Evaluates all standard trigonometric functions and their inverses in degrees or radians, and verifies common trigonometric identities symbolically.
- Calculates permutations, combinations, and binomial coefficients for combinatorics problems, supporting both formula display and step-by-step breakdown.
- Converts integers between binary, octal, decimal, and hexadecimal bases instantly, with optional display of the positional value expansion.
- Computes the sum of arithmetic and geometric sequences given the first term, common difference or ratio, and number of terms, with formula derivation.
Frequently Asked Questions
Formula
AX + XB = C
Where A, B, and C are known matrices and X is the unknown matrix. A unique solution exists if and only if the eigenvalues of A and the negatives of the eigenvalues of B are disjoint (no common values). The solver uses the Kronecker product vectorization approach for 2x2 matrices.
Worked Examples
Example 1: Diagonal Coefficient Matrices
Problem: Solve AX + XB = C where A = [[1,0],[0,2]], B = [[3,0],[0,4]], C = [[5,6],[7,8]].
Solution: Since A and B are diagonal, the equation simplifies element-wise:\n(a_ii + b_jj) * x_ij = c_ij\nx_11 = 5/(1+3) = 1.25\nx_12 = 6/(1+4) = 1.2\nx_21 = 7/(2+3) = 1.4\nx_22 = 8/(2+4) = 1.333\nX = [[1.25, 1.2], [1.4, 1.333]]
Result: X = [[1.25, 1.2], [1.4, 1.333]] | Residual = 0
Example 2: Non-Diagonal Sylvester Equation
Problem: Solve AX + XB = C where A = [[2,1],[0,3]], B = [[1,0],[1,2]], C = [[10,8],[9,12]].
Solution: Form the 4x4 system using Kronecker products:\n(I kron A + B^T kron I) * vec(X) = vec(C)\nSolve the 4x4 system by Gaussian elimination\nEigenvalues of A: 2, 3\nEigenvalues of -B: -1, -2 (disjoint from A eigenvalues)\nUnique solution exists
Result: Solution X found via Kronecker product method | Residual near 0
Frequently Asked Questions
What is the Sylvester equation?
The Sylvester equation is a matrix equation of the form AX + XB = C, where A, B, and C are known matrices and X is the unknown matrix to be solved for. Named after James Joseph Sylvester who studied it in the 19th century, this equation arises naturally in many areas of mathematics, engineering, and control theory. The equation has a unique solution if and only if the eigenvalues of A and the negatives of the eigenvalues of B have no values in common. When this condition holds, the solution X can be found using various numerical methods including the Bartels-Stewart algorithm, which first reduces A and B to Schur form.
When does the Sylvester equation have a unique solution?
The Sylvester equation AX + XB = C has a unique solution if and only if the spectra (sets of eigenvalues) of A and -B are disjoint, meaning no eigenvalue of A equals any eigenvalue of -B. This is equivalent to saying that for every pair of eigenvalues lambda_i of A and mu_j of B, lambda_i + mu_j is not equal to zero. When this condition fails, the equation either has no solution or infinitely many solutions, depending on the right-hand side C. This condition can be checked before attempting to solve the equation by computing the eigenvalues of both matrices and verifying no sums equal zero.
How is the Sylvester equation solved numerically?
The most efficient numerical method is the Bartels-Stewart algorithm, which first computes the Schur decompositions A = Q_A * T_A * Q_A^T and B = Q_B * T_B * Q_B^T. The equation is then transformed to T_A * Y + Y * T_B = D (where Y and D are transformed versions of X and C), which can be solved column by column using back substitution because T_A and T_B are triangular. This approach costs about 25n^3 operations for n-by-n matrices. Alternatively, the equation can be vectorized using Kronecker products to form a larger standard linear system, though this is less efficient with n^6 complexity.
What is the Kronecker product approach to solving the Sylvester equation?
The vectorization approach converts AX + XB = C into a standard linear system by stacking the columns of X into a single vector. Using the vec operator and Kronecker product properties, the equation becomes (I kron A + B-transpose kron I) * vec(X) = vec(C). This transforms the matrix equation into a system of n-squared linear equations in n-squared unknowns, which can be solved by standard methods like Gaussian elimination. While conceptually simple and useful for small matrices, this approach is computationally expensive for large matrices because the system size grows quadratically with the original matrix dimension.
What are the main applications of the Sylvester equation?
The Sylvester equation appears extensively in control theory, where it arises in observer design, controller synthesis, and model reduction. In signal processing, it connects to the solution of Wiener-Hopf equations. In numerical linear algebra, solving Sylvester equations is a subroutine in computing matrix square roots, matrix logarithms, and the matrix sign function. The closely related Lyapunov equation (AX + XA^T = C) is fundamental in stability analysis of dynamical systems. In computer science, Sylvester equations appear in model order reduction for circuit simulation and in computational methods for partial differential equations.
What is the difference between Sylvester and Lyapunov equations?
The Lyapunov equation AX + XA^T = C is a special case of the Sylvester equation where B = A^T (or B = A* for the complex case). This specialization has important theoretical and computational implications. The Lyapunov equation arises specifically in stability analysis: a linear system dx/dt = Ax is stable if and only if for any positive definite C, the Lyapunov equation has a positive definite solution X. Specialized algorithms exploit the symmetry of the Lyapunov equation for greater efficiency. The continuous Lyapunov equation uses AX + XA^T, while the discrete version uses AXA^T - X = C.
References
Reviewed by Manoj Kumar, Mathematics Educator ยท Editorial policy