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.
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.} $$