Mistake in my solving of a ODE? I consider the following ODE
$$ m(t)\cdot f'(t)=T-\gamma\cdot m(t)-\beta\cdot (f(t))^2. $$
$ m $  (is always $ \neq 0 $) is a known (and continuous) function and $ T,\beta,\gamma $ are real constants. So I'm looking for $ f $. I transformed this ODE to the form:
$$ \frac{1}{m(t)}=\frac{f'(t)+\gamma}{T-\beta\cdot (f(t))^2}. $$
I did the following steps to solve this for $ f $:
$$ \begin{align}M(t):=\int_0^t\frac{1}{m(s)}\ ds&=\int_0^t\frac{f'(s)+\gamma}{T-\beta\cdot (f(s))^2}\ ds\stackrel{s\mapsto f(s)}{=}\int_0^t\frac{1+\gamma}{T-\beta\cdot s^2}\ ds\\[20pt]&=\frac{1+\gamma}{\sqrt{T\cdot \beta}}\cdot \operatorname{artanh}\left(\sqrt{\frac{\beta}{T}}\cdot f(t)\right)+C'\end{align}\\[50pt]\Longrightarrow \boxed{M(t)+C=\frac{1+\gamma}{\sqrt{T\cdot \beta}}\cdot \operatorname{artanh}\left(\sqrt{\frac{\beta}{T}}\cdot f(t)\right)}.$$
Transformed to $ f $:
$$ \underline{\underline{f(t)=\sqrt{\frac{T}{\beta}}\cdot \tanh\left(\frac{\sqrt{T\cdot \beta}}{1+\gamma}\cdot (M(t)+C)\right)}}. $$
Check:
$ \begin{align}f'(t)&=\sqrt{\frac{T}{\beta}}\cdot \operatorname{sech}^2\left(\frac{\sqrt{T\cdot \beta}}{1+\gamma}\cdot (M(t)+C)\right)\cdot \frac{\sqrt{T\cdot \beta}}{1+\gamma}\cdot M'(t)\\[30pt]&=\frac{T}{1+\gamma}\cdot \operatorname{sech}^2\left(\frac{\sqrt{T\cdot \beta}}{1+\gamma}\cdot (M(t)+C)\right)\cdot \frac{1}{m(t)}\end{align}. $
$ (f(t))^2=\frac{T}{\beta}\cdot \tanh^2\left(\frac{\sqrt{T\cdot \beta}}{1+\gamma}\cdot (M(t)+C)\right) $
Left side:
$$ m(t)\cdot f'(t)=\frac{T}{1+\gamma}\cdot \operatorname{sech}^2\left(\frac{\sqrt{T\cdot \beta}}{1+\gamma}\cdot (M(t)+C)\right) $$
Right side:
$$ \begin{align} &T-\gamma\cdot m(t)-\beta\cdot (f(t))^2 \\[30pt]&=T-\gamma\cdot m(t)-T\cdot \tanh^2\left(\frac{\sqrt{T\cdot \beta}}{1+\gamma}\cdot (M(t)+C)\right)\\[30pt]&=T\cdot \left [1-\tanh^2\left(\frac{\sqrt{T\cdot \beta}}{1+\gamma}\cdot (M(t)+C)\right)\right]-\gamma\cdot m(t)\\[30pt]&=T\cdot \operatorname{sech}^2\left(\frac{\sqrt{T\cdot \beta}}{1+\gamma}\cdot (M(t)+C)\right)-\gamma\cdot m(t)\end{align}$$
From here I get stuck and I have no idea how bring the right side to the form of the left side. Or did I something wrong???
 A: 
$$M(t):=\int_0^t\frac{1}{m(s)}\ ds =\int_0^t\frac{f'(s)+\gamma}{T-\beta\cdot (f(s))^2}\ ds\stackrel{s\mapsto f(s)}{=}\int_0^t\frac{1+\gamma}{T-\beta\cdot s^2}\ ds$$

$$\Longrightarrow\int_0^t\frac{1}{m(s)}\ ds =\int_0^t\frac{f'(s)+\gamma}{T-\beta\cdot (f(s))^2}ds$$
as you mentioned earlier, you've let $s=f(s)$ and $1=f'(s)$ so
$$\int_0^t\frac{1}{m(s)}\ ds =\int_0^t\frac{1+\gamma}{T-\beta\cdot (s)^2}ds$$

Let us apply the same reasoning to a simple integral:
$$\int_0^tf(s)\cdot (f'(s)+\gamma)ds= \int_0^ts\cdot (1+\gamma)ds = \frac{s(t)^2}{2} (1+\gamma)+C$$
Now  suppose $f(s) = \sin(s)$
$$\int_0^t\sin(s)\cdot (\cos(s)+\gamma)ds=\frac{\sin^2(t)}{2}(1+\gamma)+K$$
Checking by differentiation w.r.t $t$
$$\frac{d}{dt}(\frac{\sin^2(t)}{2}(1+\gamma))\Bigg|_{t=s}=\sin(s)\cos(s)(1+\gamma) ≠\sin(s)\cdot (\cos(s)+\gamma)$$

Returning to the original integral, as you've said:
$$\int \frac{f'(s)+\gamma}{T-\beta\cdot (f(s))^2}ds$$
Since you set $s=f(s), f'(s)= 1$
$$\Longrightarrow\int ^t _0 \frac{1}{T-\beta\cdot s^2}ds+\gamma\cdot \int ^t_0\frac{1}{T-\beta\cdot f(s)^2}ds$$
From the table of integrals
$$
\Longrightarrow -\frac{\sqrt{\beta}
\ln|\frac{\sqrt{\beta}f(t)-\sqrt{T}}{\sqrt{\beta}f(t)+\sqrt{T}}|
}{2\beta\sqrt{T}} + \gamma\cdot \int ^t _0 \frac{1}{T-\beta\cdot f(s)^2}ds + C
$$
Because the "trick" $s=f(s)$ only works for integrals for functions of the form:
$$ f(s)f'(s), \ \ g(f(s))f'(s)$$
There's nothing much you can do on the second integral unless $t=f(t)$ indeed and its integral evaluate to:
$$-\frac{\sqrt{\beta}
\ln|\frac{\sqrt{\beta}t-\sqrt{T}}{\sqrt{\beta}t+\sqrt{T}}|
}{2\beta\sqrt{T}}$$
So you really can't apply $s=f(s)$ for the original differential equation
