Question:

The value of $\int_{-2}^{1}\frac{|x|}{x}dx$ is equal to

Show Hint

Logic Tip: Geometrically, the integral represents the area under the curve. From $x=-2$ to $0$, it's a rectangle of width 2 and height -1 (Area = -2). From $x=0$ to $1$, it's a rectangle of width 1 and height 1 (Area = 1). Total area = $-2 + 1 = -1$.
Updated On: Apr 27, 2026
  • -1
  • -2
  • 1
  • 2
  • 3
Show Solution
collegedunia
Verified By Collegedunia

The Correct Option is A

Solution and Explanation

Concept:
The function $f(x) = \frac{|x|}{x}$ is known as the signum function (for $x \neq 0$). It outputs $+1$ for all positive numbers and $-1$ for all negative numbers. Because its definition changes at $x = 0$, any definite integral crossing zero must be split into two separate piecewise intervals using the property $\int_a^b f(x) dx = \int_a^c f(x) dx + \int_c^b f(x) dx$.
Step 1: Define the piecewise behavior of the function.
$$f(x) = \frac{|x|}{x} = \begin{cases} \frac{-x}{x} = -1 & \text{for } x<0 \\ \frac{x}{x} = 1 & \text{for } x>0 \end{cases}$$
Step 2: Split the definite integral at the critical point $x=0$.
$$\int_{-2}^{1} \frac{|x|}{x} dx = \int_{-2}^{0} \left(\frac{|x|}{x}\right) dx + \int_{0}^{1} \left(\frac{|x|}{x}\right) dx$$
Step 3: Substitute the appropriate piecewise values.
For the interval $[-2, 0)$, $x$ is negative, so the function value is $-1$. For the interval $(0, 1]$, $x$ is positive, so the function value is $1$. $$= \int_{-2}^{0} (-1) dx + \int_{0}^{1} (1) dx$$
Step 4: Evaluate the definite integrals.
$$= [-x]_{-2}^{0} + [x]_{0}^{1}$$ $$= \left( -0 - (-(-2)) \right) + \left( 1 - 0 \right)$$ $$= (0 - 2) + 1$$ $$= -2 + 1 = -1$$
Was this answer helpful?
0
0