ODE: $ \biggl( e^x + \frac{A\sin x}{y} \biggl) dx + \biggl(\frac{B\cos x}{y^2} + (B-1)e^x \biggl)dy =0$ Question says equation is exact, find A and B.
$$ \biggl( e^x + \frac{A\sin x}{y} \biggl) dx + \biggl(\frac{B\cos x}{y^2} + (B-1)e^x \biggl)dy =0$$
$$\frac{\partial M(x,y)}{\partial y} = \frac{\partial N(x,y)}{\partial x} $$
$$-\frac{A\sin x}{y^2} = \frac{-B\sin x}{y^2}+(B-1)e^x $$
$$-A = -B+(B-1)e^x $$
if I give $B=1$ equation becomes $A = B$, where I do wrong calculation ?

At your last step, it should be
$$\frac{(B-A)\sin(x)}{y^2} =(B-1)e^x$$
which holds when
$$\begin{cases}
B-A=0\\ B-1=0
\end{cases}$$
and therefore $B=1$ and $A=B=1$. Then
$$dF=\biggl( e^x + \frac{\sin(x)}{y} \biggl) dx + \biggl(\frac{\cos(x)}{y^2} \biggl)dy$$
where $F(x,y)=e^x-\frac{\cos(x)}{y}$.
