The expression (x + iy)^n can also be expressed as (x + iy)^n/2 * (x + iy)^n/2. We can observe that we can split the problem in half into two identical subproblems. This suggests that divide and conquer can be used to accelerate the calculation.
Each time we divide the problem we can see that the exponent halves. The problem only needs to be divided down to n = 1, which would be the base case. The number of divisions required to breakdown the problem to the base case would increase by one for every time n doubled. This can be recognised as logarithmic growth.
Earlier we identified that each division would contain duplicate subproblems. In order to conquer each division we can multiply the one of the subsolutions by itself rather than recursing and recalculating the subproblem. This eliminates the need to recurse a second time.
The recurrence relation is as follows:
T(n) = T(n/2) + 1
We can solve the recurrence relation to be T(n) = O(log(n))
Therefore, by using divide and conquer the problem of solving (x+iy)^n can be solved efficiently in log(n) time.