You can use SymPy a bit more easily here by integrating from d
to 1/1^2
(the top half), so there is no need to adjust for the bottom rectangle, as the median is above 1/6^2:
julia> a, b = 1, 6
A =(1, 6)
julia> @syms x
(x,)
julia> A = integrate(1/x^2, (x, a, b))
5/6
julia> @syms c
(c,)
julia> solve(integrate(1/x^2, (x, a, c)) ~ A/2, c)
1-element Vector{Sym}:
12/7
julia> @syms d
(d,)
julia> # y = 1/x^2 -> x = 1/sqrt(y)
julia> @syms y
(y,)
julia> solve(integrate(1/sqrt(y), (y, d, 1)) ~ A/2)
1-element Vector{Sym}:
361/576