# why mathematica Holds the Solve on the set of equations in the diagonal a matrix?

Say I have a simple function

F[x_, y_, z_, r_, a_, b_, c_, d_] := (1 - a + b - (b/3) (c x + d (y + z + r))) x


And I want to solve the set of equations given by:

x == F[x,y,z,r,a,b,c,d]
y == F[y,x,z,r,a,b,c,d]
z == F[z,x,y,r,a,b,c,d]
r == F[r,x,y,z,a,b,c,d]


The variables are x,y,z,r; a,b,c,d are parameters; and the only important position is the first of the 4 variables in each equation of the type x==F[x,y,z,r,...]

I figured I should solve this system by the command

Solve[Diagonal[Table[m==n,{m,{x,y,z,r}},{n,{F[x,y,z,r,a,b,c,d],F[y,x,z,r,a,b,c,d],F[z,y,x,r,a,b,c,d],F[r,y,z,x,a,b,c,d]}}]],{x,y,z,r}]


However, Mathematica doesn't evaluate the Solve command, it simply prints back the command without giving it a try...

• What am I missing?

• Is there a simpler way to build the system of equations?

• Is it possible to do for any number of variables? (here, I have 4 variables, ideally I'd want it working for n variables)

In math, the general system of equations would look like this:

$$\vec{x}=\vec{F}(\vec{x})$$


and I want to solve for each component of $$\vec{x}$$

Are you sure you had defined F before trying Solve? Is the F in your notebook blue (undefined) or black (properly defined)? Does Solve return an error of any kind?

This is what I get:

ClearAll[F]
F[x_, y_, z_, r_, a_, b_, c_, d_] := (1 - a + b - (b/3) (c x + d (y + z + r))) x

Solve[
{x == F[x, y, z, r, a, b, c, d],
y == F[y, x, z, r, a, b, c, d],
z == F[z, y, x, r, a, b, c, d],
r == F[r, y, z, x, a, b, c, d]},
{x, y, z, r}
]


• I suspect F was defined as F[x,y,z,a,b,c,d] without the r Jul 8, 2020 at 17:03
• @Girardi Yep that could be a reason as well. I tend to add a Clear before any function definition to make sure that old definitions don't linger etc. Jul 8, 2020 at 17:04