## Task Condition

Find the derivative.

$$
y=\frac{e^{x}}{2}\left(\left(x^{2}-1\right) \cos x+(x-1)^{2} \sin x\right)
$$
## Solution

$$
\begin{aligned}
& y^{\prime}=\left(\frac{e^{x}}{2}\left(\left(x^{2}-1\right) \cos x+(x-1)^{2} \sin x\right)\right)^{\prime}= \\
& =\left(\frac{e^{x}}{2}\right)^{\prime} \cdot\left(\left(x^{2}-1\right) \cos x+(x-1)^{2} \sin x\right)+\left(\frac{e^{x}}{2}\right) \cdot\left(\left(x^{2}-1\right) \cos x+(x-1)^{2} \sin x\right)^{\prime}= \\
& =\left(\frac{e^{x}}{2}\right) \cdot\left(\left(x^{2}-1\right) \cos x+(x-1)^{2} \sin x\right)+\left(\frac{e^{x}}{2}\right) \cdot\left(\left(\left(x^{2}-1\right) \cos x\right)^{\prime}+\left((x-1)^{2} \sin x\right)^{\prime}\right)= \\
& =\frac{e^{x}}{2} \cdot\left(\left(x^{2}-1\right) \cos x+(x-1)^{2} \sin x+2 x \cos x-\left(x^{2}-1\right) \sin x+2(x-1) \sin x+(x-1)^{2} \cos x\right)= \\
& =\frac{e^{x}}{2} \cdot\left(\left(x^{2}-1+2 x+(x-1)^{2}\right) \cos x+\left((x-1)^{2}-\left(x^{2}-1\right)+2(x-1)\right) \sin x\right)= \\
& =\frac{e^{x}}{2} \cdot\left(\left(x^{2}-1+2 x+x^{2}-2 x+1\right) \cos x+\left(x^{2}-2 x+1-x^{2}+1+2 x-2\right) \sin x\right)= \\
& =\frac{e^{x}}{2} \cdot\left(2 x^{2} \cdot \cos x+0 \cdot \sin x\right)=x^{2} \cdot e^{x} \cdot \cos x
\end{aligned}
$$

## Problem Kuznetsov Differentiation 7-25