Question:

If \(f(x) = \begin{cases}     \cos x       & for\ x\geq0 \\       2x      &for\ x\lt0  \end{cases}\), then the value of \(\displaystyle\int^{\frac{\pi}{2}}_{-2}dx\) is equal to

Updated On: Apr 7, 2025
  • 2
  • -2
  • -3
  • 3
  • 0
Hide Solution
collegedunia
Verified By Collegedunia

The Correct Option is C

Approach Solution - 1

We need to evaluate the integral \( \int_{-2}^{\frac{\pi}{2}} f(x) \, dx \). The function \( f(x) \) is piecewise defined, so we split the integral into two parts: \[ \int_{-2}^{\frac{\pi}{2}} f(x) \, dx = \int_{-2}^{0} f(x) \, dx + \int_{0}^{\frac{\pi}{2}} f(x) \, dx \] For \( x < 0 \), \( f(x) = 2x \), and for \( x \geq 0 \), \( f(x) = \cos x \). 1. Evaluate the first integral, where \( f(x) = 2x \) for \( x \in [-2, 0] \): \[ \int_{-2}^{0} 2x \, dx = \left[ x^2 \right]_{-2}^{0} = 0^2 - (-2)^2 = 0 - 4 = -4 \] 2. Evaluate the second integral, where \( f(x) = \cos x \) for \( x \in [0, \frac{\pi}{2}] \): \[ \int_{0}^{\frac{\pi}{2}} \cos x \, dx = \left[ \sin x \right]_{0}^{\frac{\pi}{2}} = \sin\left(\frac{\pi}{2}\right) - \sin(0) = 1 - 0 = 1 \] Now, sum the results: \[ \int_{-2}^{\frac{\pi}{2}} f(x) \, dx = -4 + 1 = -3 \]

The correct option is (C) : \(-3\)

Was this answer helpful?
0
0
Hide Solution
collegedunia
Verified By Collegedunia

Approach Solution -2

We are given a piecewise function: 

\[ f(x) = \begin{cases} \cos x & \text{for } x \geq 0 \\ 2x & \text{for } x < 0 \end{cases} \]

We are asked to evaluate:
\[ \int_{-2}^{\frac{\pi}{2}} f(x) \, dx \]

Since the function is defined piecewise, split the integral:
\[ \int_{-2}^{\frac{\pi}{2}} f(x)\, dx = \int_{-2}^{0} 2x \, dx + \int_{0}^{\frac{\pi}{2}} \cos x \, dx \]

Evaluate each part:
First integral:
\[ \int_{-2}^{0} 2x \, dx = \left[ x^2 \right]_{-2}^{0} = (0)^2 - (-2)^2 = -4 \]
Second integral:
\[ \int_{0}^{\frac{\pi}{2}} \cos x \, dx = \left[ \sin x \right]_0^{\frac{\pi}{2}} = \sin\left(\frac{\pi}{2}\right) - \sin(0) = 1 - 0 = 1 \]

So the total value is:
\[ -4 + 1 = -3 \]

Correct answer: -3

Was this answer helpful?
0
0