# Revision history [back]

### Solution of ODE expressed with hyperbolic trigonometric function

With Sage 7.3, consider

t=var('t')
v=function('v')(t)
m, g, h = var('m g h')
assume(m > 0)
assume(g > 0)
assume(h > 0)
sol = desolve(m*diff(v,t) == m*g - h*v**2, v, ivar=t)
show(sol)
sol.solve(v)


The outcomes are

$$\newcommand{\Bold}[1]{\mathbf{#1}}-\frac{m \log\left(\frac{h v\left(t\right) - \sqrt{g h m}}{h v\left(t\right) + \sqrt{g h m}}\right)}{2 \, \sqrt{g h m}} = C + t$$

$$\newcommand{\Bold}[1]{\mathbf{#1}}\left[v\left(t\right) = \frac{\sqrt{g h m} {\left(e^{\left(\frac{2 \, \sqrt{g h m} C}{m} + \frac{2 \, \sqrt{g h m} t}{m}\right)} + 1\right)}}{h {\left(e^{\left(\frac{2 \, \sqrt{g h m} C}{m} + \frac{2 \, \sqrt{g h m} t}{m}\right)} - 1\right)}}\right]$$

Nevermind desolve came with an implicit solution I had to further solve by hand but then solve missed that the last expression for v(t) is a mere hyperbolic tangent. How would I get the solution in its simpler form?

$$v(t) = \sqrt{\frac{gm}{h}}\ \text{tanh}\left(\sqrt{\frac{gh}{m}}(t + m C)\right)$$

Thanks for any hint!