Deriving a differential equation for projectile motion

physics

We have a projectile, which we will consider spherical, of radius $r$ density $\rho_m$ and mass $m$, and we begin by firing it from a point $(0,h_0)$ at an initial velocity $v_0$ at an angle $\theta_0$. From this we can say that:
$$x'(0)=v_0\cos(\theta_0),\,y'(0)=v_0\sin(\theta_0)\tag{1}$$
If we neglect all forces acting except those due to gravity then we can say:
$$x''=0,\,y''=-g\tag{2.1}$$
Integrating to give:
$$x'=C_1,\,y'=-gt+C_2\tag{2.2}$$
$$x=C_1t+C_3,\,y=-\frac{g}{2}t^2+C_2+C_4\tag{2.3}$$
Now by applying initial conditions we get:
$$x=v_0\cos(\theta_0)t\tag{2.4.1}$$
$$y=-\frac g2t^2+v_0\sin(\theta_0)t+h_0\tag{2.4.2}$$
However, I would like to do the same thing as this but not neglecting air resistance (and if possible I would like to include the effect of spin). My thoughts to doing this would be: If $F_x,F_y$ denote force in the $x$ and $y$ directions, then we can say:
$$\sum F_x=mx''\,\,,\,\,\sum F_y=my''\tag{3.1}$$
I have found that for an object moving through air, drag is equal to:
$$F_{drag}=\frac 12CA\rho_{f}v^2\tag{3.2}$$
Since this is the total velocity of the object in question, we would have to say:
$$v=\sqrt{(x')^2+(y')^2}\tag{3.3}$$
We now know the total drag force but obviously need the force in each direction. I believe the drag would always act in the opposite direction to motion. Because of this I would say:
$$x''=-\frac{CA\rho_f}{2m}\left[(x')^2+(y')^2\right]\cos(\theta)\tag{3.4.1}$$
$$y''=-\frac{CA\rho_f}{2m}\left[(x')^2+(y')^2\right]\sin(\theta)-g\tag{3.4.2}$$
For some reason I can't visualise how I would get this $\cos\theta$ and $\sin\theta$ in terms of $x$ and $y$, maybe it would be clearer if I converted to vectors? I'm not sure how to continue from here to get a differential equation for $x''$ and $y''$. Thanks

EDIT:1

After getting help from users I end up with the differential equation:
$$\frac{d^2}{dt^2}\begin{pmatrix}x\\y\end{pmatrix}=-\frac{CA\rho_f}{2m}\sqrt{(x')^2+(y')^2}\frac{d}{dt}\begin{pmatrix}x\\y\end{pmatrix}-\begin{pmatrix}0\\g\end{pmatrix}$$

Best Answer

Notice that the drag force is always opposite to velocity. You can then write $$\cos\theta=\frac{v_x}v=\frac{x'}{\sqrt{x'^2+y'^2}}\\\sin\theta=\frac{v_y}v=\frac{y'}{\sqrt{x'^2+y'^2}}$$