(ax2 + cot x) (p + q cos x)
Given $y=\left(a x^{2}+\cot x\right)(p+q \cos x)$
Applying product rule of differentiation that
$\Rightarrow \frac{d}{d x}(t . y)=y \cdot \frac{d t}{d x}+t \cdot \frac{d y}{d x}$
$\Rightarrow y=\left(a x^{2}+\cot x\right)(p+q \cos x)$
Now splitting the differentials,
$\Rightarrow \frac{\mathrm{dy}}{\mathrm{dx}}=(\mathrm{p}+\mathrm{q} \cos \mathrm{x}) \frac{\mathrm{d}}{\mathrm{dx}}\left(\mathrm{ax}^{2}+\cot \mathrm{x}\right)+\left(\mathrm{ax}^{2}+\cot \mathrm{x}\right) \frac{\mathrm{d}}{\mathrm{dx}}(\mathrm{p}+\mathrm{q} \cos \mathrm{x})$
On differentiation we get
$\Rightarrow \frac{d y}{d x}=(p+q \cos x)\left(2 a x-\operatorname{cosec}^{2} x\right)+\left(a x^{2}+\cot x\right)(-q \sin x)$
$\Rightarrow \frac{\mathrm{dy}}{\mathrm{dx}}=(\mathrm{p}+\mathrm{q} \cos \mathrm{x})\left(2 \mathrm{ax}-\operatorname{cosec}^{2} \mathrm{x}\right)-\mathrm{q} \sin \mathrm{x}\left(\mathrm{ax}^{2}+\cot \mathrm{x}\right)$