I really am curious as to how you arrived at this equation. It is a vast over-simplification of the problem.
The equation I came up with is as follows:
y1 = [l/(2b(1/tan(a)^2 - cos(a))] * [x - l/cos(a) + b/sin(a)] + l/cos(a) + b/sin(a)
where you plugin b, l, and x based on your parameters, and find the maximum value for y1 when a goes from 0 to 90 degrees. That maximum value should be less than y for the box to be able to fit around the corner.