1) (x-5)²-7 = x²-10x+25-7 = x²-10x+18
2) 6y+(y-3)² = 6y+y²-6y+9 = y²-9 = (y-3)(y+3)
3) (4a-5b)²-16a(a-3b) = 16a²-40ab+25b²-16a²+48ab = 8ab+25b² = b(8a+25b)
4) x(x-2)-(x-3)² = x²-2x-(x²-6x+9) = x²-2x-x²+6x-9 = 4x-9
5) (8p-q)²-(4p-q)(16p+3q) = 64p²-16pq+q²-(64p²+12pq-16pq-3q²) = 64p²-16pq+q²-64p²+4pq+3q² = -12pq+4q² = 4q(q-3p)