I have a complicated formula which is a sum of several terms. Any given term will be a product of factors: $a_1(x)\times a_2(x)\times a_3(x)\times \ldots$, in which for simplicity I have shown that each factor is a function of only one variable $x$. I want to make the convention that if, for some $x=x_0$, even one factor $a_i(x_0)=0$, the whole term becomes zero, irrespective of the value of the other factors in the term (some of which may evaluate to infinity at $x=x_0$).
How do I do that in Mathematica in a general way? For example, one of the terms in my long formula looks like this:
(t + s - 1) (t + s)LegendreQ[s-1, t-1, x]LegendreP[s-1, t-1, n]
(t + s - 1)=0 but
LegendreQ evaluates to
ComplexInfinity, and so the whole expression evaluates to
Indeterminate, but I want the expression to evaluate to
0. Of course above is only a sample, and if possible I would like something general enough that can deal with arbitrary expressions.