I believe there is a mistake in that formula. By combining those two mentioned formulas in Franklin's book, I got
U=(3QQ'/4r^5)[35(k.r)^2(k'.r)^2-20(k'.r)(k.r)(k.k')-5(k.r)^2-5(k'.r)^2+2(k.k')^2+1]
which differs a bit. I checked it on two parallel and two crossed model linear quadrupoles...