a)
\(x^2-4y^2-x+2y\\ =\left(x^2-4y^2\right)-\left(x-2y\right)\\ =\left(x-2y\right)\left(x+2y\right)-\left(x-2y\right)\\ =\left(x-2y\right)\left(x+2y+1\right)\)
b)
\(x^2-5x+4\\ =x^2-x-4x+4\\ =x\left(x-1\right)-4\left(x-1\right)\\ =\left(x-1\right)\left(x-4\right)\)