Concept:
This is a differential equation of the form:
\[
M(x,y)\,dx + N(x,y)\,dy = 0
\]
We check if it is exact:
\[
\frac{\partial M}{\partial y} = \frac{\partial N}{\partial x}
\]
Step 1: Identify $M$ and $N$.
\[
M = (e^y + 1)\cos x, \quad N = e^y \sin x
\]
Step 2: Check exactness.
\[
\frac{\partial M}{\partial y} = e^y \cos x
\]
\[
\frac{\partial N}{\partial x} = e^y \cos x
\]
Since both are equal, the equation is exact.
Step 3: Find the potential function $\psi(x,y)$.
Integrate $M$ with respect to $x$:
\[
\psi = \int (e^y + 1)\cos x \, dx
= (e^y + 1)\sin x + h(y)
\]
Step 4: Differentiate $\psi$ w.r.t $y$ and compare with $N$.
\[
\frac{\partial \psi}{\partial y} = e^y \sin x + h'(y)
\]
Equate with $N = e^y \sin x$:
\[
h'(y) = 0 \Rightarrow h(y) = \text{constant}
\]
Step 5: Write the final solution.
\[
(e^y + 1)\sin x = C
\]