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

Answer : $y=\frac{1}{2}(\cos x-\sin x)+C e^{-x}$

Hint : To solve this equation we use $e^{\int P d x}$  formula.

Give : $\frac{d y}{d x}+y=\cos x$

Solution : $\frac{d y}{d x}+P(x) y=Q(x)$

\begin{aligned} &I f=e^{\int P(x) d x} \\ &y I f=\int Q(x) I f d x \\ &\frac{d y}{d x}+y=\cos x \end{aligned}

\begin{aligned} &P(x)=1, Q(x)=\cos x \\ &I f=e^{\int P d x} \\ &=e^{\int 1 d x} \\ &=e^{x} \end{aligned}

\begin{aligned} &y e^{x}=\int \cos x e^{x} d x \ldots \\ &y I f=\int Q(x) I f d x \end{aligned}

Suppose $I=\int \cos x e^{x} d x$

\begin{aligned} &=\cos e^{x}-\int(-\sin x) e^{x} d x \\ &=-\cos x e^{x}+-\int \sin x e^{x} d x \\ &=I=\cos x e^{x}+\sin x e^{x}-\int \cos x e^{x} d x \end{aligned}

\begin{aligned} &=I=e^{x}(\cos x+\sin x)-\int \cos x e^{x} d x \\ &=I=e^{x}(\cos x+\sin x)-I \\ &=2 I=e^{x}(\cos x+\sin x) \\ &=I=\frac{e^{x}}{2}(\cos x+\sin x) \ldots(i i) \end{aligned}

$=y e^{x}=\frac{e^{x}}{2}(\cos x+\sin x)+C$