Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
$\begingroup$If f is meant to be an expression obtained from a computation, then the form of the expression might determine the answer. For example, Coefficient[TrigExpand@f[r, ϕ], Cos[ϕ]]. If this is an issue, FourierCoefficient might be appropriate.$\endgroup$
Coefficient[f[r, \[Phi]], Cos[\[Phi]]]
$\endgroup$f
is meant to be an expression obtained from a computation, then the form of the expression might determine the answer. For example,Coefficient[TrigExpand@f[r, ϕ], Cos[ϕ]]
. If this is an issue,FourierCoefficient
might be appropriate. $\endgroup$