My guess is that Limit can have trouble if (x, y} -> {a, b} where {a, b} is not an interior point of the domain. For instance, I would say the limit here is well-defined since {0, 0} is a limit point of the domain and that the limit is 1:
Limit[ConditionalExpression[Sin[x1]/x1, x1 > x2], {x1, x2} -> {0, 0}]
(* Indeterminate *)
Limit can handle some piecewise functions:
Limit[
Piecewise[{
{ Sin[1/x1] / x1, x1 > x2}, (* <-- N.B. *)
{Sin[x2]/x2, x1 <= x2}}],
{x1, x2} -> {0, 0}]
(* Indeterminate *)
So it seems to be a question of robustness.
An alternative when Limit fails is to try to find the limit of each of the separate pieces without the restriction on the domain of the piece. If they each exist and are equal, we can say the limit is the limit of the pieces. If some exist and are not all equal, then the limit does not exist. Otherwise, I think we can't be sure. The following is adapted from this answer of mine.
ClearAll[pwLimit];
pwLimit::DNE =
"The limit of at least one of the pieces does not exist as ``.";
pwLimit::nopcs = "Could not solve for the pieces.";
pwLimit[f_, spec_, opts : OptionsPattern[Limit]] :=
Module[{f0, jac0, pcs = {}, z, res},
pcs = Replace[ (* Solve[..,Reals] separates PW fn *)
z /. Solve[z == f, z, Reals],
{ConditionalExpression[y_, _] :> y},
1];
If[ListQ[pcs],
res = Limit[#, spec, opts] & /@ pcs,
Message[pwLimit::nopcs];
res = $Failed];
res = Replace[res, {
uneval_ /; (* Limit did not find limit *)
! FreeQ[uneval, Limit] :>
$Failed,
lim_ /; (* all limits equal *)
Equal @@ lim :>
First@lim,
lim_ /; (* limits exist/infinite but different *)
VectorQ[lim,
NumericQ[#] || MatchQ[#, Infinity | -Infinity | ComplexInfinity] &
] :>
Indeterminate,
lim_ :> (* at least two limits exist and differ *)
With[{nums =
Cases[lim, _?NumericQ | Infinity | -Infinity | ComplexInfinity]},
Indeterminate /; Length@Union[nums, SameTest -> Equal] > 1
],
i_ /; (* limit(s) DNE on whole domain but might on piece *)
! FreeQ[i, Indeterminate] :> (
Message[pwLimit::DNE, spec]
$Failed)
}];
res /; FreeQ[res, $Failed]];
It is called like Limit. It might make sense to call it after Limit fails:
Limit[
Piecewise[{{Sin[x1]/x1, x1 > x2}, {Sin[x2]/x2, x1 <= x2}}],
{x1, x2} -> {0, 0}] /.
Limit -> pwLimit
(* 1 *)
If you'd prefer that a failed call stay as Limit[..] instead of pwLimit[..]], then the following will make the replacement only if pwLimit is successful.
Limit[
Piecewise[{{Sin[x1]/x1, x1 > x2}, {Sin[x2]/x2, x1 <= x2}}],
{x1, x2} -> {0, 0}] /.
HoldPattern[Limit[args__]] :>
With[{res = pwLimit[args]}, res /; FreeQ[res, pwLimit]]
(* 1 *)
Piecewisefunctions yet. Possibly related is that there does not appear to be a way to limit the domain in a multivariate limit (the way you can withDirection). This would be needed to find limits of piecewise functions. – Michael E2 Aug 01 '20 at 13:07