Grand Prix Race Driver A has boon leading archrival B for a while by a steady 3 miles. Only 2 miles from the finish, driver A ran out of gas and decelerated thereafter at ta rate proportional to the square of his remaining speed. One mile later,driver A's speed was exactly halved.If driver B's speed remained constant,who won the race?
i have tried the set up the relation$d^2x\over dt^2$=$K ({dx\over dt})^2$ and integrate it but dont know how to do.
 A: The real solution (long for dummies answer):

 Just to let the audience know, the answer to this exercise is "A wins" (as stated in the solutions page in the back of the book where this is taken from <not sure if I can place the name of the book here>).

By far a simple exercise (and no more information is needed), let's start by knowing a simple diagram to set the time and space starting points.

The starting point of the $x$ function is the point where car A (the blue car) runs out of gas.
For driver B (In green and white car):
Note: This is a long procedure to probe (the obvious) that car B will take $t=\frac{5}{V_I}$ to get to the finish line.
Acceleration of driver B is zero as it goes at a constant speed (let's call it $V_I$).
$a_B(t)=0$
$\frac{dv_B}{dt}=0$
After solving the differential equation:
$v_B(t)=V_I$
Also, we know that $v_B$ = $\frac{dx_B}{dt}$:
$\frac{dx_B}{dt}=V_I$
Solving the differential equation we have:
$x_B(t)=V_It+C_0$
We know that $x(0)=-3$ with $x$ in miles:
$-3=C_0$
Thus, the space expression for driver B is:
$x_B(t)=V_It-3$ 
And with this we have the expected situation, car B will take $t_{B_{finishes}}=\frac{5}{V_I}$ to get to the finish line.
For driver A (In blue car):
As "A ran out of gas and decelerated thereafter at a rate proportional to the square of his remaining speed":
$a_A(t)=\frac{dv_A}{dt}=-kv^2$
Solving the differential equation we have:
$\frac{1}{kv}=t+C\hspace{1cm}$       $\therefore$        $\hspace{1cm}v_A(t)=\frac{1}{kt+C_1}$ $\hspace{1cm}$where $C_1=kC$ 
And we can use a initial condition here $v_A(0)=V_I$:
$v_A(0)=V_I=\frac{1}{0k+C_1}\hspace{1cm}$ $\therefore$ $\hspace{1cm}C_1=\frac{1}{V_I}$
then:
$v_A(t)=\frac{1}{kt+\frac{1}{V_I}}\hspace{5cm}(1)$
But also we know (as with driver B, physics laws don't change here) that $\frac{dx_A}{dt}=v_A$, thus:
$\frac{dx_A}{dt}=\frac{1}{kt+\frac{1}{V_I}}$
Solving the differential equation (with x in miles, obviously):
$x_A(t)=\frac{\ln\left(kt+\frac{1}{V_I}\right)}{k}+C_2\hspace{1cm}$ or $\hspace{1cm}x_A(t)=\frac{\ln\left(kt+\frac{1}{V_I}\right)+C_3}{k}\hspace{1cm}$ where $\hspace{1cm}C_3=C_2k$
Now, we know that at $t=0$ the drive A is at $x=0$, so:
$0=\frac{\ln\left(\frac{1}{V_I}\right)+C_3}{k}$
And this give us that:
$C_3=-\ln\left(\frac{1}{V_I}\right)$
Then:
$x_A(t)=\frac{\ln\left(kt+\frac{1}{V_I}\right)-\ln\left(\frac{1}{V_I}\right)}{k}$
And finally, after some operations:
$x_A(t)=\frac{\ln(V_Ikt+1)}{k}\hspace{4.5cm}(2)$
At this point the problem is basically solved, we know that at $x_A=1$ the value of $v_A=\frac{V_I}{2}$, so ($t_b$ is the time at which driver A have driven one mile after he ran out of gas):
$1=\frac{\ln(V_Ikt_b+1)}{k}$
This expression in terms of $t_b$ is:
$t_b=\frac{e^k-1}{V_Ik}$
This is the time at which driver A will have halved the constant speed, so:
$\frac{V_I}{2}=\frac{1}{k\left(\frac{e^k-1}{V_Ik}+\frac{1}{V_I}\right)}$
A few operations lead to $e^k=2$ so $k\approx0.6931$, then:
$x_A(t)=\frac{ln(0.6931V_It+1)}{0.6931}$
Now time for $x_A=2$:
$2=\frac{ln(0.6931V_It_{A_{finishes}}+1)}{0.6931}$
And clearing $t$:
$t_{A_{finishes}}=\frac{4.327835}{V_I}$
And as $t_{A_{finishes}}<t_{B_{finishes}}$ then A wins.
A: Let u be the time unit so that the speed at the moment ($t=0$) A ran out of gas is $1$ mi/u. Then B finishes the race in $5$ u. For A, we have $\frac{dv}{dt}=-\frac{k}{v^2}$, which yields $v=\frac{1}{1+kt}$. Note that $v$ is a transformation of $f(t)=\frac{1}{t}$. Now $f(1)=1$, $f(2)=\frac{1}{2}$, and the area under $f$ is $\ln 2$ on $[1,2]$ and on $[2,4]$. Since we want these two areas to be $1$ (mile in distance), we horizontally scale $f(t)$ by $\frac{1}{\ln 2}$. That is, $f(t\ln 2)$ has area (distance) $1$ on $\left[\frac{1}{\ln 2}, \frac{2}{\ln 2}\right]$ and on $\left[\frac{2}{\ln 2}, \frac{4}{\ln 2}\right]$. Finally, shifting this graph $\frac{1}{\ln 2}$ unit to the left, we get that of $v=f(1+t\ln 2)$. So A finishes the race in $\frac{3}{\ln 2}$ u.
Since $e^3<3^3<2^5$, $\frac{3}{\ln 2}<5$, thus A still finishes first, even with all that trouble.
