Hi,

Do I understand you well that A,B,C,D all matrices of type n*n? Can we assume that A is regular?

We can use a simple substitution to obtain an equivalent equation without the X’ term:

We want to solve the equation

(1) **X * A * X’ + B * X’ + X * C + D = 0**.

Consider the following identity

(2) **(X + U) * A * (X + U)’ = X * A * X’ + X * A * U’ + U * A * X’+ U * A * U’**.

Plugging (2) into (1) gives us

```
**(X + U) * A * (X + U)' - X * A * U' - U * A * U' + X * C + D = 0**,
```

where **U = B / A**. After substituting for **Y = X + U**, we obtain

```
**Y * A * Y' - (Y - U) * A * U' - U * A * U' + (Y-U) * C + D = 0**,
```

or

```
**Y * A * Y' + Y * (C - A * U') + (D - U * C) = 0**.
```

The later can be written as

(3) **Y * A * Y’ + Y * E + F = 0**,

where **U = B / A, E = C - A * U’**, and **F = D - U * C**. The equation (3) is what you mentioned you are able to solve. After obtaining the solution for Y, you substitute back for **X = Y - U**.

Do you know the general solution for the equation (3)? I know only how to solve it for a symmetric matrix A.

Can I ask you how did you get this problem? Do you need to solve equation (1) for some application problem?

Regards,

Pavel