Find Entire Function $f$ such that $f(0)=1$ and $Re(f(x+iy))=x^2-y^2+e^{-x}\cos y$ Find an entire function $f(z)$ such that $f(0)=1$ and for all $z$, $Re(f(z))=x^2-y^2+e^{-x}\cos y$
An entire function is analytic on all $\mathbb{C}$ and in particular differentiable and therefore fulfils C-R equations 
therefore
$u_x=v_y=2x-e^{-x}\cos y$ 
$v=2xy-e^{-x}\sin y+ c(x)$
$-v_x=-2y-e^{-x}\sin y+c'(x)=-2y-e^{-x}\sin y=u_y$
so $-2y-e^{-x}\sin y+c'(x)=-2y-e^{-x}\sin y\Rightarrow c'(x)=0 \Rightarrow c(x)=k $
So we have $v=2xy-e^{-x}\sin y+k$
and $f(z)=(x^2-y^2+e^{-x}\cos y)+i(2xy-e^{-x}\sin y+k)$, but $f(0)=0$ so
$1+ik=0\iff ik=-1 \iff k=i$  
So $f(z)=(x^2-y^2+e^{-x}\cos y)+i(2xy-e^{-x}\sin y+1)$
Is it correct?
 A: If the real part is $u(x,y)$ we have that:
$$f(z)=2u\left(\frac{z}{2}, -\frac{iz}{2}\right)-u(0,0)$$
$$f(z)=2\left(\frac{z^2}{4}-\frac{(iz)^2}{4}+\exp\left(-\frac{z}{2}\right)\cos\left(-\frac{iz}{2}\right)\right)-1$$
$$f(z)=z^2+2\exp\left(-\frac{z}{2}\right)\cosh\left(\frac{z}{2}\right)-1$$
$$f(z)=z^2+\exp(-z)$$
But with this function, $f(0)=1$. Are you sure about $f(0)=0$?
Thanks to Davide Morgante, you can find out more about this way in the second paragraph of this paper or in this question.
A: We know that $\Re(f(z)) = u(x,y)$, to be the real part of an analytic function this has to be harmonic, so: $$\nabla^2 u(x,y) = 0$$ which is easy to prove.
To find a complex part such that $f(z)$ will be analytic we integrate the differential form: $$dv = \frac{\partial v}{\partial x}dx + \frac{\partial v}{\partial y}dy = -\frac{\partial u}{\partial y}dx + \frac{\partial u}{\partial x}dy$$ for the Cauchy-Riemann conditions. To integrate the differential form we choose the spline connecting the points $(0,0)\rightarrow (x,0)\rightarrow (x,y)$, then $$v(x,y)-v(0,0) = \int_{\gamma}-\frac{\partial u}{\partial y}dx + \frac{\partial u}{\partial x}dy\\ 
= -\underset{y'=0}{\int_0^x}\frac{\partial u(x',y')}{\partial y'}dx'+\underset{x'=x}{\int_0^y}\frac{\partial u(x',y')}{\partial x'}dy'\\ 
= \underset{y'=0}{\int_0^x}(2y'+e^{-x'}\sin(y'))dx'+\underset{x'=x}{\int_0^y}(2x'+e^{-x'}\cos(y'))dy' \\ 
= \left.(2x'y'-e^{-x'}\sin(y'))\right|_{0,\;y'=0}^x + \left.(2x'y'-e^{-x'}\sin(y'))\right|_{0, \;x'=x}^y \\
= 0 + 2xy-e^{-x}\sin(y) = 2xy-e^{-x}\sin(y)$$ 
If this is a good answer, we could see if $$\nabla^2v(x,y)=0$$ which is true.
For to be $f(0) = f(0+i0)=1$ we have $v(0,0)=0$ because $u(0,0) = 1$. So in the end $$f(z) = (x^2-y^2+e^{-x}\cos(y))+i(2xy-e^{-x}\sin(y))$$ which can be rewritten knowing that $$(x+iy)^2 = x^2-y^2+2ixy= z^2\;\;\;e^{-x}(\cos(y)-i\sin(y)) = e^{-x}e^{-iy} = e^{-z}$$

$$f(z) = z^2+e^{-z}$$

Edit
I've edited the answer to take count of the correction $f(0)=1$ but if the initial condition was $f(0)=0$ I think that you could cheat using $v(0,0)=i$, this would give you the right answer, but an integral in $\mathbb{R}$ cannot give you a complex result
