Numerical Approximation of a Differential Equation I have the differential equation that models the velocity of a falling object:
$$ \frac{dv}{dt}= \frac{c}{m}v^2 - g $$
Where: 


*

*c= drag coefficient = constant 

*m = mass

*g = acceleration due to gravity 


The purpose of the problem is to approximate this using the fact:
$$ \frac{dv}{dt} \approx \frac{v(x_i) - v(x_{i-1})}{\Delta x} $$
Substituting this back into the original problem I get:
$$\frac{v(x_i) - v(x_{i-1})}{\Delta x} = \frac{c}{m} v(x_i)^2 - g $$
Then I rearrange the formula for $v(x_i)$ and complete the square to get:
$$ v(x_i) = \sqrt{ \frac{m^2}{4 \cdot c \cdot \Delta x} + \frac{g \cdot m}{c} - \frac{v(x_{i-1}) \cdot m} {2\cdot c \cdot \Delta x} } + \frac{m}{2 \cdot c \cdot h}$$ 
Now I am trying to automate this in excel using the following constants:


*

*$\Delta x = 1$

*c= 0.125

*m= 100.19

*g= 9.81

*Initial condition: $v(0)=0$


However after calculating v(1) = 811.25 ( which is already wrong compared to a true value of around 9 ) , the terms under the square root always evaluate to a negative value.
What could I have done wrong here?
Edit: 
Since I have a quadratic in v, I used the quadratic formula to solve for it and I got:
$$v(x_i) = \frac{ \frac{1}{\Delta x} \pm \sqrt{\frac{1}{\Delta x}^2 - 4(c/m)(v(x_{i-1}) -g)}} {2\cdot c/m } $$ 
Which still does not work for small values of $\Delta x$.
Any tips/ help are really appreciated.
Thank you for your time.
 A: $$\frac{\text{d}v}{\text{d}t}=\frac{c}{m}v(t)^2-g\Longleftrightarrow$$
$$v'(t)=\frac{cv(t)^2}{m}-g\Longleftrightarrow$$
$$\frac{v'(t)}{\frac{cv(t)^2}{m}-g}=1\Longleftrightarrow$$
$$\int\frac{v'(t)}{\frac{cv(t)^2}{m}-g}\space\text{d}t=\int1\space\text{d}t\Longleftrightarrow$$
$$\int\frac{v'(t)}{\frac{cv(t)^2}{m}-g}\space\text{d}t=t+\text{k}\Longleftrightarrow$$

Substitute $u=v(t)$ and $\text{d}u=v'(t)\space\text{d}t$:

$$\int\frac{1}{\frac{cu^2}{m}-g}\space\text{d}u=t+\text{k}\Longleftrightarrow$$
$$\int-\frac{1}{g\left(1-\frac{cu^2}{gm}\right)}\space\text{d}u=t+\text{k}\Longleftrightarrow$$
$$-\frac{1}{g}\int\frac{1}{1-\frac{cu^2}{gm}}\space\text{d}u=t+\text{k}\Longleftrightarrow$$

Substitute $s=\frac{u\sqrt{c}}{\sqrt{gm}}$ and $\text{d}s=\frac{\sqrt{c}}{\sqrt{gm}}\space\text{d}u$:

$$-\sqrt{\frac{m}{cg}}\int\frac{1}{1-s^2}\space\text{d}s=t+\text{k}\Longleftrightarrow$$
$$-\sqrt{\frac{m}{cg}}\text{arctanh}(s)=t+\text{k}\Longleftrightarrow$$
$$-\frac{\sqrt{m}\text{arctanh}\left(\frac{v(t)\sqrt{c}}{\sqrt{g}\sqrt{m}}\right)}{\sqrt{c}\sqrt{g}}=t+\text{k}\Longleftrightarrow$$
$$v(t)=\frac{\sqrt{gm}\tanh\left(\frac{\text{k}-t\sqrt{cg}}{\sqrt{m}}\right)}{\sqrt{c}}$$
With the condition that $v(0)=0$ we find $v(t)$:
$$v(t)=-\frac{\sqrt{gm}\tanh\left(\frac{t\sqrt{cg}}{\sqrt{m}}\right)}{\sqrt{c}}$$
