I have to solve the differential equation: $v\,'=g-cv$.
Sorry in advance for lack of latex. I will learn it soon, please let me make a question using the common programming notation for my expressions, like * for product, ^ for exponentiation, ' for derivative.
Where $v$ is the speed, so it has distance/time units, so its derivative has acceleration units, $g$ is acceleration and $c$ is a constant with units 1/time, so the 3 terms have the same units.
I'm not worried right now about finding all the solutions, or finding maximal interval of existence, I'm worried about the units of the solution that came out of my equation, this is my approach to solution:
1)$v\,'=g-cv$ the separation of variables
2)$\displaystyle\frac{v\,'}{g-cv}=1$ then integration with respect to variable $t$ ( assume $v=v(t)$ )
3)$\displaystyle\frac{ln(g-cv)}{-c}=t+K$ with $K$ a constant with time units.
Until now, both sides match their units. I'm a little worried about taking the log of g-cv, but I keep going, solving for v:
4)$\displaystyle v=\frac{g-e^{-c(t+k)}}{c}$
Now I have an acceleration g adding to an exponential, wich seems to me is unit-less.
What is wrong with this? Can i do what I did or some steps are wrong?
There are no troibles with units. Look, we find solution of $$ \frac{dv}{g-cv} = dt; $$ ok, integrate it: $$ \int_{v_0}^v \frac{dv}{g-cv} = \int_{t_0}^{t} dt\Longrightarrow \ln\frac{g-cv}{g-cv_0}=-c(t-t_0). $$ As you can see, both log and $ct$ are unitless. We can express $v$: $$ \ln\frac{g-cv}{g-cv_0}=-c(t-t_0) \Longrightarrow v=\frac gc - \left(\frac gc-v_0\right)e^{-c(t-t_0)} $$
EDIT (answer to comment). There is some trick. In math, if we have equation $$ y'=f(y)g(x), $$ we simply write $$ \frac{dy}{f(y)}=g(x)\,dx. $$ It's true regardless units. But for unitless variables we can write $$ \int\frac{dy}{f(y)}=\int g(x)\,dx + C; $$ this constant $C$ is unitless too. But it's short notation for $$ \int_{y_0}^y \frac{dy}{f(y)}=\int_{x_0}^x g(x)\,dx. $$ Roughly speaking, actually we write $$ \int\frac{dy}{f(y)} + C_1 =\int g(x)\,dx + C_2, $$ and $C_1$ and $C_2$ are unit constant. In unitless case, $C=C_2-C_1$. In your case, $K$ is not a time. I hope, this explanation will be useful.