its easy to check these
just expand the brackets
which is not your original equation
the second one should be
an equation in the form ax^2+bx+c=0 is called a quadratic equation. it can always be written as product of two factors.
=(a-b)(a-4) [there are two factors]
=(r-1)(r-1) (again two factors though equal)
so before writing r(r-2)+1 remember quadratic equations can be written as product of two factors