【解答】
(13分)(2017•山东)已知函数 $f(x)=x^{2}+2 \cos x, g(x)=e^{x}(\cos x-\sin x+ 2 x-2$ ),其中 $e \approx 2.17828 \ldots$ 是自然对数的底数。
(I)求曲线 $y=f(x)$ 在点( $\pi, f(\pi)$ )处的切线方程;
(II)令 $\mathrm{h}(\mathrm{x})=\mathrm{g}$
$f(x)(a \in R)$ ,讨论 $h(x)$ 的单调性并判断有无极值,有极值时求出极值.
【解答】解:(I)$f(\pi)=\pi^{2}-2$ .$f^{\prime}(x)=2 x-2 \sin x, \therefore f^{\prime}(\pi)=2 \pi$ .
∴ 曲线 $y=f(x)$ 在点 $(\pi, f(\pi))$ 处的切线方程为:$y-\left(\pi^{2}-2\right)=2 \pi(x-\pi)$
化为: $2 \pi x-y-\pi^{2}-2=0$ .
(II)$h(x)=g(x)-a f(x)=e^{x}(\cos x-\sin x+2 x-2)-a\left(x^{2}+2 \cos x\right)$
$\mathrm{h}^{\prime}(\mathrm{x})=\mathrm{e}^{\mathrm{x}}(\cos \mathrm{x}-\sin \mathrm{x}+2 \mathrm{x}-2)+\mathrm{e}^{\mathrm{x}}(-\sin \mathrm{x}-\cos \mathrm{x}+2)-\mathrm{a}(2 \mathrm{x}-2 \sin \mathrm{x})$
$=2(x-\sin x)\left(e^{x}-a\right)=2(x-\sin x)\left(e^{x}-e^{\ln a}\right)$.
令 $u(x)=x-\sin x$ ,则 $u^{\prime}(x)=1-\cos x \geq 0, \therefore$ 函数 $u(x)$ 在 $R$ 上单调递增。
$\because u(0)=0, \quad \therefore x>0$ 时,$u(x)>0 ; x<0$ 时,$u(x)<0$ .
①$a \leq 0$ 时,$e^{x}-a>0, \therefore x>0$ 时,$h^{\prime}(x)>0$ ,函数 $h(x)$ 在( $0,+\infty$ )单调递增;
$x<0$ 时,$h^{\prime}(x)<0$ ,函数 $h(x)$ 在 $(-\infty, 0)$ 单调递减.
$\therefore x=0$ 时,函数 $h(x)$ 取得极小值,$h(0)=-1-2 a$ .