()
| 174 | function isFactorHead(list: MathJsonExpression, name: string): boolean { |
| 175 | return getSequence(list)?.length === 1 && mentionsName(list, name); |
| 176 | } |
| 177 | |
| 178 | /** The binders that the parser makes, and that bind the names after their |
| 179 | * first operand: the index of `Sum` and `Product`, the variable of |
| 180 | * `Integrate`, the parameters of `Function` (which also holds the variable |
| 181 | * of `Limit`). In the body of `\sum_{k=1}^{2}`, a joined name `x_k` that one |
| 182 | * of these binds stays one name. |
| 183 | * |
| 184 | * `D` is not in the list: its variable is free in its value, so `x_k` there |
| 185 | * is `Subscript(x, k)` and follows the index. Each term of |
| 186 | * `\sum_{k=1}^{2}\frac{\partial}{\partial x_k} x_k^2` differentiates with |
| 187 | * respect to its own variable, and the sum is `2x_1 + 2x_2` |
no test coverage detected