The trivial answer is if A=B=C=D, wherein A/B = 1.
To find the other solution, first consider that the top part of the shape is similar, in the mathematical sense, to the bottom part. Let’s say that the top horizontal has length 1, then the middle horizontal has some unknown factor x, and the bottom horizontal will therefore be x^2.
Next let’s look at the properties of a right trapezoid with a circle inscribed within it.
Splitting the lengths at the tangent points we call the radius of the circle R and the other two lengths S and T, forming a right angled triangle to combine them.
Using Pythagoras, (T+S)^2-(T-S)^2=(2R)^2, therefore ST=R^2.
Now let’s define S as U-R and T as V-R.
(U-R)(V-R)=R^2
UV-R(U+V)+R^2=R^2
UV=R(U+V)
R=UV/(U+V)
Therefore we can find the radius of a circle within a right trapezoid as simply the product of the top and bottom sides divided by their sum. The height of the trapezoid will be twice that.
And for completeness, the sloping side will be the sum of the top and bottom sides, less the height of the trapezium.
Let’s now look at the top trapezoid in the puzzle, where we have defined the top edge to be 1 and the bottom edge to be x.
The left side will be 2x/(1+x). That denominator is awkward, so let’s scale everything up by (1+x). We can do that because ultimately it is a ratio between sides that we are seeking.
Now remember everything in the bottom trapezoid is the same as the top one, but scaled up by x. We can therefore find expressions for A, B, C and D in terms of x:
A=2x^2
B=x+1
C=2x
D=x^3+x
We are told that A+C=B+D
2x^2+2x=x^3+2x+1
x^3-2x^2+1=0
We know that one solution (the trivial solution) is that x=1, which leaves the quadratic x^2-x-1=0. This has one positive solution: (1+sqrt(5))/2, or the golden ratio.
Finally, plugging this into the expressions for A and B gives a ratio for A/B of exactly 2.
So the solution is A/B = 2.
If we rescale back to letting B=1, A=2, C will be sqrt(5)-1 and D is sqrt(5). The diagonal line will have a gradient of -2. And of course the middle horizontal will be equal to the golden ratio.