I have the two functions $u(x)$ and $v(x)$, both of which have known basis expansions $u(x) = \sum_n a_n f_n(x)$, $v(x) = \sum_n b_n f_n(x)$.
I would like to calculate the function
$w(x)=\frac{\sum_n a_n f_n(x)}{\sum_n b_n f_n(x)} = \sum_n c_n f_n(x)$
I know the function $w(x)$ to be singularity-free and well defined, but numerically, things fall apart when $v(x)$ is close to zero (ie. I can't get the coefficients $c_n$ by the usual method of forming inner products and employing orthogonality). Is there a way to expression the coefficients $c_n$ in terms of $a_n$, $b_n$?