I'm currently using the textbook Advanced Engineering Mathematics 10e (Kreyszig, 2019) and had a question regarding one of the example problems for exact ordinary differential equations.
Here's the question:
Solve the initial value problem:
$$(\cos{y}\sinh{x} + 1)dx - \sin{y}\cosh{x}dy = 0$$
$$y(1) = 2$$
I followed the textbook approach by following the steps provided for solving exact ODE's, but am getting a different result and one part of the solution is confusing me.
My approach
$$ \begin{align} M(x, y) & = \cos(y)\sinh(x) + 1 \\ N(x, y) & = \sin(y)\cosh(x) \end{align} $$
$$\partial M / \partial y = \partial N / \partial x$$
$$ \begin{align} u & = \int (\cos(y)\sinh(x) + 1 )dx + k(y) \\ & = \cos(y)\cosh(x) + k(y) \\ \frac{\partial u}{\partial y} & = -\sin(y)\cosh(x) + k'(y) \\ & = N(x, y) \end{align} $$
After solving the last part, it can be shown that $k'(y) = 0$ and so I wrote $k(y) = C$. However, the solution states that $k(y) = x + C$. I understand that this also makes sense, but how should I know when to put the $x$ there and when not?