© All Rights reserved @ LearnWithDash
Step-by-Step Solution
Step 1: Understand the function and the condition for limit existence
We have
$$f(x) = a \sin\biggl(\frac{\pi [x]}{2}\biggr) + [2 - x],$$
where $[t]$ denotes the greatest integer less than or equal to $t$ (the floor function), and $a \in \mathbb{R}$.
We want the limit
$$\lim_{x \to -1} f(x)$$
to exist. This means:
$$\lim_{x \to -1^-} f(x) = \lim_{x \to -1^+} f(x).$$
Step 2: Evaluate the left-hand limit as $x \to -1^-$
As $x \to -1^-$, $[x]$ becomes $-2$ because for values just a little less than $-1$, the greatest integer is $-2$. Hence,
$$
[x] = -2
\quad\text{and}\quad
[2 - x] = [2 - (\text{number slightly less than } -1)] = [3 + \epsilon],
$$
where $\epsilon$ is a small positive fraction. Thus, $[2 - x] = 3$. So,
$$
f(x) = a \sin\Bigl(\frac{\pi \cdot (-2)}{2}\Bigr) + 3
= a \sin(-\pi) + 3
= -\,a \,0 + 3
= 3,
$$
because $\sin(-\pi) = 0.$
(Slight correction is needed by carefully checking the provided derivation: In the provided working, they explicitly used
$$\sin\left(\frac{-2\pi}{2}\right) = \sin(-\pi).$$
We must keep consistent with the final expression they equated. We will keep going and match it with the condition.)
Step 3: Evaluate the right-hand limit as $x \to -1^+$
As $x \to -1^+$, $[x]$ becomes $-1$, because for values just a little more than $-1$, the greatest integer is $-1$. Then
$$
[2 - x] = [2 - (\text{number slightly bigger than } -1)] = [3 - \epsilon] = 2,
$$
where $\epsilon$ is a small positive fraction. So,
$$
f(x) = a \sin\Bigl(\frac{\pi \cdot (-1)}{2}\Bigr) + 2
= a \sin\left(-\frac{\pi}{2}\right) + 2
= a \cdot (-1) + 2
= -\,a + 2.
$$
Step 4: Apply the condition for limit existence
Because the limit exists at $x \to -1$, these two one-sided limits must be equal:
$$
3
\;=\;
(-a + 2).
$$
Solving for $a$, we get
$$
-\,a + 2 = 3
\;\Longrightarrow\;
-\,a = 1
\;\Longrightarrow\;
a = -1.
$$
Step 5: Substitute $a = -1$ into $f(x)$
With $a = -1$, the function becomes
$$
f(x) = -1 \cdot \sin\Bigl(\frac{\pi [x]}{2}\Bigr) + [2 - x]
= -\,\sin\Bigl(\frac{\pi [x]}{2}\Bigr) + [2 - x].
$$
Step 6: Compute the integral $\displaystyle \int_{0}^{4} f(x)\,dx$
We need
$$
\int_{0}^{4} \left( -\,\sin\Bigl(\frac{\pi [x]}{2}\Bigr) + [2 - x] \right)\,dx.
$$
We will break the integral into intervals where $[x]$ and $[2 - x]$ remain constant.
For $x \in [0,1)$:
$[x] = 0 \implies \sin\Bigl(\frac{\pi [x]}{2}\Bigr) = \sin(0) = 0.$
$[2 - x] = [2 - (0 \text{ to } 1^-)] = [2 \text{ down to } 1^+] = 1.$
Hence on $[0,1)$,
$$
f(x) = -0 + 1 = 1.
$$
The integral over $[0,1)$ is
$$
\int_{0}^{1} 1 \, dx = 1.
$$
For $x \in [1,2)$:
$[x] = 1 \implies \sin\Bigl(\frac{\pi [x]}{2}\Bigr)
= \sin\Bigl(\frac{\pi \cdot 1}{2}\Bigr)
= \sin\Bigl(\frac{\pi}{2}\Bigr) = 1.$
$[2 - x] = [2 - (1 \text{ to } 2^-)] = [1 \text{ down to } 0^+] = 0.$
Hence on $[1,2)$,
$$
f(x) = - (1) + 0 = -1.
$$
The integral over $[1,2)$ is
$$
\int_{1}^{2} -1 \, dx = -1.
$$
For $x \in [2,3)$:
$[x] = 2 \implies \sin\Bigl(\frac{\pi [x]}{2}\Bigr)
= \sin\Bigl(\frac{\pi \cdot 2}{2}\Bigr)
= \sin(\pi) = 0.$
$[2 - x] = [2 - (2 \text{ to } 3^-)] = [0 \text{ down to } -1^+] = -1.$
Hence on $[2,3)$,
$$
f(x) = - 0 + (-1) = -1.
$$
The integral over $[2,3)$ is
$$
\int_{2}^{3} -1 \, dx = -1.
$$
For $x \in [3,4]$:
$[x] = 3$ for $x \in [3,4)$ and $[4] = 4$ at $x=4$ itself, but the value on $[3,4)$ will be $3$. So effectively for $x \in [3,4)$,
$$
\sin\Bigl(\frac{\pi [x]}{2}\Bigr) = \sin\Bigl(\frac{3\pi}{2}\Bigr) = -1.
$$
$[2 - x] = [2 - (3 \text{ to } 4)] = [-1 \text{ down to } -2] = -2 \text{ or } -1. \\
\text{But carefully checking: } 2 - 3 = -1 \text{ up to } 2 - 4 = -2, \text{ so the greatest integer function in that range is -2 for } x \in (3,4], \text{ and exactly } -1 \text{ at } x=3. \\
\text{On the interval }(3, 4), [2 - x] = -2.
$$
Hence on $(3,4)$,
$$
f(x) = -\bigl(-1\bigr) + (-2) = 1 - 2 = -1.
$$
\text{At } x=3 \text{ exactly, } [2-3] = [ -1 ] = -1, \text{ but since a single point doesn't change the value of the integral, we use -1 for the integrand on }[3,4).
The integral over $[3,4)$ is
$$
\int_{3}^{4} -1 \, dx = -1.
$$
Step 7: Sum the contributions of each interval
Collecting all parts:
$$
\int_{0}^{4} f(x)\,dx
= \int_{0}^{1} 1\,dx + \int_{1}^{2} (-1)\,dx + \int_{2}^{3} (-1)\,dx + \int_{3}^{4} (-1)\,dx.
$$
That is:
$$
1 + (-1) + (-1) + (-1) = 1 - 1 - 1 - 1 = -2.
$$
Therefore, the required integral value is
$$\boxed{-2}.$$