Please solve RD Sharma Class 12 Chapter 21 Differential Equation exercise 21.5 question 5 maths textbook solution.

Answer:  $y=2\tan ^ 2\frac{x}{2}-x+C$

Hint: You have to integrate by applying integration of xn.

Given: $\frac{dy}{dx}=\frac{1-\cos x}{1+\cos x}$

Solution: We know

\begin{aligned} \cos 2 \theta &=2 \cos ^{2} \theta-1 \\ &=>\cos 2 \theta+1=2 \cos ^{2} \theta \end{aligned}

Replace $\theta$ by $\frac{x}{2}$

\begin{aligned} &=\cos 2\left(\frac{x}{2}\right)+1=2 \cos ^{2} \frac{x}{2} \\ &=>\cos x+1=2 \cos ^{2} \frac{x}{2} \ldots(i) \\ \cos 2 \theta &=1-2 \sin ^{2} \theta \\ &=>1-\cos 2 \theta=2 \sin ^{2} \theta \end{aligned}

Replace $\theta$ by $\frac{x}{2}$

\begin{aligned} &\Rightarrow 2 \sin ^{2} \frac{x}{2}=1-\cos 2\left(\frac{x}{2}\right)\\ &=>2 \sin ^{2} \frac{x}{2}=1-\cos x \end{aligned}

From (i) and (ii)

\begin{aligned} &\frac{d y}{d x}=\frac{1-\cos x}{1+\cos x}=>\frac{2 \sin ^{2} \frac{x}{2}}{2 \cos ^{2} \frac{x}{2}}=>\tan ^{2} \frac{x}{2} \\ &\frac{d y}{d x}=\tan ^{2} \frac{x}{2} \end{aligned}

Integrating both sides,

\begin{aligned} &\int \frac{d y}{d x}=\int \tan ^{2} \frac{x}{2} \\ &y=\int \sec ^{2} \frac{x}{2}-1\; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \quad\left[\tan ^{2} x=\sec ^{2} x-1\right] \\ &\quad=\int \sec ^{2} \frac{x}{2} d x-\int 1 d x \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \quad\left[\int \sec ^{2} x d x=\tan x+c\right] \\ &=\frac{\tan ^{2} \frac{x}{2}}{\frac{1}{2}}-x+C \\ &y=2 \tan ^{2} \frac{x}{2}-x+C \end{aligned}