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

Answer : $y=x^{2}-\frac{\pi}{4} \operatorname{cosec} x+C$

Give : $\tan x \frac{d y}{d x}=2 x \tan x+x^{2}-y, \tan x \neq 0, y=0 \text { when } x=\frac{\pi}{2}$

Hint : Using integration by parts and $\int \cot x d x$

Explanation : $\tan x \frac{d y}{d x}=2 x \tan x+x^{2}-y$

Divide by $\tan\; x$

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

This is a linear differential equation of the form

\begin{aligned} &\frac{d x}{d y}+P y=Q \\ &P=\cot x \text { and } Q=2 x+\cot x x^{2} \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\left(2 x+x^{2} \cot x\right) \sin x d x+C \\ &=y \sin x=\int 2 x \sin x+x^{2} \cot x \sin x d x+C \\ &=y \sin x=2 \int x \sin x d x+\int x^{2} \cot x \sin x d x+C \end{aligned}

\begin{aligned} &=y \sin x=2\left[\frac{x^{2}}{2} \sin x-\int \cos x \frac{x^{2}}{2} d x\right]+\int \frac{\cos x}{\sin x} \sin x x^{2} d x+C \quad\left[\cot x=\frac{\cos x}{\sin x}\right] \\ &=y \sin x=x^{2} \sin x-\int \cos x x^{2} d x+\int \cos x x^{2} d x+C \\ &=y \sin x=x^{2} \sin x+C \end{aligned}

Divide by $\sin \; x$

\begin{aligned} &=y=x^{2}+\frac{c}{\sin x} \\ &=y=x^{2}+C \operatorname{cosec} x \ldots(i) \end{aligned}

Now $y=0 \text { when } x=\frac{\pi}{2}$

\begin{aligned} &=0=\left(\frac{\pi}{2}\right)^{2}+C \operatorname{cosec} \frac{\pi}{2} \\ &=0=\frac{\pi^{2}}{4}+C(1) \quad\left[\operatorname{cosec} \frac{\pi}{2}=1\right] \\ &=C=-\frac{\pi^{2}}{4} \end{aligned}

Substituting in (i)

$=y=x^{2}-\frac{\pi^{2}}{4} \operatorname{cosec} x$