#### Explain solution RD Sharma class 12 Chapter 21 Differential Equation exercise 21.10 question 36 subquestion (iii)

Answer:  \begin{aligned} & y=-e^{x}+C x \\ & \end{aligned}

Give:  $x \frac{d y}{d x}-y=(x+1) e^{x}$

Hint: Using  $\int \frac{1}{x}dx$

Explanation:  $x \frac{d y}{d x}-y=(x+1) e^{x}$

Divide by  $x$

\begin{aligned} &\frac{d y}{d x}-\frac{y}{x}=\frac{(x+1) e^{x}}{x} \\ &\frac{d y}{d x}+\left(-\frac{1}{x}\right) y=\frac{(x+1) e^{x}}{x} \end{aligned}

This is a first order linear differential equation of the form

\begin{aligned} &\frac{d y}{d x}+P y=Q \\ &P=-\frac{1}{x} \text { and } Q=\frac{(x+1) e^{x}}{x} \end{aligned}

The integrating factor   of this differential equation is

\begin{aligned} &\text { If }=e^{\int P d x} \\ &=e^{\int-\frac{1}{x} d x} \\ &=e^{-\int x^{-1} d x} \quad\left[\int d c=x+C\right] \\ &=e^{-x} \\ &=x^{-1}=\frac{1}{x} \end{aligned}

Hence, the solution of differential equation is

\begin{aligned} &y(I f)=\int Q I f d x+C \\ &\Rightarrow y\left(e^{-x}\right)=\int \frac{(x+1) e^{x}}{x}\left(\frac{1}{x}\right) d x+C \end{aligned}

\begin{aligned} &\Rightarrow y\left(e^{-x}\right)=\int \frac{(x+1) e^{x}}{x^{2}} d x+C \\ &=y\left(e^{-x}\right)=I_{1}+C \ldots(i) \\ &=I_{1}=\int \frac{(x+1) e^{-x}}{x^{2}} d x \\ &=I_{1}=\int \frac{(x) e^{-x}}{x^{2}} d x+\int \frac{(1) e^{-x}}{x^{2}} d x \\ &=I_{1}=\int \frac{e^{-x}}{x} d x+\int \frac{e^{-x}}{x^{2}} d x \end{aligned}

\begin{aligned} &=I_{1}=\frac{1}{x} \frac{e^{-x}}{(-1)}-\int\left(\frac{1}{x^{2}}\right) \frac{e^{-x}}{1} d x+\int \frac{1}{x^{2}} e^{x} d x \\ &=I_{1}=\frac{-e^{-x}}{x}-\int \frac{e^{-x}}{x^{2}} d x+\int \frac{e^{x}}{x^{2}} d x \\ &=I_{1}=\frac{-e^{-x}}{x} \end{aligned}

By  $\frac{y}{x}=-\frac{e^{-x}}{x}+C$

Multiplying by x we get

$y=-e^{-x}+C x$