Nonhomogeneous Poisson distribution

The expected number of claims in 12 months is simply the integral of the intensity (claims rate) over that time period; i.e. $$\operatorname{E}[N(12)] = \Lambda(12) = \int_{t = 0}^{12} \lambda(t) \, dt$$ where $$\lambda(t) = \begin{cases} t, & 0 \le t \le 5 \\ 5, & 5 < t \le 7 \\ 12 - t, & 7 < t \le 12.\end{cases}$$

The integration of $\lambda$ is straightforward:

$$\int_{t = 0}^{12} \lambda(t) \, dt = \int_{t=0}^5 t \, dt + \int_{t=5}^7 5 \, dt + \int_{t=7}^{12} (12-t) \, dt.$$ You don't need to explicitly compute $\Lambda(t)$ and write it as a piecewise function, which is what you were apparently trying to do, because all you need is the cumulative intensity at a single point in time.


For the sake of completeness, if you need to compute the cumulative intensity $\Lambda(t)$, then there are the following cases:

Case 1. $0 \le t \le 5$:

$$\Lambda(t) = \int_{s=0}^t s \, ds = \frac{t^2}{2}.$$

Case 2. $5 < t \le 7$:

$$\Lambda(t) = \Lambda(5) + \int_{s=5}^t 5 \, ds = \frac{25}{2} + 5(t-5) = 5t - \frac{25}{2}.$$

Case 3. $7 < t \le 12$:

$$\Lambda(t) = \Lambda(7) + \int_{s=7}^t (12 - s) \, ds = 5(7) - \frac{25}{2} + 12t - \frac{t^2}{2} - 12(7) + \frac{7^2}{2} = -37 + 12t - \frac{t^2}{2}.$$

Case 4. $t > 12$:

$$\Lambda(t) = \Lambda(12) + 0 = -37 + 12(12) - \frac{12^2}{2} = 35.$$

This gives the complete function

$$\Lambda(t) = \begin{cases} 0, & t < 0 \\ \frac{t^2}{2}, & 0 \le t \le 5 \\ 5t - \frac{25}{2}, & 5 < t \le 7 \\ -\frac{t^2}{2} + 12 t - 37, & 7 < t \le 12 \\ 35, & t > 12. \end{cases}$$

We can then compute probabilities and expected intensities for intervals from one point in time to another, e.g. the expected number of claims between times $t = 4$ and $t = 8$ is $\Lambda(8) - \Lambda(4) = 27 - 8 = 19$.