# Find $Y \in (0, 5)$ such that the roots of $4x^2 + 4xY + Y + 2 = 0$ are real?

The problem is to find all $Y \in (0, 5)$ such that the roots of $4x^2 + 4xY + Y + 2 = 0$ are real. I took a straightforward approach with Mathematica with the intent of listing the only solutions which are real. It's not quite giving me the output I expected, which is a listing of only real number solutions. What am I missing?

The code

ϵ = 0.01;
a = 4;
f[y_] := -(4) (y) ± √(((4 y)^2 -
4 (a) (2 + y)))/(2 a);
Table[Element[f[x], Reals] , {x, 0, 5, ϵ}]


The output

Boole[0. ± (0. + 0.707107 I) ∈
Reals] (0. ± (0. + 0.707107 I)),
Boole[-0.04 ± (0. + 0.708855 I) ∈
Reals] (-0.04 ± (0. + 0.708855 I)),
Boole[-0.08 ± (0. + 0.710563 I) ∈
Reals] (-0.08 ± (0. + 0.710563 I)),
Boole[-0.12 ± (0. + 0.712232 I) ∈
Reals] (-0.12 ± (0. + 0.712232 I)),
Boole[-0.16 ± (0. + 0.713863 I) ∈
Reals] (-0.16 ± (0. + 0.713863 I)), <<492>>,
Boole[-19.88 ± 2.1054 ∈
Reals] (-19.88 ± 2.1054),
Boole[-19.92 ± 2.11071 ∈
Reals] (-19.92 ± 2.11071), ...


Also, is there a simpler way to solve this?

-

Reduce[Discriminant[4 x x + 4 x y + y + 2, x] >= 0 && 0 < y < 5]
(*
2 <= y < 5
*)

-

Why do you need Mathematica for this?

The square of the discriminant of the original equation is $16\;(Y^2-Y-2)$. This should be $\geq 0$ for real roots of $x$. The roots of $Y^2-Y-2=0$ are $-1$ and $2$, so for $Y \geq 2,\ 16\;(Y^2 - Y - 2) \geq 0$. This means the range of $Y$ you want is $[2,5)$.

-

I think the following is what you want. Correct me if I'm wrong.

Solve[{4 x^2 + 4 x y + y + 2 == 0, 0 < y < 5}, x, Reals]


Gives:

   {{x -> ConditionalExpression[-(y/2) - 1/2 Sqrt[-2 - y + y^2], 2 < y < 5]},
{x -> ConditionalExpression[-(y/2) + 1/2 Sqrt[-2 - y + y^2], 2 < y < 5]}}


So what this says is any Y in the interval (2, 5) which falls inside the desired interval, will make the roots shown above Real.

-