Take the Sun(mass M) and the planet(mass m) to be point masses. Let the Sun be fixed at the origin and the planet be moving in the x-y plane, initial velocity of the planet be $v_o\hat{j}$ and initial position of the planet be $r_o\hat{i}$. At any given instant, let the planet's position, velocity and acceleration be $\vec{r}, \vec{v}, \vec{a}$ respectively. Let $\theta$ be the angle subtended between $\vec{r}$ and positive x-axis.
The gravitation force is always acting towards the origin, hence torque won't be generated on the planet, about the origin.
Therefore, angular momentum of the planet should be conserved about the origin.
$$\vec{r}\times\vec{p}=r_omv_o\hat{k}$$
$$\vec{r}\times\vec{v}=r_ov_o....(1)$$
This can also be written as
$$I\vec{\omega}=r_omv_o\hat{k}$$
$$mr^2{\frac{d\vec{\theta}}{dt}}=r_omv_o\hat{k}$$
$$r^2\frac{d{\theta}}{dt}\hat{k}=r_ov_o\hat{k}$$
$$r^2\frac{d{\theta}}{dt}=r_ov_o....(2)$$
From Newton's law of Gravitation,
$$\vec{F}=\frac{-GMm}{r^3}\vec{r}$$
From Newton's second law of motion,
$$\vec{F}=m\vec{a}$$
$$m\vec{a}=\frac{-GMm}{r^3}\vec{r}$$
$$\frac{d\vec{v}}{dt}=\frac{-GM}{r^3}\vec{r}$$
Multiplying and diving Left Hand Side by $d\theta$ and substituting
$$\vec{r}=r cos\theta\hat{i}+r sin\theta\hat{j}~(where~r^2=x^2+y^2,cos\theta=\frac{x}{r}~and~sin\theta=\frac{y}{r})$$
$$\frac{d\vec{v}}{d\theta}.\frac{d\theta}{dt}= -\frac{-GM(r cos\theta\hat{i}+r sin\theta\hat{j})}{r^3}$$
$$\frac{d\vec{v}}{d\theta}.r^2\frac{d\theta}{dt}=-GM(cos\theta\hat{i}+sin\theta\hat{j})$$
From (2),
$$\frac{d\vec{v}}{d\theta}.r_ov_o=-GM(cos\theta\hat{i}+sin\theta\hat{j})$$
$$Let ~~~\alpha=\frac{GM}{r_ov_o}$$
$$\int_{\vec{v_o}}^{\vec{v}}\vec{dv}=-\alpha(\int_{0}^{\theta}cos\theta.d\theta.\hat{i}+\int_{0}^{\theta}sin\theta.d\theta.\hat{j})$$
$$\vec{v}-\vec{v_o}=-\alpha (sin\theta\hat{i}-cos\theta\hat{j})\Big|_0^{\theta}$$
$$\vec{v}-\vec{v_o}=-\alpha (sin\theta\hat{i}-(1-cos\theta\hat{j}))$$
$$\vec{v}=-\alpha sin\theta\hat{i}+( \alpha cos\theta-\alpha+v_o)\hat{j}$$
Now,
$$\vec{r}\times\vec{v}=\begin{vmatrix}\hat{i}&\hat{j}&\hat{k}\\rcos\theta&rsin\theta&0\\-\alpha sin \theta & \alpha cos\theta+v_o-\alpha&0\end{vmatrix}$$
$$=(rcos\theta)(\alpha cos\theta+v_o-\alpha)-(-\alpha sin\theta)(sin\theta)\hat{k}$$
$$=(r)(\alpha cos^2\theta+\alpha sin^2\theta-\alpha cos\theta+v_ocos\theta)\hat{k}$$
$$=(r)(\alpha+v_ocos\theta-\alpha cos\theta)$$
From (1),
$$r_ov_o\hat{k}=(r)(\alpha+(v_o-\alpha)cos\theta)$$
$$r=\frac{r_ov_o}{\alpha(1+(\frac{v_o-\alpha}{\alpha})cos\theta)}$$
$$Let ~\frac{r_0v_0}{\alpha}=h~~~and ~~~\frac{v_o-\alpha}{\alpha}=p$$
$$Then~~~r=\frac{h}{1+pcos\theta}$$
$$Substituting~~~cos\theta=\frac{x}{r},$$
$$r(1+p\frac{x}{r})=h$$
$$r+px=h$${\tiny }
$$r^2=(h-px)^2$$
$$x^2+y^2=h^2+p^2x^2-2hpx$$
$$x^2(1-p^2)+2hpx+y^2=h^2$$
$$When~~~~~(1-p^2)\neq0,$$
$$x^2+\frac{y^2}{1-p^2} +\frac{2hpx}{1-p^2}=\frac{h^2}{1-p^2}$$
$$Adding ~~~\frac{h^2}{(1-p^2)^2} ~~~on ~both~ sides,$$
$$x^2+\frac{h^2p^2}{(1-p^2)^2}+\frac{y^2}{1-p^2} +\frac{2hpx}{1-p^2}=\frac{h^2}{1-p^2}+\frac{h^2p^2}{(1-p^2)^2}$$
$$(x+\frac{hp}{1-p^2})^2+\frac{y^2}{1-p^2}=\frac{h^2}{(1-p^2)^2}$$
This takes the form
$$\frac{(x+\frac{hp}{1-p^2})^2}{\frac{h^2}{(1-p^2)^2}}+\frac{y^2}{\frac{h^2}{(1-p^2)}}=1$$
If$(1-p^2)>0$, then the equation will take the form of a shifted ellipse. $\frac{(x+x_o)^2}{a^2}+\frac{y^2}{b^2}=1$
$$1-p^2>0$$
$$p^2-1<0$$
$$(p-1)(p+1)<0$$
$$-1<p<1$$
$$-1<\frac{v_o^2}{(\frac{GM}{r_o})}-1<1$$
$$0<\frac{v_o^2}{(\frac{GM}{r_o})}<2$$
$$0<v_o^2<\frac{2GM}{r_o}$$
$$0<v_o<\sqrt{\frac{2GM}{r_o}}$$
Hence for a suitable velocity, the planet will be orbiting Sun in an elliptical path.