Determining an analytic function from given conditions Determine the analytic function $f(z)= u+iv $, if $u - v = {{\cos x + \sin x - {e^{ - y}}} \over {2(\cos x - \cosh y)}}$ and $f({\pi}/{2}) = 0$.
By observation we find $u = {{\cos x + \sin x -1} \over {2(\cos x - \cosh y)}}$ and $v ={{-1 + {e^{ - y}}} \over {2(\cos x - \cosh y)}}$ satisfying the given conditions and the function is given as $f(z)= u+iv $. 
Is this answer correct or not? Moreover, what is the systematic way to find the solution for this problem.
 A: $\require{cancel}$
As I mentioned in the comments, given that $f(z)$ is analytic, then the Cauchy-Riemann equations hold, in other words,
$$\begin{cases}
u_x=v_y\\
u_y=-v_x
\end{cases}$$
are true.

Hint:
Let
$$g(x,y)=\frac{\cos x + \sin x - {e^{ - y}}}{2(\cos x - \cosh y)}$$
for simplicity purposes. 
Then
$$u-v=g(x,y)$$
and by differentiating with respect to $x$ and $y$, you obtain
$$\begin{cases}
u_x-v_x=\frac{\partial g(x,y)}{\partial x}\\
u_y-v_y=\frac{\partial g(x,y)}{\partial y}.
\end{cases}$$
Now, using the C-R differential equations, you have
$$\begin{cases}
u_x+u_y=\frac{\partial g(x,y)}{\partial x}\\
u_y-u_x=\frac{\partial g(x,y)}{\partial y}
\end{cases}$$
and adding the two, leads to
$$u_y=\frac12\left(\frac{\partial g(x,y)}{\partial x}+\frac{\partial g(x,y)}{\partial y}\right)\implies u=\frac12\int\left(\frac{\partial g(x,y)}{\partial x}+\frac{\partial g(x,y)}{\partial y}\right)dy+D(x)$$
Similarly,
$$v_x=-\frac12\left(\frac{\partial g(x,y)}{\partial x}+\frac{\partial g(x,y)}{\partial y}\right)\implies v=-\frac12\int\left(\frac{\partial g(x,y)}{\partial x}+\frac{\partial g(x,y)}{\partial y}\right)dx+E(y)$$
After some integration, you obtain 
$$u=-\frac{e^y \sin (x)}{-2 e^y \cos (x)+e^{2 y}+1}+D(x)+C_1\\
v=-\frac{e^{-y} \left(e^{2 y}-1\right)}{4 (\cos (x)-\cosh (y))}+E(y)+C_2$$

I'll add the rest of the answer. Since the Cauchy-Riemann equations hold, we have that 
$$u_x=v_y\implies \cancel{\frac{1-\cos (x) \cosh (y)}{2 (\cos (x)-\cosh (y))^2}}+D'(x)=\cancel{\frac{1-\cos (x) \cosh (y)}{2 (\cos (x)-\cosh (y))^2}}+E'(y)\\
\implies D'(x)=E'(y)=\text{Constant } F$$
thus
$$u=-\frac{e^y \sin (x)}{-2 e^y \cos (x)+e^{2 y}+1}+Fx+C_1\\
v=-\frac{e^{-y} \left(e^{2 y}-1\right)}{4 (\cos (x)-\cosh (y))}+Fy+C_2$$
and using the fact that $f(\frac\pi2+i0)=0$ leads to $C_2=0$ and $C_1=\frac{1}{2} (1-\pi  F)$, and since $u-v=g(x,y)$ needs to hold, then $F=0$.
Finally your components are 
$$\boxed{u=-\frac{e^y \sin (x)}{-2 e^y \cos (x)+e^{2 y}+1}+\frac12\\
v=-\frac{e^{-y} \left(e^{2 y}-1\right)}{4 (\cos (x)-\cosh (y))}}$$

Addendum
Here is a check, using a CAS, that the components found satisfy all the conditions of the problem statement:

