Initial Value Problem for $(\cos x -x\sin x +y^2)dx + 2xy\,dy =0$, $y(\pi )=1$

1.4k Views Asked by At

I'm solving past exam questions in preparation for an Applied Mathematics course. I came to the following question. If it's any indication of difficulty, the exercise is only Part 1-B of the sheet, graded for 10%, so it's supposed to be pretty easy

Solve the initial value problem for $(\cos x -x\sin x +y^2)dx + 2xy\,dy =0$, $y(\pi )=1$

The problem is, I can't deal well with the existence of two functions, $x$ and $y$. My textbook offers no methodology for solving IVPs for two variables, and frankly I'm stuck.
I know I'm supposed to use the general form, $y=y_h + y_p$ for which I've worked out types, but do I need to compute separately for $x$ and $y$?

Any help would be greatly appreciated.

2

There are 2 best solutions below

2
On BEST ANSWER

Note that $$(x\cos x)' = \cos x -x\sin x,$$ we can imagine the original equation in the form $$\dfrac{\partial}{\partial x}(x\cos x + xy^2)dx + \dfrac{\partial}{\partial y}(xy^2)dy=0,$$ or $$\dfrac{\partial}{\partial x}(x\cos x + xy^2)dx + \dfrac{\partial}{\partial y}(x\cos x + xy^2)dy=0,$$ $$d(x\cos x + xy^2)=0.$$ So $$x\cos x + xy^2 = C.$$ Using condition $y(\pi)=1,$ we get $$C=\pi\cos\pi+\pi\cdot 1^2 = 0,$$ $$x(y^2+\cos x)=0,$$ $$ \genfrac{[}{}{0}{}{x=0}{y^2=\cos x.} $$

0
On

This is exact differential equation. Let $M(x,y)=\cos x - x\sin x +y^2$ and $N(x,y)=2xy$, clearly, $M_y=2y=N_x$, so that we seek a solution $\phi (x,y)$, such that $\phi_y= 2xy$. Integrating both sides w.r. to $y$ we get $\phi(x,y)= xy^2+h(x)$ but since $N(x,y)=\cos x - x\sin x +y^2=\phi_x=y^2+h'(x)$, then $h'(x)=\cos x - x\sin x$. Integrating both sides w.r. to $x$ we get $\sin x +x\cos x+ \sin x +C$. Thus
$$\phi(x,y)= xy^2+\sin x +x\cos x+\sin x+C$$