0
$\begingroup$

After plotting the graph of $$f(x)=\frac{π}{3\sqrt{2 π}} (\frac{e^{\frac{-x^2}{18}}}{3} + \frac{e^{\frac{-(x - 5)^2}{2}}}{1} +\frac{e^{\frac{-(x - 15)^2}{8}}}{2} ) (1 + x^2)$$

I would like to verify with mathematica that $f(x)<20$, for $\vert{x}\vert>20$ . So I write in the notebook:

Solve[π/(3 Sqrt[2 π]) (E^(-x^2/18)/3 + E^(-(x - 5)^2/2) + 
        E^(-(x - 15)^2/8)/2) (1 + x^2) < 10 && Abs[x] > 20, Reals]]]

and then I get the message that

Solve::fulldim: The solution set contains a full-dimensional component; use Reduce for complete solution information.

On the other hand WolphramAlfa gives me the answer.

Can you please tell me what I did wrong here? Is there another way to check this inequality? Thanks.

$\endgroup$
3
  • 5
    $\begingroup$ Reduce[[Pi]/(3 Sqrt[2 [Pi]]) (E^(-x^2/18)/3 + E^(-(x - 5)^2/2) + E^(-(x - 15)^2/8)/2) (1 + x^2) < 10 && Abs[x] > 20, Reals] $\endgroup$
    – Moo
    Oct 29, 2019 at 19:19
  • 1
    $\begingroup$ @Moo, Thanks it works now...To be honest I wrote also Reduce[ ] ... but outside of Solve[ ] . $\endgroup$
    – dmtri
    Oct 29, 2019 at 19:27
  • 3
    $\begingroup$ Maximize[{f[x], Abs[x] > 20}, x, Reals] // Simplify // Quiet indicates that for Abs[x] > 20 the function is below about 3.6803 $\endgroup$
    – Bob Hanlon
    Oct 29, 2019 at 20:56

2 Answers 2

3
$\begingroup$

Updated since the question indicates one thing and the code indicates another.

Reduce can get pretty exact. Your question asks for f[x]<20, but you code tries to solve f[x]<10.

f[x_] = π/(3 Sqrt[2 π]) (E^(-x^2/18)/3 + E^(-(x - 5)^2/2) + 
    E^(-(x - 15)^2/8)/2) (1 + x^2)

If you mean f[x]<20

Reduce[f[x] < 20] // N
(*x < 12.8888 || x > 18.1476*)

which proves your premise and then some.

If you mean f[x]<10

Reduce[f[x] < 10] // N
(*x < 4.67464 || 6.01107 < x < 12.0177 || x > 19.0257*)

which also supports your premise.

$\endgroup$
7
  • 1
    $\begingroup$ I believe that you meant Reduce[f[x] < 10] // N; in which case, there are three intervals. The outer intervals being the ones of interest. $\endgroup$
    – Bob Hanlon
    Oct 30, 2019 at 1:17
  • 1
    $\begingroup$ Actually I keyed off your question. f[x]<20. 10 is not mentioned in your question. Is that a typo? $\endgroup$
    – Bill Watts
    Oct 30, 2019 at 3:38
  • 1
    $\begingroup$ the 20 in my comment was a constraint on Abs[x] not on f[x]. The OP's Solve constrained f[x] < 10. Since the maximum for f[x] with Abs[x] > 20 is about 3.6803 this shows that the constraint of f[x] < 10 is met. $\endgroup$
    – Bob Hanlon
    Oct 30, 2019 at 3:51
  • 1
    $\begingroup$ I looked at the statement right under the OP s top equation. I was not making any comment on your statements. His question contains f[x]<20. $\endgroup$
    – Bill Watts
    Oct 30, 2019 at 3:58
  • 1
    $\begingroup$ Sorry, I just went with his code. $\endgroup$
    – Bob Hanlon
    Oct 30, 2019 at 4:01
1
$\begingroup$

Here is "visual" verification with confirmation that your interval $|x|>20$ is contained in solution interval for which $f(x)<20$:

f[x_] := \[Pi]/(3 Sqrt[2 \[Pi]]) (E^(-x^2/18)/3 + E^(-(x - 5)^2/2) + 
    E^(-(x - 15)^2/8)/2) (1 + x^2)
np = NumberLinePlot[{RealAbs[x] > 20, 
    r = Reduce[f[x] < 20, x]}, {x, -20, 20}];
p = Plot[f[x], {x, -30, 30}, 
   GridLines -> {{r[[1, 2]], r[[2, 2]]}, {20}}, PlotRange -> Full];
Show[p, np]
IntervalMemberQ[
 Interval[{-Infinity, r[[1, 2]]}, {r[[2, 2]], Infinity}], 
 Interval[{-Infinity, -20}, {20, Infinity}]]

enter image description here

$\endgroup$
2
  • $\begingroup$ Nice graphics! Actually, how do you copy from notebook of mathematica and paste it to stack exchange? $\endgroup$
    – dmtri
    Oct 30, 2019 at 9:25
  • $\begingroup$ @dmtri I just use a screen capture software Jing. There are many others and mine is an old version. Just suffices for me. $\endgroup$
    – ubpdqn
    Oct 30, 2019 at 9:30

Your Answer

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

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