0

How do you solve the following inhomogeneous differential equation:

$$ y' + y\cos x = \sin x \cos x ?$$

I determined the homogeneous solution ($y_h=Ce^{-\sin x})$, but how do I find the particular solution? I tried using the ansatz $y_p = (P \sin x + Q\cos x)(S\sin x + Z\cos x)$, but this approach failed (I didn't succeed at least). What is the most bright approach? Thanks for any help!

Zain Patel
  • 16,802
Breaking M
  • 1,050

4 Answers4

4

Use the integrating factor $$\mu(x) = \exp\left\{\int \cos(x)\ dx\right\} = e^{\sin(x)}.$$

ncmathsadist
  • 49,383
2

$${ y }^{ \prime }+y\cos { x } =\sin { x } \cos { x } $$ $$\Downarrow $$ $${ y }\prime +y\cos { x } =0$$ $$\Downarrow $$ $$\frac { dy }{ dx } =-y\cos { x } $$ $$\Downarrow $$ $$\int { \frac { dy }{ y } } =-\int { \cos { x } dx } $$ $$\Downarrow $$ $$ lny+{ C }_{ 1 }=-\sin { x } +C_{ 2 }$$ $$\Downarrow $$ $$ y={ Ce }^{ -\sin { x } }$$ $$\Downarrow $$ $$ y=C\left( x \right) { e }^{ -\sin { x } }$$ $$\Downarrow$$ $$ { y }\prime =C\prime \left( x \right) { e }^{ -\sin { x } }-C\left( x \right) \cos { x } { e }^{ -\sin { x } }$$ $$\Downarrow$$ $$C\prime \left( x \right) { e }^{ -\sin { x } }-C\left( x \right) \cos { x } { e }^{ -\sin { x } }+C\left( x \right) \cos { x } { e }^{ -\sin { x } }=\sin { x } \cos { x } $$ $$\Downarrow$$ $$C\prime \left( x \right) { e }^{ -\sin { x } }=\sin { x } \cos { x } $$ $$\Downarrow$$ $$C\prime \left( x \right) ={ e }^{ \sin { x } }\sin { x } \cos { x } $$ $$\Downarrow$$

$$C\left( x \right) =\int { { e }^{ \sin { x } }\sin { x } \cos { x } dx } =\int { \sin { x } d } { e }^{ \sin { x } }={ e }^{ \sin { x } }\sin { x } -\int { { e }^{ \sin { x } }\cos { xdx } } ={ e }^{ \sin { x } }\sin { x } -\int { d{ e }^{ \sin { x } } } ={ e }^{ \sin { x } }\left( \sin { x } -1 \right) +C$$ finally $$ y={ e }^{ -\sin { x } }\left[ { e }^{ \sin { x } }\left( \sin { x } -1 \right) +C \right] =\sin { x } -1+{ Ce }^{ -\sin { x } }$$

haqnatural
  • 21,578
1

make the ansatz $y_p=A\sin(x)+B\cos(x)+C_1$ where $A,B,C_1$ are real numbers

0

You could use $y_p=A\sin x+B$

this gives the equation $A\cos x+(A\sin x+B)\cos x=\sin x\cos x$.

user84413
  • 27,211