解答:解:(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時(shí),
當(dāng)x∈(0,a)時(shí),f'(x)>0,函數(shù)f(x)單調(diào)遞增;
當(dāng)x∈(a,1)時(shí),f'(x)<0,函數(shù)f(x)單調(diào)遞減;
當(dāng)x∈(1,+∞)時(shí),f'(x)>0,函數(shù)f(x)單調(diào)遞增.
此時(shí)x=a是f(x)的極大值點(diǎn),x=1是f(x)的極小值點(diǎn).
②當(dāng)a=1時(shí),
當(dāng)x∈(0,1)時(shí),f'(x)>0,
當(dāng)x=1時(shí),f'(x)=0,
當(dāng)∈(1,+∞)時(shí),f'(x)>0
所以函數(shù)f(x)在定義域內(nèi)單調(diào)遞增,此時(shí)f(x)沒有極值點(diǎn).
③當(dāng)a>1時(shí),當(dāng)x∈(0,1)時(shí),f'(x)>0,函數(shù)f(x)單調(diào)遞增;
當(dāng)x∈(a,1)時(shí),f'(x)<0,函數(shù)f(x)單調(diào)遞減;
當(dāng)x∈(a,+∞)時(shí),f'(x)>0,函數(shù)f(x)單調(diào)遞增.
此時(shí)x=1是f(x)的極大值點(diǎn),x=a是f(x)的極小值點(diǎn).
綜上,當(dāng)0<a<1時(shí),x=a是f(x)的極大值點(diǎn),x=1是f(x)的極小值點(diǎn);
當(dāng)a=1時(shí),f(x)沒有極值點(diǎn);
當(dāng)a>1時(shí),x=1是f(x)的極大值點(diǎn),x=a是f(x)的極小值點(diǎn)