Answer
$v^2 = v_0^2 + 2GM(\frac{1}{y} - \frac{1}{R})$
Work Step by Step
$\int vdv = -GM\int\frac{1}{y^2}dy$
Integrate both sides. There is no need for an integration constant on both sides, as they can be combined into one.
$\frac{1}{2}v^2 + C = -GM(-\frac{1}{y})$
Solve for $C$ in terms of the other variables.
$C = GM(\frac{1}{y}) - \frac{1}{2}v^2$
Use the initial conditions to find a constant value for $C$. When the object is initially projected from Earth's surface, it is at a distance $R$ (the radius of Earth) from Earth's core and it has a velocity of $v_0$ (the initial launch velocity).
$C = GM(\frac{1}{R}) - \frac{1}{2}v_0^2$
Substitute $C$ back into the equation.
$\frac{1}{2}v^2 + GM(\frac{1}{R}) - \frac{1}{2}v_0^2 = GM(\frac{1}{y})$
Now we will solve for $v^2$. Start by subtracting $GM(\frac{1}{R})$ from both sides.
$\frac{1}{2}v^2 - \frac{1}{2}v_0^2 = GM(\frac{1}{y}) - GM(\frac{1}{R})$
Factor out $GM$ on the right side.
$\frac{1}{2}v^2 - \frac{1}{2}v_0^2 = GM(\frac{1}{y} - \frac{1}{R})$
Add $\frac{1}{2}v_0^2$ to both sides.
$\frac{1}{2}v^2 = \frac{1}{2}v_0^2 + GM(\frac{1}{y} - \frac{1}{R})$
Multiply both sides by 2.
$v^2 = v_0^2 + 2GM(\frac{1}{y} - \frac{1}{R})$