Problem: Let $X$ be a continuous random variable with probability density function given by
\[
f(x) =
\begin{cases}
ax, & 0 \leq x \leq 1 ;\\
a, & 1 \leq x \leq 2 ;\\
-ax + 3a, & 2 \leq x \leq 3 ;\\
0, & \text{ otherwise } \\
\end{cases}
\]
Determine the value of $a$ and find $P(X \leq 1.5)$.
The total probability is $1$, that is
\[ P(X < \infty) = 1 \implies \int_{-\infty}^{\infty}f(x)\ \mathrm{d}x = 1\]
$P(X < a) = \displaystyle \int_{-\infty}^a f(x)\ \mathrm{d}x$.
Solution: We know that the total probability of any event is $1$, so
\begin{align*}
& \int_{-\infty }^ {\infty } f(x) \mathrm{d} x = 1 \\[2ex]
\implies & \int_{-\infty } ^ 0 0\ \mathrm{d} x + \int _0 ^ 1 ax\ \mathrm{d} x + \int_1 ^2 a\ \mathrm{d} x \\[1ex]
& \kern 1cm + \int_2 ^3 (-ax + 3a)\ \mathrm{d} x + \int_3 ^{\infty } 0 \ \mathrm{d} x = 1 \\[2ex]
\implies & \left[ \frac{ax^2}{2} \right]_0^1 + \left[ ax \right] _1^2 + \left[ \frac{-ax^2}{2} + 3ax \right]_2^3 = 1\\[2ex]
\implies & \left[ \frac{a}{2} - 0 \right] + (2a - a) + \left[ -\frac{9a}{2} + 9a + 2a - 6a \right] = 1 \\[2ex]
\implies & 2a = 1 \implies a = \frac{1}{2}.
\end{align*}
Thus,
\[
\textcolor{blue}{
\boxed{
a = \frac{1}{2}
}
}
\]
Now we need to find the probability of the even when $X \leq 1.5$. This will be
\begin{align*}
P(X \leq 1.5) & = \int_{-\infty }^{1.5} f(x)\ \mathrm{d} x \\
& = \int_0^1 ax\ \mathrm{d} x + \int_1^{1.5} a\ \mathrm{d} x \\
& = a\left[ \frac{x^2}{2} \right]_0^1 + a (0.5) \\
& = \frac{a}{2} + \frac{a}{2} = a = \frac{1}{2}.
\end{align*}
Thus,
\[
\textcolor{blue}{\boxed{
P(X \leq 1.5) = 1.5
}}
\]