Question
Quantitative Aptitude Question on Algebra
If x and y satisfy the equations
∣x∣+x+y=15(1),
x+∣y∣−y=20(2).
Find the value of x−y.
Step 1: Analyze the first equation ∣x∣+x+y=15}
The behavior of ∣x∣ depends on the sign of x:
- If x≥0, then ∣x∣=x. Substituting this into Equation (1):
x+x+y=15⟹2x+y=15.(3) - If x<0, then ∣x∣=−x. Substituting this into Equation (1):
−x+x+y=15⟹y=15.(4)
Step 2 : Analyze the second equation x+∣y∣−y=20}
The behavior of ∣y∣ depends on the sign of y:
- If y≥0, then ∣y∣=y. Substituting this into Equation (2):
x+y−y=20⟹x=20.(5) - If y<0, then ∣y∣=−y. Substituting this into Equation (2):
x−y−y=20⟹x−2y=20.(6)
Step 3 : Solve the equations for different cases
Case 1 : x≥0 and y≥0
From Equation (3):
2x+y=15.
From Equation (5):
x=20.
Substitute x=20 into 2x+y=15:
2(20)+y=15⟹40+y=15⟹y=−25.
This violates the assumption y≥0. Thus, this case is not valid.
Case 2: x≥0 and y<0
From Equation (3):
2x+y=15.
From Equation (6):
x−2y=20.
Solve these two equations simultaneously:
1. From 2x+y=15, express y in terms of x:
y=15−2x.(7)
2. Substitute y=15−2x into x−2y=20:
x−2(15−2x)=20.
Simplify:
x−30+4x=20⟹5x−30=20⟹5x=50⟹x=10.
Substitute x=10 into y=15−2x:
y=15−2(10)=15−20=−5.
** Step 4**: Calculate x−y
From the above, x=10 and y=−5.
Thus: x−y=10−(−5)=10+5=15.
Final Answer: x−y=15.