I think my post above is not correct... What I was trying to minimize in it was not the sum of distances to the x and y axes but the distance to the origin x2 + y2
so that's why I got the equation of a circle of radius k.

Actually, the sum of distances to be minimized is:
x + y = x + f(x)

Taking the derivatives:
0 = d/dx(x + f(x)) = 1 + f'(x)
or
f'(x) = dy/dx = -1
or
dy = -dx
so that, finally:
y = C - x
the equation of a straight line, with C being the integration constant.