Finding a partial solution to the differential equation

1k Views Asked by At

Given, $$\frac{dy}{dx} = yx \sin(x), \text{ when }y(0) = 1/4.$$

What I did is first, separate the equation $$ \frac{dy}{y} = x \sin (x) dx. $$ Second, integrate by parts $$ \ln |y| + C1 = -x \cos (x) + \sin (x) + C2 \Rightarrow C3 = C2-C1.$$ Third, left |y| alone $$|y| = e^{-x \cos (x) }+ e^{\sin(x)} + e^{C3}.$$ Fourth, inserted the values $$y(0) = 1/4 \Rightarrow 1/4 = 1 + 1 + e^{C3} \Rightarrow -1.75 = e^{C3} \Rightarrow \ln (-1.75) = \ln e^{C3}. $$ Here, since negative doesn't work inside ln ( ) I think there is something wrong with my solution. Can anyone help me with how I should approach this question?

Thank you!

4

There are 4 best solutions below

0
On

you can separate as $$\ln(4y) = \ln y - \ln (1/4)=\int_{1/4}^y \frac{dy}{y} = \int_0^x x \sin x \, dx = -x\cos x\big|_0^x + \int_0^x \cos x \, dx = - x\cos x+\sin x$$

so $$y = \frac 1 4e^{\sin x - x\cos x} $$

0
On

There's nothing wrong with the method, you just messed up you exponentiation. When the power is a sum, you end up with a product, not a sum!

0
On

As well as separating the variables, you can use the integrating factor if you like. Write \begin{equation*} \frac{dy}{dx}-xy\sin(x)=0. \end{equation*} Then we have \begin{equation*} e^{-\int x\sin(x)dx}=e^{x\cos(x)-\sin(x)}. \end{equation*} Multiplying each term by this and using the reverse product rule gives \begin{equation*} \frac{d}{dx}(e^{x\cos(x)-\sin(x)}y)=0. \end{equation*} Integrate both sides with respect to $x$ and apply the initial condition. Does that help?

0
On

$$ y'=yx\sin x\quad\Longrightarrow\quad \exp\left(-\int_0^x t\sin t\,dt\right)(y'-yx\sin x)=0\quad\Longrightarrow\quad \bigg(y(x)\exp\Big(-\int_0^x t\sin t\,dt\Big)\bigg)'=0\quad\Longrightarrow\quad y(x)\exp\Big(-\int_0^x t\sin t\,dt\Big)=c, $$ for some constant $c$. In fact, $y(0)=1/4$, implies that $c=4$. Thus $$ y(x)=\frac{1}{4}\exp\Big(\int_0^x t\sin t\,dt\Big)= \frac{1}{4}\exp\Big(-x\cos x+\sin x\Big). $$