This problem comes out of Mathematical Statistics by Freud, 6th edition.
Either the book has many errors or I can’t figure out where I am wrong.
Find the cdf of $X$ whose pdf is $$f(x)=\begin{cases}x&0<x<1\\ 2-x&1\le x<2\\0&\text{else}\end{cases}$$
Integrating $x$ from 0 to 1: $0.5x^2$. That is correct with the book.
Integrating from 1 to 2: $[2x-x^2/2]_1^2=2x-\frac{x^2}2-\frac32$. The book gives $2x-\frac{x^2}2-1$ for $1\le x<2$.
You missed out the part of the random variable between 0 and 1. The probability the random variable takes a value in that range is (by your calculations) 0.5; adding this to the integral you evaluated for the part between 1 and 2 gives the book's correct answer.