Let me try to help with the discriminant.
Start with $$\frac{x^2}{a^2}+ \frac{y^2}{(1+2\cosθ)^2}=1$$
Put $$y^2=1−(x−2 \sinθ)^2$$
So the equation becomes
$$\frac{x^2}{a^2}+ \frac{1−(x−2 \sinθ)^2}{(1+2\cosθ)^2}=1$$
Compare it with the standard quadratic equation $px^2 + qx + r = 0$. If the discriminant is zero, then the roots are equal and $q^2 = 4pr$
Here, $$p = \frac{1}{a^2} - \frac{1}{(1+2 \cos θ)^2}$$
$$q = \frac{4 \sin θ}{(1+2 \cos θ)^2}$$
$$r = \frac{1- 4 \sin^2 θ}{(1+2 \cos θ)^2}-1$$
Now $q^2 = 4pr \implies$
$$\frac{16 \sin^2 θ}{(1+2 \cos θ)^4} = 4 \left(\frac{1}{a^2} - \frac{1}{(1+2 \cos θ)^2}\right) \left(\frac{1- 4 \sin^2 θ}{(1+2 \cos θ)^2}-1\right) (1)
$$
Next, observe that $$1- 4 \sin^2 θ - (1+2 \cos θ)^2 = -4(1+ \cos θ)$$
Use this in (1) above:
$$\frac{16 \sin^2 θ}{(1+2 \cos θ)^4} = 4 \left(\frac{1}{a^2} - \frac{1}{(1+2 \cos θ)^2}\right) \left(\frac{-4(1+ \cos θ)}{(1+2 \cos θ)^2}\right) (2)
$$
Next cancel $16$ from both LHS and RHS and write $$ \sin^2 \theta = (1 - \cos \theta)(1 + \cos \theta)$$ on the LHS of (2) to obtain
$$\frac{(1 - \cos \theta)(1 + \cos \theta)}{(1+2 \cos θ)^4} = \left(\frac{1}{a^2} - \frac{1}{(1+2 \cos θ)^2}\right) \left(\frac{-(1+ \cos θ)}{(1+2 \cos θ)^2}\right) (3) $$
Next cancel $(1 + \cos \theta)$ from both LHS and RHS of (3) and rearrange to obtain
$$ \frac{1}{a^2} = \frac{\cos \theta}{(1+2 \cos \theta)^2}$$