解答:解:(1)由已知x>0
f′(x)=x-(a+1)+曲線y=f(x)在(2,f(2))處切線的斜率為-1,
所以f'(2)=-1即
2-(a+1)+=-1,解得a=4
(2)
f′(x)=x-(a+1)+==①當(dāng)0<a<1時,
當(dāng)x∈(0,a)時,f'(x)>0,函數(shù)f(x)單調(diào)遞增;
當(dāng)x∈(a,1)時,f'(x)<0,函數(shù)f(x)單調(diào)遞減;
當(dāng)x∈(1,+∞)時,f'(x)>0,函數(shù)f(x)單調(diào)遞增.
此時x=a是f(x)的極大值點,x=1是f(x)的極小值點.
②當(dāng)a=1時,
當(dāng)x∈(0,1)時,f'(x)>0,
當(dāng)x=1時,f'(x)=0,
當(dāng)∈(1,+∞)時,f'(x)>0
所以函數(shù)f(x)在定義域內(nèi)單調(diào)遞增,此時f(x)沒有極值點.
③當(dāng)a>1時,當(dāng)x∈(0,1)時,f'(x)>0,函數(shù)f(x)單調(diào)遞增;
當(dāng)x∈(a,1)時,f'(x)<0,函數(shù)f(x)單調(diào)遞減;
當(dāng)x∈(a,+∞)時,f'(x)>0,函數(shù)f(x)單調(diào)遞增.
此時x=1是f(x)的極大值點,x=a是f(x)的極小值點.
綜上,當(dāng)0<a<1時,x=a是f(x)的極大值點,x=1是f(x)的極小值點;
當(dāng)a=1時,f(x)沒有極值點;
當(dāng)a>1時,x=1是f(x)的極大值點,x=a是f(x)的極小值點