How do I obtain joint distribution of uniform random variables conditioned on a sum constrain?

Let us say, we have two random variables, x1 --> U(10,20) i.e. x1 is uniformly distributed between 10 and 20, and x2 --> U(20,40) i.e. x2 is uniformly distributed between 20 and 40.

Moreover, it has to be ensured that x1+x2 = 40 always.

How do I compute the joint distribution P(X1,X2|X1+X2=40)?

In other words, how do I find joint distribution based on a sum constraint?

The joint density function of continuous random variables $$X$$ and $$Y$$ conditioned on $$X+Y=a$$ does not exist. Conditioned on $$X+Y=a$$, the random point $$(X.Y)$$ is constrained to lie on the straight line through $$(a,0)$$ and $$(0,a)$$ and so doesn't have a joint density in the sense of $$f_{X,Y}(x,y)$$ telling you how dense the probability mass is in the vicinity of $$(x,y)$$: the units are probability mass per unit area and since $$(X,Y)$$ is constrained to lie on a line (which has zero area!), the only nonzero "value" we can ascribe to the joint density is $$\infty$$. What we do have is a line density measured in probability mass per unit length.