0
$\begingroup$

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: {}

$\endgroup$
4
  • $\begingroup$ See mathematica.stackexchange.com/questions/17127, also try Solve[{R == -(a*b^2)/(c*(a - b)), R == -3, a == 2, b == -6}] $\endgroup$
    – Coolwater
    Sep 7 at 9:29
  • $\begingroup$ 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. $\endgroup$ Sep 7 at 12:10
  • $\begingroup$ 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 $\endgroup$
    – Bob Hanlon
    Sep 7 at 12:56
  • 1
    $\begingroup$ @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] $\endgroup$
    – Coolwater
    Sep 7 at 13:46
1
$\begingroup$
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.

$\endgroup$
1
  • $\begingroup$ It works, thanks for the help and your advice. I'll take a look at it. $\endgroup$ Sep 7 at 12:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.