# How to solve this inequality correctly?

Find the value range of real number a, so that for any real number x and $$\theta \in\left[0, \frac{\pi}{2}\right]$$, make $$(x+3+2 \sin \theta \cos \theta)^{2}+(x+a \sin \theta+a \cos \theta)^{2} \geqslant \frac{1}{8}$$ constant.

ForAll[{θ, x},
0 <= θ <= Pi/
2, (x + 3 + 2 Sin[θ] Cos[θ])^2 + (x +
a*Sin[θ] + a*Cos[θ])^2 >= 1/8]
Resolve[%, Reals]


But the above code has been running, can not get the correct result. How to solve this problem correctly?

• This uses Reduce[] and not Resolve[], but using the Weierstrass substitution (as always) goes a long way: Simplify[Reduce[FullSimplify[TrigExpand[(x + 3 + 2 Sin[θ] Cos[θ])^2 + (x + a Sin[θ] + a Cos[θ])^2 >= 1/8 /. θ -> 2 ArcTan[t]]] && 0 < t < 1, {t, a, x}] /. t -> Tan[θ/2]] Feb 24 at 7:01

We set $$y=\cos\theta$$ and $$z=\sin\theta$$,then according to the conditions, $$y^2+z^2==1$$ and $$y\geq 0, z\geq 0$$.

And we consider the inverse problem,that is Exists $$x,y,z$$ such that $$(x + 3 + 2 zy)^2 + (x + az + ay)^2 \leq 1/8$$

# Method one

Maximize[{a, (x + 3 + 2 z*y)^2 + (x + a*z + a*y)^2 <= 1/8, y >= 0,
z >= 0, y^2 + z^2 == 1}, {x, y, z, a}]


7/2, {x -> -(13/4), y -> 0, z -> 1, a -> 7/2}}

Minimize[{a, (x + 3 + 2 z*y)^2 + (x + a*z + a*y)^2 <= 1/8, y >= 0,
z >= 0, y^2 + z^2 == 1}, {x, y, z, a}]


{Sqrt[6], {..., a -> Sqrt[6]}}

# Method two

Resolve[Exists[{x, y,
z}, {(x + 3 + 2 z*y)^2 + (x + a*z + a*y)^2 <1/8, y >= 0, z >= 0,
y^2 + z^2 == 1}], Reals]


Sqrt[6] < a < 7/2

• I see the inequality $$(x+3+2 \sin \theta \cos \theta)^{2}+(x+a \sin \theta+a \cos \theta)^{2} \geqslant \frac{1}{8}$$ in the question under consideration, not $\le$. Feb 24 at 12:44
• @user64494 Note that Forall x,y,z, f(x,y,z)>=c opposition Exist x,y,z, f(x,y,z)<c Feb 24 at 12:56
• The inverse inequality is $$(x+3+2 \sin \theta \cos \theta)^{2}+(x+a \sin \theta+a \cos \theta)^{2}< \frac{1}{8}$$ and Maximize[{a, (x + 3 + 2 z*y)^2 + (x + a*z + a*y)^2 < 1/8 && y >= 0 && z >= 0 && y^2 + z^2 == 1}, {x, y, z, a}] performs the message "Maximize::wksol: Warning: there is no maximum in the region in which the objective function is defined and the constraints are satisfied; a result on the boundary will be returned." Feb 24 at 13:02
• You correctly found the bounds for a, but for the negation of the problem under consideration, not the problem. This is not it. Feb 24 at 13:12
• @user64494 This means that a=7/2 and a=Sqrt[6] can not attain at the negation problem,so it indicate that Sqrt[6] < a < 7/2 Feb 24 at 13:35

According to ForAll documentation, when you use multiple variables, you can't specify a satisfying condition, your ForAll code has one extra argument:

Resolve[ForAll[
x, (x + 3 + 2 Sin[\[Theta]] Cos[\[Theta]])^2 + (x +
a*Sin[\[Theta]] + a*Cos[\[Theta]])^2 >= 1/8 &&
0 <= \[Theta] <= Pi/2], Reals]


Out:

• But the reference answer is $a \leq \sqrt{6}$ or $a \geq \frac{7}{2}$. Feb 24 at 8:05

Executing an equivalent form of your code

Reduce[ForAll[{x, \[Theta]}, (x + 3 +
2 Sin[\[Theta]] Cos[\[Theta]])^2 + (x + a*Sin[\[Theta]] +
a*Cos[\[Theta]])^2 >= 1/8 && \[Theta] >= 0 && \[Theta] <=
Pi/2], a, Reals]


, one obtains

...Reduce:This system cannot be solved with the methods available to Reduce

However, this can be done in two steps. First,

Reduce[ForAll[x, (x + 3 + 2 Sin[\[Theta]] Cos[\[Theta]])^2 + (x +
a*Sin[\[Theta]] + a*Cos[\[Theta]])^2 >= 1/8 && \[Theta] >=
0 && \[Theta] <= Pi/2], a, Reals] // Simplify


(\[Theta] >= 0 && 2 \[Theta] < \[Pi] && (a <= (5 + 4 Cos[\[Theta]] Sin[\[Theta]])/( 2 (Cos[\[Theta]] + Sin[\[Theta]])) || a >= (7 + 4 Cos[\[Theta]] Sin[\[Theta]])/( 2 (Cos[\[Theta]] + Sin[\[Theta]])))) || (2 \[Theta] == \[Pi] && (2 a <= 5 || 2 a >= 7))

produces the required bounds for concrete values of \[Theta].

Second, one finds the bounds valid for all $$\theta \in [0,\pi/2]$$ by

Minimize[{(5 + 4 Cos[\[Theta]] Sin[\[Theta]])/(2 (Cos[\[Theta]] + Sin[\[Theta]])),
[Theta] >= 0 && \[Theta] <= Pi/2}, \[Theta]]


{(5 + 4 Cos[2 ArcTan[ Root[1 - 8 # + 2 #^2 + 8 #^3 + #^4& , 3, 0]]] Sin[2 ArcTan[ Root[1 - 8 # + 2 #^2 + 8 #^3 + #^4& , 3, 0]]])/(2 (Cos[2 ArcTan[ Root[1 - 8 # + 2 #^2 + 8 #^3 + #^4& , 3, 0]]] + Sin[2 ArcTan[ Root[1 - 8 # + 2 #^2 + 8 #^3 + #^4& , 3, 0]]])), {\[Theta] -> 2 ArcTan[ Root[1 - 8 # + 2 #^2 + 8 #^3 + #^4& , 3, 0]]}}

which produces the upper bouds for a in terms of quadric and this can be expressed through radicals. To obtain numbers,

N[%]


{2.44949, {\[Theta] -> 0.261799}}

The lower bound for a is simpler.

Maximize[{(7 + 4 Cos[\[Theta]] Sin[\[Theta]])/(2 (Cos[\[Theta]] + Sin[\[Theta]])), \
[Theta] >= 0 && \[Theta] <= Pi/2}, \[Theta]]


{7/2, {\[Theta] -> 0}}

Therefore, since $$2.44949 <5/2$$, there is no bounds for a which are valid for all the $$\theta \in [0,\pi/2]$$.

• Thank you very much for your help, but it's strange that the reference answer is $a \leq \sqrt{6}$ or $a \geq \frac{7}{2}$. Feb 24 at 8:07
• @Alittlemouseonthepampas: I can say nothing, not seeing the solution which derives this answer. Feb 24 at 9:08
• @Alittlemouseonthepampas: Your "Reference answer" is unclear to me. Do you see math mistakes in my answer? Feb 24 at 9:09
• Thank you for your answer. If you use the function FullSimplify for simplification, a is $\sqrt{6}$. Feb 25 at 0:00