#### Need solution for RD Sharma maths Class 12 Chapter 21 Differential Equation Exercise 21.10 Question 18 textbook solution.

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

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

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

Solution : $\frac{d y}{d x}+Py=Q$

\begin{aligned} &P=\cot x, Q=x^{2} \cot x+2 x \\ \end{aligned}

\begin{aligned} &I f=e^{\int P d x} \\ \end{aligned}

\begin{aligned} &=e^{\int \cot x d x} \\ \end{aligned}

\begin{aligned} &=e^{\log \sin x} \\ \end{aligned}

\begin{aligned} &=\sin x \end{aligned}

\begin{aligned} &=y I f=\int \text { QIf } d x+C \\ &=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 \end{aligned}

$=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 \\ &{\left[\int u v d x=u \int v d x-\int \frac{d y}{d x} \int v d x d x\right]} \end{aligned}

\begin{aligned} &=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 \end{aligned}