a)\(2x-x^2-4\)
\(=-\left(x^2+2x+4\right)\)
\(=-\left(x^2+2x+1\right)-3\)
\(=-\left(x-1\right)^2-3\le-3\)
Dấu = khi \(x=1\)
Vậy GTLN=-3 khi x=1
b)\(-x^2-4x\)
\(=-x^2-4x-4+4\)
\(=-\left(x^2+4x+4\right)+4\)
\(=-\left(x+2\right)^2+4\le4\)
Dấu = khi \(x=-2\)
Vậy GTLN=4 khi \(x=-2\)