I want to solve the following differential equation
$$ -\frac{1}{t}f'(t)-\frac{1}{2}f'(t)^2-f''(t)+\frac{1}{2t^2}=0 $$
for $t \in \mathbb{R}$. This can be done by hand. In particular, writing $g(t)= f'(t)$ and $g(t)=\nu(t)-1/t$, one can write the equation in the following form
$$ -\frac{1}{2}\nu(t)^2-\nu'(t)=0 $$
which has the solution $$\nu(t) = \frac{2}{t-k}$$ for some constant $k\in \mathbb{R}$. Therefore,
$$ f(t) = \int dt \left(\frac{2}{t-k}-\frac{1}{t}\right) = 2\ln|t-k|-\ln|t|+c $$ for some constant $c \in \mathbb{R}$.
Why is Mathematica returning instead $f(t) = c_2 + 2\ln(\cosh(\frac{1}{2}(2i c_1 + \ln(t)))$ with the following command?
-1/t f'[t] - 1/2 f'[t]^2 - f''[t] + 1/(2 t^2) == 0 // DSolve[#, f[t], t] &
(*Out:{{f[t] -> C[2] + 2 Log[Cosh[1/2 (2 I C[1] + Log[t])]]}} *)
EDIT
The solution returned by Mathematica seems to be different from $f(t)=2\ln|t-k|-\ln|t|+c$.
eq = -1/t f'[t] - 1/2 f'[t]^2 - f''[t] + 1/(2 t^2) == 0; sol = DSolve[eq, f, t]; eq /. sol // FullSimplify
$\endgroup$