# Solve system of equations

I wrote the following code:

Solve[{x == VIN/VOUT, VOUT == 5 VIN}, {x}]


Mathematica does not solve it. How can I get the result x=1/5?

Thank you so much for your willingness.

• what if VIN = 0? or VOUT=0? – Nasser Jul 26 '18 at 9:58
• Hello @Nasser, maybe Mathematica assumes VIN and VOUT as non zero constant by default....but this must to be verify. – Gennaro Arguzzi Jul 26 '18 at 14:24
• @Nasser - "Solve gives generic solutions only. Solutions that are valid only when continuous parameters satisfy equations are removed. Other solutions that are only conditionally valid are expressed as ConditionalExpression objects." – Bob Hanlon Jul 26 '18 at 15:45
• Another hack: Solve[Eliminate[{x == VIN/VOUT, VOUT == 5 VIN}, {VOUT}], {x}] giving {{x -> 1/5}} – user1066 Jul 29 '18 at 22:09

Solve[{x == VIN/VOUT, VOUT == 5 VIN}, {x, VOUT}]
(*{{x -> 1/5, VOUT -> 5 VIN}}*)

• Hello @UlrichNeumann, your solution is very useful. Thanks. – Gennaro Arguzzi Jul 26 '18 at 9:44
• In recent versions, you can also just use Solve[{x == VIN/VOUT, VOUT == 5 VIN}] – Mark S. Jul 26 '18 at 12:17
• ... also Solve[{x == VIN/VOUT, VOUT == 5 VIN}, {x}, MaxExtraConditions -> 1] – AccidentalFourierTransform Jul 26 '18 at 14:24
• Or Solve[{x == VIN/VOUT, VOUT == 5 VIN}, x, {VOUT}] – Bob Hanlon Jul 26 '18 at 15:38
• @rhermans - This syntax was documented in earlier versions but the documentation stopped mentioning it. However, it appears to be kept for backward compatibility. The variables to be eliminated must be in list brackets, e.g., {VOUT}. If you were to enter just VOUT then Mma would first try to interpreted it as a domain resulting in the warning: Solve::bdomv: Warning: VOUT is not a valid domain specification. Assuming it is a variable to eliminate. and then give the correct output. – Bob Hanlon Jul 30 '18 at 20:55
Reduce[
{
x == VIN/VOUT,
VOUT == 5 VIN
}, {x}
]
(* VIN == VOUT/5 && x == 1/5 && VOUT != 0 *)

Solve@Reduce[
{
x == VIN/VOUT,
VOUT == 5 VIN
}, {x}
]
(* {{VOUT -> 5 VIN, x -> 1/5}} *)