Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
Suppose I have:
f[r_, ϕ_] = C1 Cos[ϕ]r + C3 Sin[3 ϕ] r + C4 Sin[4 ϕ] r^4;
How do I extract the coefficient of a chosen trigonometric term, let's say Cos[ϕ]?
Coefficient[f[r, \[Phi]], Cos[\[Phi]]]
Coefficient[TrigExpand@f[r, ϕ], Cos[ϕ]]
Try the following:
Coefficient[f[r, ϕ], Cos[ϕ]]