differential equation:
$$
y^{\prime}+k^2\frac{x}{y}+2r=0,\quad r>0,\quad k\in R
$$
I only obtain a result like this, How to get the explicit solution but the Solve[...]?
$Assumptions = r > 0 && k ∈ Reals;
DSolve[y'[x] + k^2 x/y[x] + 2 r == 0, y[x], x]
Solve[-((r ArcTan[(r + y[x]/x)/Sqrt[k^2 - r^2]])/Sqrt[k^2 - r^2]) + 1/2 Log[k^2 + (2 r y[x])/x + y[x]^2/x^2] == C[1] - Log[x], y[x]]
Sorry I don't know how to paste mathematica code with highlight.
I presume the independent variable is $x$.
Maple gives the solution in implicit form:
$$-\frac{1}{2}\ln \left( {\frac {{k}^{2}{x}^{2}+2\,ry \left( x \right) x+ \left( y \left( x \right) \right) ^{2}}{{x}^{2}}} \right) +{\frac {r }{\sqrt {{k}^{2}-{r}^{2}}}\arctan \left( {\frac {rx+y \left( x \right) }{x\sqrt {{k}^{2}-{r}^{2}}}} \right) }-\ln \left( x \right) =C $$
It is very unlikely that this could be solved for $y(x)$ in "closed form".