I am new to Mathematica and struggling with its syntax.
I have a set of equations, which I would like to solve for my unknowns.
I would like to solve the first equation for the first unknown and substitute this unknown in a second equation with the result I have obtained from Solve
. Sounds easy, but for me this seems to be undoable.
Here my MWE:
g1 = a + b + 2*c + 5 == 0
g2 = a + e + c - 5 == 0
sol = Solve[g1, c]
g2 = g2 /. c -> sol
The result is:
{{-5 + a + e + (c -> 1/2 (-5 - a - b))}} == 0
which is clearly not what I wanted. In the second step I want to solve g2
for a
, assuming b
and e
are known.
g2/.sol
and don't overwriteg2=g2...
$\endgroup$