I'm trying isolate for X in the function, but I'm making an error that I can't find where exactly I've gone wrong. $A,B,C,D $ and $X$ are all n x n matrices. Here are my steps.
$$AX(D+BX)^{-1} = C$$
Multiply $(D+BX)^{-1}$ to both sides
$$AX = (D+BX)C$$
Expand
$$AX = DC+BXC$$
Subtract $BXC$
$$AX - BXC = DC$$
Factor X
$$X(A - BC) = DC$$
Multiply by the inverse of $(A-BC)$ And end with
$$X = (A-BC)^{-1}DC$$
I am uncertain about some of the operations I'm performing and their legality, such as the factoring of X and multiplying by both sides correctly. Any help is appreciated, Thank you!
It looks to me like your main error lies in assuming matrices commute when they don't in general. For example, the equation
$AX(D + BX)^{-1} = C \tag 1$
implies
$AX = C(D + BX), \tag 2$
but not necessarily
$AX = (D + BX)C; \tag 2$
similarly,
$AX - BXC = DC \tag 3$
does not typically imply
$X(A - BC) = DC, \tag 4$
since $X$ usually won't commute with $A$ or $B$:
$XA \ne AX; \; XB \ne BX. \tag 5$
These issues may be avoided as follows:
from (1),
$AX = C(D + BX); \tag 6$
then
$AX = CD + CBX, \tag 7$
or
$(A - CB)X = CD; \tag 8$
if now we know--or assume--that $A - CB$ is invertible, we have
$X = (A - CB)^{-1}CD. \tag 9$