Advanced maths

T Sylvester matrix equation calculator AX plus transpose X B equals C

Solve the rational matrix equation AX+X transpose B=C with exact rank and consistency classification.

Your numbers

One row per matrix row or sequence observation, comma-separated entries.
One row per matrix row or sequence observation, comma-separated entries.
Enter finite values within the stated bounds; coordinate rows may use commas.

Calculated on your device. Your inputs aren’t sent to us.

Your result

Ready when you are

Enter your inputs and select Calculate.

Report an issue

Behind the numbers

How this calculation works

Solve the rational matrix equation AX+X transpose B=C with exact rank and consistency classification.

THE FORMULALvec(X)=vec(C), where L_(ij, ab)=Aia δjb+δbi Baj.

A worked example

For A=diag(2,3), B=I and C=[[3,7],[8,4]], the unique solution is[[1,13/5],[9/5,1]].

Good to know

Same-order 1–4 rational square matrices, entries within±10000 and bounded text length. Exact vectorized row reduction; unique, inconsistent and underdetermined statuses, particular solution and homogeneous basis. No least-squares replacement for inconsistent data.

The transpose changes the operator

The ordinary Sylvester equation uses A X plus X B. This page instead uses A X plus X transpose B, so the second term couples a different set of entries. Reusing an ordinary Sylvester solver without changing its linear operator would solve the wrong matrix equation.

Although the notation includes matrix products and a transpose, the unknown entries still appear linearly. A small exact vectorization therefore converts the problem into ordinary linear equations. The task is to classify and solve that operator, not iterate a nonlinear matrix fixed point.

The transpose couples off-diagonal entries2 x12 + x21 = 7x12 + 3 x21 = 8x12 = 13/5, x21 = 9/5Exact rational solveOperator rank = 4Unique solution
Scroll across to see the full diagram.
The default equations 2x12+x21=7 andx 12+3x21=8 give 13/5 and 9/5.

Compare this with the Sylvester matrix equation calculator AX + XB = C. Solve AX+XᵀB=C, whose unknown appears transposed in the second term; AX+XB=C has a different linear operator.

Rational matrices and matching dimensions

Enter A, B and C as rational square matrices of the same order. Integers, finite decimals and explicit fractions represent exact rational inputs under the parser convention. Each order from one through four produces between one and sixteen scalar unknowns.

Exactness applies to the entered numbers. A decimal approximation to a measured coefficient becomes that exact decimal, not an uncertainty interval around it. If your intended problem is approximate or noisy, an exact inconsistent classification can be appropriate even when a separate least-squares fit would have a small residual.

The two-state worked example

For diagonal A with entries two and three and B equal to identity, diagonal equations give three times x11 equal to three and four times x22 equal to four. Both diagonal unknowns therefore equal one. The off-diagonal unknowns remain coupled through the transpose term.

Those equations are two x12 plus x21 equal to seven, and x12 plus three x21 equal to eight. Solving them gives x12 equal to thirteen-fifths and x21 equal to nine-fifths. Substitution into the original matrix equation verifies every rational entry exactly.

Constructing the vectorized equations

For output entry i, j, the first product sums Aia times Xaj over a. The transposed second product sums Xai times Baj over a. Recording these coefficients for every output entry builds a square linear operator on the ordered unknown entries of X.

The implementation performs rational row reduction on the augmented operator. This exposes pivots, free variables and inconsistent rows without relying on a floating condition threshold. The operator can be singular even when one or both of A and B are individually invertible, so their separate determinants are not enough to classify the equation.

Unique and underdetermined solutions

If the operator has full rank, the returned matrix is the unique exact solution. If it has lower rank but consistent data, the page sets free variables to zero for one particular solution and returns a basis of homogeneous solution matrices.

Every linear combination of those homogeneous matrices can be added to the particular solution. The page does not label that one selected representative as unique. Its zero choices are an explicit convenience for describing the affine solution set, not an optimization criterion such as minimum norm.

Inconsistent data and residual checks

An augmented row with zero coefficients and nonzero right-hand side proves inconsistency for the entered rational system. The result reports that status and does not fabricate a matrix by discarding the contradictory equation. A least-squares interpretation would be a different requested task.

For a consistent result, the implementation multiplies A X and X transpose B directly and compares their sum against C using exact rational arithmetic. It also derives homogeneous basis vectors from the reduced operator. These certificates check the original transpose placement rather than only trusting a vectorized solve.

Transferring a solution correctly

Keep the returned row and column order intact when exporting the matrix. A row-major vectorization in one program and column-major vectorization in another are both valid, but their operator matrices differ by a permutation. Comparing those internal arrays without their ordering convention can create a false disagreement.

Use the equation printed on this page as the final check. More general variants with additional transposes or complex conjugation need different operators. This bounded calculator handles the stated real-rational T-Sylvester equation and exposes exact finite solution status; it does not silently extend to every similarly named matrix equation.

A few questions, answered

Is this AX+XB=C?

No. The second term is X transpose times B, which changes the linear coupling of unknown entries.

Can a singular operator still have solutions?

Yes. Consistent singular cases have a particular solution plus a homogeneous solution space.

Does it return a least-squares solution if inconsistent?

No. Inconsistency is reported for the exact entered rational equation.

Are decimal inputs approximate here?

They are parsed as exact finite rationals; physical measurement uncertainty is not modeled.

Find your calculator

Start typing to explore the library.