Let $R$ be the annulus $1/4\leq x^2+y^2\leq 4$ and $u$ satisfy the boundary conditions $u\left(r=2,\theta\right) = \cos3\theta$ and $u\left(r=1/2,\theta\right) = 1$. Find a suitable analytic function in $R$ and deduce the solution for $u$. Note: I can't use separation of variables.
As I understand, determining a complex function $f\left(z\right)$ such that $u\equiv\mathfrak{R}\left[f\left(z\right)\right]$ satisfies Laplace's equation should suffice for this problem. My way of going about it is that $f$ should have two "parts", each corresponding to a specific boundary condition. In particular, for the B.C. at $r=2$, we must have something involving powers of $z$ (so that a $\theta$ dependence is introduced). Meanwhile, for the B.C. at $r=1/2$, we should have something like $C\log z+ D$ so that a $\theta$ dependence is eliminated. So, the overall function should come out (in a general form) to be
\begin{equation} f\left(z\right) = Az^n + \dfrac{B}{z^n}+ C\log z+D. \end{equation}
In fact, if we take the real part of $f$ and compare to the boundary conditions, we can obtain
\begin{equation} u\left(r,\theta\right) \equiv \mathfrak{R}\left[f\right] = \left(\dfrac{512}{4095}r^3 - \dfrac{8}{4095r^3}\right)\cos 3\theta - \dfrac{\ln r}{2\ln 2} +\dfrac{1}{2}. \end{equation}
which is actually harmonic (i.e. satisfies $\Delta u=0$) across the annulus given (and everywhere else except at $z=0$ where the logarithm is undefined anyways). Note, however, that $f$ is NOT analytic on $R$ because $\log z$ is discontinuous across the negative real line (or however else we construct our branch cut). How does one resolve this?