For an analytic function $f(z)=u+iv$, if $u=e^x(x \cos y-y \sin x)$ find $v$. For an analytic function $f(z)=u+iv$, if $u=e^x(x \cos y-y \sin x)$ find $v$.
How to solve it? I have used CR equation but have failed to get desired result.
Please help.
 A: Hint: Use the fact that $e^{z}=e^{x+iy}=e^xe^{iy}=e^x(\cos(y)+i\sin(y))$ and $z=x+iy$. Then construct a function $f(z)$ such that $\Re{f(z)}=u(x,y)$. The harmonic conjugate is then the imaginary part...
Edit: Think of ways you can construct such an $f(z)$. Try multiplying $e^z$ by another function such that its real part is what you have. It should be clear what you have to multiply by. 
So there is, by the way, a method to calculate the $f(z)$. To get the function into the form $f(z)$, we realize that $f'(z) = \cfrac{\partial u}{\partial x}+i\cfrac{\partial v}{\partial x}= \cfrac{\partial u}{\partial x}-i\cfrac{\partial u}{\partial y}$. Moreover, since we are given $u(x,y)$, we can write $f'(z)$ as a function of $x,y$.
This amounts to integrating to get $f(z) = \int_{z=x,y=0} f'(z)dz$, where the $f'(z)$ is obtained by the formula I gave with the partial derivatives. Note that the integrand is evaluated along $z=x$ and $y=0$.
Example: Let $u(x,y)=x^2-y^2$ so we find an analytic $f(z)$ such that $\Re{f(z)}=u(x,y)$. Differentiating, we get $u_x=2x$ and $u_y=-2y$. Thus, by the formula, $f'(z)=2x-i(-2y)=2(x+iy)$. Thus, using the integration trick, we'd get:
$f(z) = \int_{z=x,y=0} 2(x+iy)dz= \int 2z dz=z^2+C$
