# Solving and replacing solution for solving again

Given some equation to solve

S1=Solve[f[x,z]==g[x,z],x]//Simplify


which produces something like

x->xsol[z]


I write another equation that must use the result above, so

S2=Solve[h[x,y,z]==j[x,y,z],y]/.S1//Simplify


but it gives

y-> y[(x->xsol),z]


I mean, it didnt replace x=xsol. How can I improve this steps?

• Move the /.S1 inside the Solve and attach it to the equation instead? – march Sep 23 '15 at 20:57

Use the replacement, i.e. /.S1 inside the solver. That is,
S2=Solve[h[x,y,z]==j[x,y,z]/.S1,y]//Simplify