A body of mass m thrown straight up with velocity $v_0$. Find the velocity v' with which the body comes down if air drag equals to $kv^2$ , where k is a constant and v is velocity of the body.

I thought :

$mg- kv^2 =m v dv/ dx $

$mg- kv^2= m vdv / dx$

$mg=kv^2$

$mg/k = v^2$

$v_t = \sqrt{mg/k} $

where $v_t $ is terminal velocity but answer given is

$v= v_0 / \sqrt{1+k{v_0}^2 / mg} $

Where I am thinking wrong ?