Solution (source code)

= Solution

If $A>B$, divide numerator and denominator by $e^{A/x^2}$. The expression becomes $(A+Be^{-(A-B)/x^2})/(1+e^{-(A-B)/x^2})$, which tends to $A$ since $A-B>0$. If $B>A$, the same argument gives $B$. If $A=B$, the expression equals $A$ for every $x\ne0$. Thus
$$
\boxed{\lim_{x\to0}\frac{Ae^{A/x^2}+Be^{B/x^2}}{e^{A/x^2}+e^{B/x^2}}=\max(A,B).}
$$
This is the two-term case of <exponential concentration of a weighted mean>, and holds for negative as well as positive parameters.