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.