Obtain the first three terms in the expansion of function in terms of legendre polynomial F(x) in a series of the form $$ F(x) = \sum_{k=0}^{\infty} A_k P_k(x) $$ where $$F(x)=\{\cos(x) \text{ for } 0 \le x \le \pi/2 \ $$$$0 \text{ for } \frac{\pi}{2} \le x \le \pi.\} $$
What I know is I have to use legendre's expansion formula i.e,$F(x) =\sum A_kP_k(x)$ where $-1≤x≤1$ But obviously I cannot use it directly because the range of $x$ differs. I have tried substituting $x=\cos(\theta)$ but no success so far.
