What is the probability f(p) of A winning the match? 
Here's my approach:
Let A denote the event "A wins the game" and B denote the event "B wins the game"
I am supposed to calculate the probability f(p)
There are two possible cases:-
i) A wins within 4 games
Possible cases: AAA,ABAA,BAAA,AABA
ii) A doesn't win within 4 games
Possible cases: AABB(A and B occur 2 times each) ABABABAB...(A and B occur k times each) AA
AABB can be arranged in 6 ways
ABABAB.... can be arranged in $(2!)^k$ ways (A and B are adjacent to one another)
Now :
f(p) = P(case i) + P(case ii)
P(case ii) = $(6 (p^2) (1-p)^2 ) \sum_{k=1}^∞  2^k . p^k . (1-p)^k. p^2  $=$(6 (p^4) (1-p)^2 ) \sum_{k=1}^∞  2^k . p^k . (1-p)^k$
= $(6. 2 . p^5 . (1-p)^3)/(1-2p+2p^2)$ (The denominator seems correct)
P(case i ) = $p^3 +3p^3(1-p)$
f(p) = $p^3 +3p^3(1-p) + \frac{(6. 2 . p^5 . (1-p)^3)}{(1-2p+2p^2)}$
The expected answer is not produced by solving the above equation.Where did I go wrong?
Edit:-
I finally figured out the mistake that I made in the above solution.
In P(case ii) = $(6 (p^4) (1-p)^2 ) \sum_{k=1}^∞  2^k . p^k . (1-p)^k $, I replaced $\sum_{k=1}^∞$ with $\sum_{k=0}^∞$ . There has to be one case when B does not occur after the tie, i.e. A occurs only two times.
P(case ii) =  $(6 (p^4) (1-p)^2 ) \sum_{k=0}^∞  2^k . p^k . (1-p)^k $
=  $(6 (p^4) (1-p)^2 ) .[1+2p(1-p)^1+2^2.p^2.(1-p)^2+...]$
=$(6 (p^4) (1-p)^2 ) .\frac{1}{1-2p(1-p)}$
f(p) = P(case i) + P(case ii)
=$p^3 +3p^3(1-p)+(6 (p^4) (1-p)^2 ) .\frac{1}{1-2p(1-p)}$
=$p^3[1+3(1-p)+\frac{6p(1-p)^2}{1-2p(1-p)}]$
=$p^3[1+(3-3p)+\frac{6p-12p^2+6p^3}{1-2p+2p^2)}]$
=$p^3[\frac{(1-2p+2p^2)+(3-6p+6p^2-3p+6p^2-6p^3)+(6p-12p^2+6p^3)}{1-2p+2p^2)}]$
=$p^3\frac{(4-5p+2p^2)}{1-2p+2p^2}$

$A$ can win in three games with $3-0$ or $3-1$, else they must reach $2-2$ and then has to win by a difference of $2$

*

*To win directly, $A$ wins with $p^3 + \binom31 p^3(1-p) = 4p^3 -3p^4$


*To reach $2-2, Pr = \binom42p^2(1-p)^2$


*Let $P(A$ ultimately wins from $2-2$) be $d$
Then either A wins in straight two points or is back to equal scores, thus eqivalent to $2-2$, so $d = p^2 + 2p(1-p)d$ which gives $d = \frac{p^2}{2p^2-2p+1}$


*Putting the pieces together, $$P(A\; wins) = p^3+3p^3(1-p) + [6p^2(1-p)^2] \times \frac{p^2}{2p^2-2p+1}$$
Added
On giving it to Wolfram the answer I get is
$$P(A\; wins) = \frac{p^3(2p^2-5p+4)}{2p^2-2p+1}$$
which tallies with the book answer
