The exercise is as follows:
Harmonic function u is $\displaystyle u(x,y) = e^{2x} \sin(ay) + xy + x$ where a > 0 and z = x + iy in C. Find an analytic function f where f = u + v.

In the solution it is stated that $\displaystyle a = 2$ since u and v are harmonic. I don't know how do deduce this.

2. Did you try setting up a system of partial differential equations?

From the Cauchy-Riemann equations, $\displaystyle u_x=v_y$ and $\displaystyle u_y=-v_x$. We have $\displaystyle v_y=1+y+2 e^{2 x} \text{Sin}[a y]$ and $\displaystyle v_x=-x-a e^{2 x} \text{Cos}[a y]$. Try integrating and see what you get.

3. Well , yep I did. But in the solution a is stated right from start. I thought it was determent in some other fashion.

4. You actually have to determine $\displaystyle a$ after you take your integrals. You will get a form that forces $\displaystyle a=2$ in order for the solution to the system to exist.