Option (B) is correct.
Explanation:
Split ∣x∣ on each side of 0.
For x>0, ∣x∣=x:
g(x)=x+2xx+ax=3x(1+a)x=31+a
For x<0, ∣x∣=−x:
g(x)=−x+2x−x+ax=x(a−1)x=a−1
So the right-hand limit is 31+a and the left-hand limit is a−1.
Make them equal.
31+a=a−1⟹1+a=3a−3⟹a=2
With a=2 both one-sided limits are 1, so limx→0g(x)=1.
Why the other options are wrong
- (A) 2 is the value of a, not the value of the limit.
- (C) −1 is the left-hand limit a−1 with a=0, which ignores a. With a=0 the right-hand limit is 31, so there would be no limit at all.
- (D) 31 is the right-hand limit 31+a with a=0. Again a has been ignored; with a=2 the right-hand limit is 1.