#### Provide solution for RD Sharma maths Class 12 Chapter 21 Differential Equation Exercise 21.10 Question 37 Subquestion (xii) textbook solution.

Answer : $y \sin x=-\frac{\cos 2 x}{2}+C$

Give : $d y=\cos x(2-y \operatorname{cosec} x) d x$

Hint : Using $\int \cot x d x$

Explanation : $d y=\cos x(2-y \operatorname{cosec} x) d x$

\begin{aligned} &=\frac{d y}{d x}=\cos x(2-y \operatorname{cosec} x) \\ &=\frac{d y}{d x}=2 \cos x-y \cos x \frac{1}{\sin x} \; \; \; \; \; \; \; \; \; \; \; \; \quad\left[\operatorname{cosec} x=\frac{1}{\sin x}\right] \end{aligned}

\begin{aligned} &=\frac{d y}{d x}=2 \cos x-y \cot x \; \; \; \; \; \; \; \; \; \; \; \; \; \; \quad\left[\frac{\cos x}{\sin x}=\cot x\right] \\ &=\frac{d y}{d x}+(\cot x) y=2 \cos x \end{aligned}

This is a linear differential equation of the form

\begin{aligned} &\frac{d x}{d y}+P y=Q \\ &P=\cot x \operatorname{and} Q=2 \cos x \end{aligned}

The integrating factor $If$  of this differential equation is

\begin{aligned} &I f=e^{\int P d x} \\ &=e^{\int \cot x d x} \\ &=e^{\log |\sin x|} \; \; \; \; \; \quad\left[\int \cot x d x=\log |\sin x|+C\right] \\ &=\sin x\; \; \; \; \; \; \; \; \; \; \; \quad\left[e^{\log e^{x}}=x\right] \end{aligned}

Hence, the solution is

\begin{aligned} &y I f=\int Q I f d x+C \\ &=y(\sin x)=\int 2 \cos x \sin x d x+C \\ &=y \sin x=\int \sin 2 x d x+C \; \; \; \; \; \; \; \; \; \; \; \; \quad[2 \cos x \sin x=\sin 2 x] \\ &=y \sin x=-\frac{\cos 2 x}{2}+C \end{aligned}