# Solve differential equation y'+ycosx= sinxcox

Question
Solve differential equation $$y'+ycosx= sinxcox$$

2021-02-04
$$y'+P(x)y= Q(x)$$
$$I.F.= e^(int p(x)dx)$$
$$y I.F= int(Q(x)I.F.)dx$$
$$y'+ycosx= sinxcosx$$
$$P(x)= cosx$$
$$Q(x)= sinxcosx$$
$$I.F.= e^(int cosxdx)= e^(sinx)$$
$$y I.F.= int(Q(x)I.F.)dx$$
$$ye^(sinx)= int(sinxcosx e^(sinx))dx$$
Let $$sinx=u$$
$$=> cosxdx=du$$
$$ye^(sinx)= int ue^u du$$
$$= ue^u-e^u+C$$
$$= sin xe^(sinx)-e^(sinx)+C$$
$$=> ye^(sinx)= sin xe^(sinx)-e^(sinx)+C$$
$$=> y= sinx-1+Ce^(-sinx)$$

### Relevant Questions

Solve differential equation $$xy'+2y= -x^3+x, \ y(1)=2$$
Solve differential equation $$\displaystyle{y}{\left({2}{x}-{2}+{x}{y}+{1}\right)}{\left.{d}{x}\right.}+{\left({x}-{y}\right)}{\left.{d}{y}\right.}={0}$$
Solve differential equation $$\displaystyle{\frac{{{\left.{d}{y}\right.}}}{{{\left.{d}{x}\right.}}}}={\frac{{{x}-{y}-{1}}}{{{x}+{y}+{3}}}}$$
Solve differential equation $$\displaystyle{\frac{{{\left.{d}{y}\right.}}}{{{\left.{d}{x}\right.}}}}={\left({x}+{y}+{1}\right)}^{{2}}-{\left({x}+{y}-{1}\right)}^{{2}}$$
Solve differential equation $$\displaystyle{\frac{{{\left.{d}{y}\right.}}}{{{\left.{d}{x}\right.}}}}-{\left({\cot{{x}}}\right)}{y}={{\sin}^{{3}}{x}}$$
Solve differential equation $$\displaystyle{\frac{{{\left.{d}{y}\right.}}}{{{\left.{d}{x}\right.}}}}+{\frac{{{y}}}{{{4}{x}}}}={3}{x},\ {y}{\left({2}\right)}={3}$$
Solve differential equation $$\displaystyle{y}'+{y}={x},\ {y}{\left({0}\right)}={1}$$
Solve differential equation $$\displaystyle{\frac{{{\left.{d}{y}\right.}}}{{{\left.{d}{x}\right.}}}}={\frac{{{x}}}{{{y}}}},\ {y}{\left({0}\right)}=-{8}$$
Solve differential equation $$\displaystyle{\frac{{{\left.{d}{y}\right.}}}{{{\left.{d}{x}\right.}}}}-{\left({\cot{{x}}}\right)}{y}={{\sin}^{{3}}{x}}$$
Solve differential equation $$\displaystyle{y}'+{y}{\cot{{\left({x}\right)}}}={\sin{{\left({2}{x}\right)}}}$$