Find the values of $\theta$ for which the tangent line to the given curve is parallel to $x$ ,$y$ axis

So where was I wrong?

It is wrong that "$\frac{a\pm\sqrt{a^{2}-8a}}{4a}$ is never between $0$ and $1$".

This answer proves the following two claims :

Claim 1 : $$0\le \frac{a+\sqrt{a^2-8a}}{4a}\le 1\iff a\ge 8$$ Claim 2 : $$0\le \frac{a-\sqrt{a^2-8a}}{4a}\le 1\iff a\le -1\quad\text{or}\quad a\ge 8$$


Claim 1 : $$0\le \frac{a+\sqrt{a^2-8a}}{4a}\le 1\iff a\ge 8$$

Proof :

It follows from $a\not=0$ and $a^2-8a\ge 0$ that $a\lt 0$ or $a\ge 8$.

For $a\lt 0$, we have $$\begin{align}0\le \frac{a+\sqrt{a^2-8a}}{4a}\le 1&\iff 0\ge a+\sqrt{a^2-8a}\ge 4a \\\\&\iff \sqrt{a^2-8a}\le -a\quad\text{and}\quad \sqrt{a^2-8a}\ge 3a \\\\&\iff a^2-8a\le (-a)^2 \\\\&\iff a\ge 0\end{align}$$ where note that $\sqrt{a^2-8a}\ge 3a$ holds for $a\lt 0$ since RHS is negative.

For $a\ge 8$, we have $$\begin{align}0\le \frac{a+\sqrt{a^2-8a}}{4a}\le 1&\iff 0\le a+\sqrt{a^2-8a}\le 4a \\\\&\iff -a\le \sqrt{a^2-8a}\quad\text{and}\quad \sqrt{a^2-8a}\le 3a \\\\&\iff a^2-8a\le (3a)^2 \\\\&\iff a\ge -1\end{align}$$ where note that $-a\le \sqrt{a^2-8a}$ holds for $a\ge 8$ since LHS is negative.

So, we get $$0\le \frac{a+\sqrt{a^2-8a}}{4a}\le 1\iff a\ge 8$$


Claim 2 : $$0\le \frac{a-\sqrt{a^2-8a}}{4a}\le 1\iff a\le -1\quad\text{or}\quad a\ge 8$$

Proof :

For $a\lt 0$, we have $$\begin{align}0\le \frac{a-\sqrt{a^2-8a}}{4a}\le 1&\iff 0\ge a-\sqrt{a^2-8a}\ge 4a \\\\&\iff \sqrt{a^2-8a}\ge a\quad\text{and}\quad \sqrt{a^2-8a}\le -3a \\\\&\iff a^2-8a\le (-3a)^2 \\\\&\iff a\le -1\end{align}$$ where note that $\sqrt{a^2-8a}\ge a$ holds for $a\lt 0$ since RHS is negative.

For $a\ge 8$, we have $$\begin{align}0\le \frac{a-\sqrt{a^2-8a}}{4a}\le 1&\iff 0\le a-\sqrt{a^2-8a}\le 4a \\\\&\iff \sqrt{a^2-8a}\le a\quad\text{and}\quad \sqrt{a^2-8a}\ge -3a \\\\&\iff a^2-8a\le a^2 \\\\&\iff a\ge 0\end{align}$$ where note that $\sqrt{a^2-8a}\ge -3a$ holds for $a\ge 8$ since RHS is negative.

So, we get $$0\le \frac{a-\sqrt{a^2-8a}}{4a}\le 1\iff a\le -1\quad\text{or}\quad a\ge 8$$