I am trying to find the coefficients for the Fourier-Legendre expansion of a potential. My goal was to obtain the coefficients as expressions in terms of x and y. I followed the example given on the website. However, when I ask mathematica to compute the integral, mathematica does not seem to be able to actually calculate the integral and just outputs this. It doesn't give me the coefficients, but just lists the various Legendre functions. What am I doing wrong? Thank you.
Potential Expansion
V[\[Gamma]_] :=
1/Sqrt[x^2/4 + y^2 + x y \[Gamma]] - (3/4) Sqrt[
x^2/4 + y^2 + x y \[Gamma]]
$Assumptions = x \[Element] Reals
x \[Element] Reals
$Assumptions = y \[Element] Reals
y \[Element] Reals
$Assumptions = \[Gamma] \[Element] Reals
\[Gamma] \[Element] Reals
$Assumptions = -1 <= \[Gamma] <= 1
-1 <= \[Gamma] <= 1
$Assumptions = x^2/4 + y^2 > x y \[Gamma]
x^2/4 + y^2 > x y \[Gamma]
FourierLegC[V_, \[Gamma]_, n_] := (1/(2*Pi))*Integrate[LegendreP[n, \[Gamma]]*V[\[Gamma]], {\[Gamma], -1, 1}]
FourierLegC[V[\[Gamma]], \[Gamma], n]
\!\(
\*SubsuperscriptBox[\(\[Integral]\), \(-1\), \(1\)]\(\(LegendreP[
n, \[Gamma]]\ \((
\*FractionBox[\(1\),
SqrtBox[\(
\*FractionBox[
SuperscriptBox[\(x\), \(2\)], \(4\)] +
\*SuperscriptBox[\(y\), \(2\)] + x\ y\ \[Gamma]\)]] -
\*FractionBox[\(3\), \(4\)]\
\*SqrtBox[\(
\*FractionBox[
SuperscriptBox[\(x\), \(2\)], \(4\)] +
\*SuperscriptBox[\(y\), \(2\)] +
x\ y\ \[Gamma]\)])\)[\[Gamma]]\) \
\[DifferentialD]\[Gamma]\)\)/(2 \[Pi])
Factor[Table[FourierLegC[V[\[Gamma]], \[Gamma], n], {n, 0, 4}]]