Verifying that a functions attends values below something

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.

• 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]
– Moo
Oct 29, 2019 at 19:19
• @Moo, Thanks it works now...To be honest I wrote also Reduce[ ] ... but outside of Solve[ ] . Oct 29, 2019 at 19:27
• Maximize[{f[x], Abs[x] > 20}, x, Reals] // Simplify // Quiet indicates that for Abs[x] > 20 the function is below about 3.6803 Oct 29, 2019 at 20:56

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*)


• 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. Oct 30, 2019 at 1:17
• Actually I keyed off your question. f[x]<20. 10 is not mentioned in your question. Is that a typo? Oct 30, 2019 at 3:38
• 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. Oct 30, 2019 at 3:51
• 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. Oct 30, 2019 at 3:58
• Sorry, I just went with his code. Oct 30, 2019 at 4:01

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}]]


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