Solution (a) Let M=cosy−cosx and N=ey−xsiny. Then ∂M∂y=−sinyand∂N∂x=−siny
Since ∂M∂y=∂N∂x for all x and y, the differential equation is exact over the xy-plane.
(b) Since the differential equation is exact, there is a function z= f(x,y) so that ∂f∂x=M=cosy−cosxand∂f∂y=N=ey−xsiny
We integrate ∂f∂x=M=cosy−cosx partially with respect to x (holding y constant). Then f(x,y)=∫(cosy−cosx)dx=xcosy−sinx+B(y)
where B, which is yet unknown, is a function of y alone. To find B, we differentiate f with respect to y. ∂f∂y=∂∂y[xcosy−sinx+B(y)]=−xsiny−0+∂∂yB(y)=−xsiny+dBdy
Since ∂f∂y=N=ey−xsiny, we have −xsiny+dBdy=ey−xsinydBdy=eyB(y)=ey+C
where C is a constant. Now we substitute B(y) into (3) to obtain the general solution f(x,y)=xcosy−sinx+ey+C=0
To find the particular solution that satisfies the boundary condition y(π)=0, we need to find C so that y=0 when x=π. Then πcos0−sinπ+e0+C=0π+1+C=0C=−(1+π)
The particular solution is xcosy−sinx+ey=π+1.