Calculus involving a Physics problem This is the equation that occurs in a particular problem in physics. If earth falls into the sun if it stopped orbiting suddenly.
$\mathrm{d}r = \frac{GM}{2r^2} \mathrm{dt}^2$enter image description here
This is my attempted solution. Is it correct? Also can someone explain how on one side we have only one integral and on the other side we have two? If we integrate one side of the equation, surely we must also integrate the other side as well. No? So how come we integrate one side once and the other side twice.
$\int_{0}^{R}\frac{2r^2}{GM}\mathrm{d}r=\int_{0}^{T}\int\mathrm{d}t^2$
This becomes $\frac{T^2}{2}=\frac{2R^3}{3GM}$

You've misunderstood how to set up second-order differential equations.
A body that falls vertically has $\frac{d^2r}{dt^2}=-\frac{GM}{r^2}$. This has a number of implications you were considering that I review in the paragraph below, but it is this equation alone that we use to solve for $r$ as a function of $t$, e.g. as in @GerryMyerson's link.
Over short enough falls with initially zero speed for $r$ to change little (this is the simplest case to analyze), the acceleration is approximately constant, so $r\approx r_0-\frac{GM}{2r_0^2}t^2$, where $r_0$ is the $t=0$ value of $r$. On the other hand, at small times $dt$ we have$$r\approx r_0+\underbrace{\dot{r}_0}_0dt+\tfrac12\ddot{r}_0dt^2=r-\tfrac{GM}{2r_0^2}dt^2,$$i.e. the change in $r$ is $-\tfrac{GM}{2r_0^2}dt^2$. However, at a later time when $r$ has reduced, $\dot{r}$ has become negative and the elapsed time is no longer negligible, the result is rather different.
