4
$\begingroup$

I am trying to determine whether the following equation has any real solutions for the variable $w$ in Mathematica:

exp = (gc^2*(-(gm - 2 I w)^2 - 4 wm^2) + 
   4 I gc*(gm^2 w + 4 I gm (k - w) (k + w) + 4 w (2 k^2 - w^2 + wm^2)) - 
   4 (16 k^4 - 8 I k^2 (gm - 2 I w) w + (u - w) (u + w) ((gm - 2 I w)^2 + 4 wm^2))))/
  (4 (4 k^2 + (gc - 2 I (u + w)) (gm - 2 I (w + wm))));

I want to solve

exp == 0

for real values of w. I have tried the following

Solve[exp == 0, w]
NSolve[exp == 0, w]

But both these options keep running endlessly with no output on my laptop.

How can I check if there exist any real solutions for w efficiently?

EDIT: The only constraint on all variables in my exp is that they are real.

$\endgroup$
7
  • 2
    $\begingroup$ btw, you have typo in your exp. Extra ) i.sstatic.net/jtRzBHwF.png $\endgroup$ Commented yesterday
  • 1
    $\begingroup$ @seeker "EDIT: The only constraint on all variables in my exp is that they are real." No, the only constraint was that the variable w is real. Are you going to change the question each time you receive an answer to the existing one? $\endgroup$ Commented yesterday
  • 4
    $\begingroup$ @azerbajdzan, my edit does not fundamentally change the question. There is absolutely no reason to “get hyper” about it — people can forget to include important details. This platform does not operate on an “ask once and then shut up” rule, and the edit function exists exactly for situations like this. $\endgroup$ Commented yesterday
  • 1
    $\begingroup$ @seeker Of course it is fundamentally a different question. Requiring only variable w to be real versus requiring all variables to be real makes a big difference. $\endgroup$ Commented yesterday
  • 3
    $\begingroup$ @seeker " the edit function exists exactly for situations like this." This is then strange that you didn't even bother to edit your typo/error that Nasser pointed out to you in his comment. $\endgroup$ Commented yesterday

2 Answers 2

4
$\begingroup$

EDIT: The only constraint on all variables in my exp is that they are real.

In this case, it does not look like there is a solution $w$ which is real.

Doing something like Solve[exp == 0, w, Assumptions -> Element[w, Reals]] hangs also Solve[exp == 0, Assumptions -> Element[{gc, gm, wm, k, u}, Reals]] hangs.

You can try different real values of all the parameters and check. This below is small Manipulate that does this.

This is of course is not a proof, but it can convince you a little that there is no real solution as all values I tried produce complex solution for w. There are 4 solutions for w from calling SolveValues[exp == 0, w]; which returns immediately using V 14.3. And you have 5 parameters to change.

enter image description here

You see that $w$ is complex always. You can try different ranges and increments.

Code

exp = (gc^2*(-(gm - 2 I w)^2 - 4 wm^2) + 
     4 I gc*(gm^2 w + 4 I gm (k - w) (k + w) + 
        4 w (2 k^2 - w^2 + wm^2)) - 
     4 (16 k^4 - 
        8 I k^2 (gm - 2 I w) w + (u - w) (u + w) ((gm - 2 I w)^2 + 
           4 wm^2)))/(4 (4 k^2 + (gc - 2 I (u + w)) (gm - 2 I (w + wm))));

sol = SolveValues[exp == 0, w];
Manipulate[Evaluate[sol]; Column[%],
 {{gc, 1., "gc"}, -10, 10, .1, Appearance -> "Labeled"},
 {{gm, 0, "gm"}, -10, 10, .1, Appearance -> "Labeled"},
 {{wm, 0, "wm"}, -10, 10, .1, Appearance -> "Labeled"},
 {{k, 0, "k"}, -10, 10, .1, Appearance -> "Labeled"},
 {{u, 0, "u"}, -10, 10, .1, Appearance -> "Labeled"},
 TrackedSymbols :> {gc, gm, wm, u, k}]
$\endgroup$
1
$\begingroup$

Updated answer after OP changed requirement that all variables should be real:

In fact there is an infinite family of real solutions.

exp = ((gc^2*(-(gm - 2 I w)^2 - 4 wm^2) + 
      4 I gc*(gm^2 w + 4 I gm (k - w) (k + w) + 
         4 w (2 k^2 - w^2 + wm^2)) - 
      4 (16 k^4 - 
         8 I k^2 (gm - 2 I w) w + (u - w) (u + w) ((gm - 2 I w)^2 + 
            4 wm^2))))/(4 (4 k^2 + (gc - 2 I (u + w)) (gm - 
          2 I (w + wm))));

exp /. {wm -> 2, gm -> 0, gc -> 0, k -> 0, u -> w}

0

Nothing interesting for me about it.

What is more interesting to me is the arrogant OP behavior (see comment under OP) and moreover I (and other users) have to correct OP's typo/error in his code without him willing to do so.

The second interesting thing to me is that the only correct answer in this thread got -3 votes while OP accepted an answer that incorrectly suggests there are no real solutions. Are people becoming more and more dumb on just this site or is it a global trend?

By the way I have nothing against Nasser's answer, it is a good answer with good description:

This is of course is not a proof, but it can convince you a little that there is no real solution...

So it was not addressed to Nasser or any other user who have sent an answer but to those 3 downvoters and to OP.

Original answer for original question that required only w to be real:

Choose random real w and use FindInstance, there are plenty of such sulutions.

w = 1;
FindInstance[exp == 0, Variables[exp]]

{{k -> 2, gc -> 0, u -> -Sqrt[-(303/17) - (736 I)/17], gm -> 1, 
  wm -> -1}}
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.