0

I was trying out Mathematica with a simple equation. I tried this one out, but it outputted nothing and when I went on WolframAlpha to test it, there was a result (c = 3 btw). Please let me know if there is something wrong with my input. I also entered the exact same code into WolframAlpha. Much thanks!
Input: Solve[{R == -(a*b^2)/(c*(a - b)), R == -3, a == 2, b == -6}, c]
Output: {}

Karsten7
  • 27,448
  • 5
  • 73
  • 134
  • See https://mathematica.stackexchange.com/questions/17127, also try Solve[{R == -(a*b^2)/(c*(a - b)), R == -3, a == 2, b == -6}] – Coolwater Sep 07 '21 at 09:29
  • Yup, that works! Thanks a lot. Btw, why is it able to solve when I don't put the unknown variable? May I know the reason or how it works. – JayTheEnthusiast Sep 07 '21 at 12:10
  • Or Solve[{R == -(a*b^2)/(c*(a - b)), R == -3, a == 2, b == -6}, c, {R, a, b}] or Solve[{R == -(a*b^2)/(c*(a - b)), R == -3, a == 2, b == -6}, c, MaxExtraConditions -> All] // Normal – Bob Hanlon Sep 07 '21 at 12:56
  • 1
    @JayTheEnthusiast The output {} means there is no solution for c such that your equations will be True for all values of the remaining variables R, a, b. If that was the case Solve could return a solution with a variable left out, e.g. Solve[a == 2 && b(a-2) == 0, a] – Coolwater Sep 07 '21 at 13:46

1 Answers1

1
ClearAll[R, a, b, c]

Solve the equation in terms of c

Solve[R == -(a b^2)/(c (a - b)), c]

{{c -> -((a b^2)/((a - b) R))}}

These are called replacement rules. Apply more rules using /.

{{c -> -((a b^2)/((a - b) R))}} /. {R -> -3, a -> 2, b -> -6}

{{c -> 3}}

To get started with Mma:

https://www.wolfram.com/language/elementary-introduction/2nd-ed/index.html

The syntax for Mathematica is not the same as Wolfram Alpha but it is similar. In fact, if you try these commands out over at WA, these will still work. The reverse however, is not true in general.

Syed
  • 52,495
  • 4
  • 30
  • 85