# How to get special solution with DSolve?

I am trying to solve the following ODE with DSolve, but can't obtain a special solution (which I know exists simply by looking at the equation: f[x]=1)

a[x_] = f[x] /.
DSolve[{m f[x]^(3/2) f'[x] + 2 k f'[x]^2 - 2 k f[x] f''[x] == 0}, f[x], x]
Solve[a == 1, C]


The Solve parts simply gives me empty brackets.

If I include the boundary condition in DSolve I only get the error message "For some branches of the solution, unable to solve the conditions".

I know this is similar to other questions here, but I wasn't able to use the corresponding answers for my problem.

How I can resolve this?

The output of DSolve is a list

DSolve[{m f[x]^(3/2) f'[x] + 2 k f'[x]^2 - 2 k f[x] f''[x] == 0},
f[x], x]

{{f[x] -> (
E^(x C + C C) k^2 C[
1]^2)/(-1 + E^((x C)/2 + (C C)/2) m)^2}, {f[x] -> (
E^(x C + C C) k^2 C[
1]^2)/(1 + E^((x C)/2 + (C C)/2) m)^2}}


In order to define functions it is better to use Part like so:

a1[x_] =
f[x] /. DSolve[{m f[x]^(3/2) f'[x] + 2 k f'[x]^2 - 2 k f[x] f''[x] ==
0}, f[x], x][]
a2[x_] =
f[x] /. DSolve[{m f[x]^(3/2) f'[x] + 2 k f'[x]^2 - 2 k f[x] f''[x] ==
0}, f[x], x][]


Now we can move on and ask Mathematica to Solve

Solve[a == 1, C]


and it complains a bit

This system cannot be solved with the methods available to Solve.

We can use assumptions to get

Assuming[k != 0, Solve[(a1 /. C -> 0) == 1, C]]


{{C -> (1 - m)/k}, {C -> (-1 + m)/k}}

Without assumptions, further progress can be made with the use of Reduce

Reduce[a1 == 1, C]


giving

(-1 + m != 0 && k != 0 && C == 0 && (C == (-1 + m)/k || C == (1 - m)/k)) || (C[ 3] \[Element] Integers && C != 0 && -1 + E^((C C)/2) m != 0 && k != 0 && (C == ( m C + 2 k ProductLog[C, -((E^(-((m C)/(2 k))) C)/(2 k))])/( k C) || C == (-m C + 2 k ProductLog[C, (E^((m C)/(2 k)) C)/(2 k)])/( k C)))

The following goes some way towards a solution, by using Reduce, and by including all parameters in the solution in the list of variables to be solved for:

sol = DSolve[m f[x]^(3/2) f'[x] + 2 k f'[x]^2 - 2 k f[x] f''[x] == 0, f[x], x]
Reduce[f[x] == 1 /. sol /. x -> 0, {C, C, k, m}]

(* Out:
C != 0 && (k == -(1/(Sqrt[E^(C*C)]*C)) ||
k == 1/(Sqrt[E^(C*C)]*C)) && m == 0
*)