First, we write the right hand side as:

`y = 2x\ sin x + (2 − x^2) cos x`.

We have 2 products. The first term is the product of `(2x)` and `(sin x)`. The second term is the product of `(2-x^2)` and `(cos x)`.

So, using the Product Rule on both terms gives us:

`(dy)/(dx)= (2x) (cos x) + (sin x)(2) +` ` [(2 − x^2) (−sin x) + (cos x)(−2x)]`

`= cos x (2x − 2x) + ` `(sin x)(2 − 2 + x^2)`

`= x^2sin x`

Please support IntMath!