can not find root of the equation $(0,0)$ with semi-major axis a and semi-minor axis $b$">
I want find out for each point $(x,y)$ in the white region, the nearest point $(a \cos \theta, b \sin \theta )$ on the ellipse curve.I tried with the following approach.
$$
\text {distance} = \sqrt{(x-a \cos \theta)^2+(y-b \sin \theta)^2} 
$$
I find out the first derivative of the $$F(\theta)=(x-a \cos \theta)^2+(y-b \sin \theta)^2.$$ The equation after first derivative is: 
$$
ax \sec \theta- by \csc \theta=a^2-b^2.
$$
How to calculate theta for this equation?

You have $axsec(\theta)- bycsc(\theta)= a^2- b^2$. Let $z= sec(\theta)$.  Since $csc(\theta)= \frac{1}{sec(\theta)}$, the equation becomes $axz- \frac{by}{z}= a^2- b^2$.  Muliply on both sides to get $axz^2- by= (a^2- b^2)z$.
We can write that as $(ax)z^3+ (b^2- a^2)z- by= 0$ and solve it using the quadratic formula:  $z= sec(\theta)= \frac{a^2- b^2\pm\sqrt{(b^2- a^2)^2+ 4abxy}}{2ax}$.
