# Problems with symbolic expression from Solve[]

I have an equation which is solved by Solve[].

When I define the variables with real numbers, I get an exact solution. However, when I'm trying to use the symbolic expression for the solution, I replace (/.) the variables, and this time, I don't get any solution.

So, when I use :=, the solution exists, when I use /., the solution is 'Indeterminate', but the numbers are the same in both cases.

I need to use the symbolic expression for the solution, because I would like to solve this equation outside Mathematica.

Code:

ClearAll["Global*"]

pBE := {u1, u1, u1}
pBH := {u1, u1, u1}
zBE := {u2, u2, u2}
zBH := {u2, u2, u2}
nBE := {u3, u3, u3}

subst := {
u1 -> 192.2,
u1 -> 47,
u1 -> 0.5,
u1 -> 189.8,
u1 -> 47,
u1 -> 0.5,
u2 -> 0.25,
u2 -> -0.97,
u2 -> 0,
u2 -> 0,
u2 -> -1,
u2 -> 0,
u3 -> 0,
u3 -> 0,
u3 -> 1}

(*u1:=192.2
u1:=47
u1:=0.5
u1:=189.8
u1:=47
u1:=0.5
u2:=0.25
u2:=-0.97
u2:=0
u2:=0
u2:=-1
u2:=0
u3:=0
u3:=0
u3:=1*)

eq3 := pBE + zBE*x1 == pBH + zBH*x2 + nBE*x3
sol3 := Solve[eq3, {x1, x2, x3}]

rBE := zBE*x1 /. sol3
rBE /. subst


Comment in and out the second 'list' with the defined variables.

Images of the two cases:

You are getting 0/0 indeterminate forms, just like you would get for something like:

(a^2-b^2)/(a-b)/.{a->2, b->2}


Power::infy: Infinite expression 1/0 encountered.

Infinity::indet: Indeterminate expression 0 ComplexInfinity encountered.

Indeterminate

One possibility to avoid this is to use Cancel:

Cancel[rBE] /. subst
`

{{-2.4, 9.312, 0.}}