# Extract coefficients from trigonometric polynomial [closed]

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]]] – Hubble07 Nov 7 '15 at 9:23
• @Hubble07 answer? – Yves Klett Nov 21 '15 at 11:04
• 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. – Michael E2 Nov 21 '15 at 17:37

 Coefficient[f[r, ϕ], Cos[ϕ]]