I have an equation:

 eq = 1 + ( 9 / ( s*(s + 9) ) )*( k/(s + b) ) == 0;

where s == -2 + 2I (I is the imaginary unit). I know it can be solved by separating into real and imaginary parts, substituting the value of s and then equating both equations to zero and solving the simultaneous equations to find the values of b and k. But how do I make Mathematica do this for me cause it takes very long on paper.

For those that have a similar problem, this worked for me:

FindInstance [{ComplexExpand[Re[eq]] == 0,  ComplexExpand[Im[eq]] == 0}, {k, b}, Reals]

{{k -> 9.04063, b -> 5.54344}}
  • $\begingroup$ Welcome to Mathematica.SE! When posting a question, please make sure you make it clear at which point you got stuck in solving this task. What have you tried so far? If you are new to Mathematica, did you search for "equation solving" in the documentation? $\endgroup$ – Szabolcs Sep 11 '13 at 17:34
  • $\begingroup$ Link to cross post on W Community $\endgroup$ – Szabolcs Sep 11 '13 at 17:37
  • $\begingroup$ There are 2 variables (b, k) and a single equation, so there will be infinitely many solution. $\endgroup$ – Szabolcs Sep 11 '13 at 17:55
  • $\begingroup$ Is it possible to have mathematica give me at least one solution for b and k? I dont this by hand and got b = 5.54 and k =9.04, so how can i get mathematica to give me something like this. thanks $\endgroup$ – user2756746 Sep 11 '13 at 18:05
  • $\begingroup$ Take a look at FindInstance, it will try to find a solution. $\endgroup$ – Szabolcs Sep 11 '13 at 18:07

A simpler way is just specifying that the variables are real:

Solve[eq && k \[Element] Reals && b \[Element] Reals, {k, b}]

(* ==> {{k -> 424/45, b -> 28/5}} *)

Reduce also works in place of Solve.

| improve this answer | |

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.