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: {}
$\begingroup$
$\endgroup$
4
1 Answer
$\begingroup$
$\endgroup$
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.
-
$\begingroup$ It works, thanks for the help and your advice. I'll take a look at it. $\endgroup$ Commented Sep 7, 2021 at 12:11
Solve[{R == -(a*b^2)/(c*(a - b)), R == -3, a == 2, b == -6}]
$\endgroup$Solve[{R == -(a*b^2)/(c*(a - b)), R == -3, a == 2, b == -6}, c, {R, a, b}]
orSolve[{R == -(a*b^2)/(c*(a - b)), R == -3, a == 2, b == -6}, c, MaxExtraConditions -> All] // Normal
$\endgroup${}
means there is no solution forc
such that your equations will beTrue
for all values of the remaining variablesR, a, b
. If that was the caseSolve
could return a solution with a variable left out, e.g.Solve[a == 2 && b(a-2) == 0, a]
$\endgroup$