### Numerical real solution of derivative

I would like to know where a function attains its maximum, so I'm trying to solve some

diff(y,x),x

where y depends on y. I have difficulties with Sage returning equations, complex roots, converting equations, find_maximum_on_interval command etc, and instead of spending another hour trying to figure it out myself, I thought I would try asking here...

Here is a more concrete example:

f = log(2.02 * x + 1) / 2 + log( -2 * x + 1) / 2

find_local_maximum(diff(f,x), 0, 1)

What is mysterious for me, is that the above works if instead I have

f = ~~log( 1.02 ~~log(1.02 * x + 1) / 2 + log( -x + 1) / 2