#### Provide Solution for RD Sharma Class 12 Chapter 21 Differential Equation Exercise 21.10 Question 18

Answer:   $y \sin x=x^{2} \sin x+C$

Hint: To solve this we convert $\cot x$  to $\frac{\cos x}{\sin x}$  formula.

Give:  $\frac{d y}{d x}+\cot x y=x^{2} \cot x+2 x$

Solution:  \begin{aligned} & \frac{d y}{d x}+P y=Q\\ & \end{aligned}

$P=\cot x, Q=x^{2} \cot x+2 x\\$

$I f=e^{\int P d x}\\$

$=e^{\int \cot x d x}\\$

$=e^{\log \sin x}\\$

$=\sin x$

\begin{aligned} &=y I f=\int Q I f d x+C \\ & \end{aligned}

$=y \sin x=\int\left(x^{2} \cot x+2 x\right) \sin x d x+C \\$

$=y \sin x=\int x^{2} \frac{\cos x}{\sin x} \sin x+2 x \sin x d x+C \\$

$=y \sin x=\int x^{2} \cos x d x+\int 2 x \sin x d x+C$

\begin{aligned} &=x^{2} \int \cos x d x-\int \frac{d}{d x} x^{2} \int \cos x d x+2 \int x \sin x d x+C \\ & \end{aligned}

${\left[\int u v d x=u \int v d x-\int \frac{d y}{d x} \int v d x d x\right]} \\$

$=x^{2} \sin x-2 \int x \sin x d x+2 \int x \sin x d x+C \\$

$=y \sin x=x^{2} \sin x+C$