I have this nasty function in terms of $\mu$, $k$, $x$, and $z$ that I want to study when it's nonnegative (part of my research project):

$$ -9 \sqrt{2 \pi } k^{5/2} z (x-\mu )^4 e^{\frac{1}{2} k (x-\mu )^2}-4 \sqrt{2 \pi } k^{3/2} z (x-\mu )^2 e^{\frac{1}{2} k (x-\mu )^2}+6 \pi k^3 z^2 (x-\mu )^4 e^{k (x-\mu )^2}+6 k^2 (x-\mu )^4+k \left(-6 \pi z^2 e^{k (x-\mu )^2}+4 \mu ^2+4 x^2-8 \mu x\right)+7 \sqrt{2 \pi } \sqrt{k} z e^{\frac{1}{2} k (x-\mu )^2}-4 \geq 0$$

How would I code up a script to determine values $\mu, k$ such that the above holds for all $x$ such that $|x-\mu|<\epsilon$ and $z\in \mathbb{R}$. I'm just having trouble because I tried to run

Minimize[-4 + 7 E^(1/2 k (x - \[Mu])^2) Sqrt[k] Sqrt[2 \[Pi]] z - 
  4 E^(1/2 k (x - \[Mu])^2) k^(3/2) Sqrt[2 \[Pi]] z (x - \[Mu])^2 + 
  6 k^2 (x - \[Mu])^4 - 
  9 E^(1/2 k (x - \[Mu])^2) k^(5/2) Sqrt[2 \[Pi]] z (x - \[Mu])^4 + 
  6 E^(k (x - \[Mu])^2) k^3 \[Pi] z^2 (x - \[Mu])^4 + 
  k (4 x^2 - 6 E^(k (x - \[Mu])^2) \[Pi] z^2 - 8 x \[Mu] + 
     4 \[Mu]^2), {\[Mu], k}]

but that didn't work at all. I also need to add in the above constraint on $x$.

Any advice or help is appreciated.

  • $\begingroup$ Might be more tractable if you use FullSimplify and then replace x-\[Mu] with a new variable. $\endgroup$ – Daniel Lichtblau Apr 4 '20 at 17:10

Not a complete answer but these points maybe of some help to you:

  • You can use FullSimplify on your equation to return the following:

$$2 k (x-\mu )^2 \left(3 k (x-\mu )^2+2\right)+6 \pi k z^2 e^{k (x-\mu )^2} \left(k (x-\mu )^2-1\right) \left(k (x-\mu )^2+1\right)-\sqrt{2 \pi } \sqrt{k} z e^{\frac{1}{2} k (x-\mu )^2} \left(k (x-\mu )^2 \left(9 k (x-\mu )^2+4\right)-7\right)-4$$

  • Since there is a $\sqrt{k}$ involved, the region is restricted to $k \geq 0$.
  • See that the whole equation is symmetric about $(x-\mu)$. So you can essentially fix a $\mu$ and only worry about the region $(-\mu, \infty)$.
  • The only region of negative values could be due to absence or low contribution from $e^{(x-\mu)^2}$, so near low values of $x$.
  • The only parameter which does not seem to have any such constraints is $z$.
  • The rest can be found out by using
With[{\[Mu] = 0}, 
 RegionPlot3D[-4 + 6 E^(k (x - \[Mu])^2)
      k \[Pi] z^2 (-1 + k (x - \[Mu])^2) (1 + k (x - \[Mu])^2) - 
      E^(1/2 k (x - \[Mu])^2) Sqrt[k] Sqrt[2 \[Pi]]
      z (-7 + k (4 + 9 k (x - \[Mu])^2) (x - \[Mu])^2) + 
    2 k (2 + 3 k (x - \[Mu])^2) (x - \[Mu])^2 >= 0, 
   {x, 0, 100}, {z, -100, 100}, {k, 0, 10}, AxesLabel -> Automatic, 
  ImageSize -> Large, ViewPoint -> {-2, -2, -2}, 
  Lighting -> {{"Ambient", LightBlue}}]]
  • So do not use low values of $x$ and $k$. You can use Minimize also.

enter image description here


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.