f(x) = 0.5x² - (a + 1)x + alnx
f'(x) = x - (a + 1) + a / x
由于在(2,f(2))处的切线为-1
f'(x) = 0
f'(2) = 0
2 - (a + 1) + a / 2 = 0
解得:a = 4
f(x) = 0.5x² -5x + 4lnx
f'(x) = x - 5 + 4 / x
令f'(x) = 0
x - 5 + 4 / x = 0
x = 1 or x = 4
f''(x) = 1 - 4 / x²
f''(1) = -3 < 0,∴最大值为f(1) = -9 / 2
f''(4) = 3 / 4 > 0,∴最小值为f(4) = 8ln2 - 12