Density function as derivative (Self-study) I'm trying to do the Society of Actuaries' example problems.  I am having trouble with no. 62, which says:

A random variable $X$ has CDF
  $$ F(x) = 
\begin{cases} 0 & \text{for $x < 1$} \\
              \frac{x^2 - 2x + 2}{2} & \text{for $1 \leq x < 2$} \\
              1 & \text{for $x \geq 2$}
\end{cases}
$$
  Compute the variance of $X$.

I understand the basic steps for computing the variance:


*

*Transform the CDF into a density $f$, by differentiating.

*Compute the expectation $E(X)$ by integrating $x f(x)$

*Compute the expectation $E(X^2)$ by integrating $x^2 f(x)$

*Compute the variance $V(X) = E(X^2) - E(X)^2$.


The problem I'm having is that the density I compute does not match up with the one in the solutions page.  In particular, I get
$$f(x) = \begin{cases} x - 1 & \text{for $1 \leq x < 2$}\\
                       0     & \text{otherwise}
\end{cases}
$$
whereas they get 
$$ 
f(x) = 
\begin{cases} \frac{1}{2} & \text{for $x = 1$} \\
              x - 1       & \text{for $1 \leq x < 2$}\\
              0           & \text{otherwise}
\end{cases}
$$
Where is that $\frac{1}{2}$ coming from?
Edit:  I corrected the CDF, and now the derivative (if not the density) is correct.
 A: Note that as $x$ approaches $1$ from the left, the cdf stays at $0$. Now calculate the cdf at $x=1$. Substituting $x=1$ into the formula, we have $F(1)=\frac{1}{2}$. So no "weight" up to but not including $1$, and then a sudden weight of $\frac{1}{2}$ at $1$. 
Our overall distribution is neither discrete nor continuous. it has some features from each. That sort of distribution is often called a mixed distribution. 
Before we do the remaining detailed calculations, we need to worry about the expression $\frac{x^2+2x-2}{2}$. Note that for $x$ near $2$ but to the left of $2$, this gives a number much bigger than $1$. That is absolutely impossible for a cdf. 
Added: Now the cdf for $1\le x\lt 2$ has been fixed to $\frac{x^2-2x-2}{2}$, it is indeed a cdf. 
To compute the variance, we probably first want to compute the mean. Differentiating, we find that the density function for $1\lt x\lt 2$ is $x-1$. 
So we have a point mass of $\frac{1}{2}$ at $x=1$, and a wire of varying density stretching from $1$ to $2$. For the mean, we need to treat the two contributions to the mean separately, and add. We get
$$E(X)=(1)\left(\frac{1}{2}\right) +\int_{x=1}^2 x(x-1)\,dx.$$
This I think simplifies to $\frac{4}{3}$.
To complete the calculation of variance, we need $E(X^2)$. This is
$$(1^2)\left(\frac{1}{2}\right) +\int_{x=1}^2 x^2(x-1)\,dx.$$
