Problems with compiling a lyx document (error is related to limits of sum)

I am having problems compiling a lyx document I created, the problem seem to be with the limits on the summation I made, can someone please tell me how can I fix this problem ?

The problems are in two areas:

The LHS: $(A(t)B(t))_{i,j}=\sum\limits _{k=1}^{n}a_{ik}(t)b_{kj}(t)$,
since each element in the matrices is in $C^{1}(\mathbb{R})$ it holds
that: $\forall k\in[n]:\,(a_{ik}(t)b_{kj}(t))'=a'_{ik}(t)b_{kj}(t)+a_{ik}(t)b'_{kj}(t)$
hence $(A(t)B(t))'_{i,j}=\sum(\limits _{k=1}^{n}a_{ik}(t)b_{kj}(t))'=\sum\limits _{k=1}^{n}(a'_{ik}(t)b_{kj}(t)+a_{ik}(t)b'_{kj}(t))$.


and:

The RHS: $(A'(t)B(t))_{ij}=\sum\limits _{k=1}^{n}a'_{ik}(t)b_{kj}(t),\,(A(t)B'(t))_{ij}=\sum\limits _{k=1}^{n}a{}_{ik}(t)b'_{kj}(t)$
hence $(A'(t)B(t)+A(t)B'(t))_{ij}=(A'(t)B(t))_{ij}+(A(t)B'(t))_{ij}=\sum\limits _{k=1}^{n}a'_{ik}(t)b_{kj}(t)+\sum\limits _{k=1}^{n}a{}_{ik}(t)b'_{kj}(t)=\sum(\limits _{k=1}^{n}a{}_{ik}'(t)b{}_{kj}(t)+a{}_{ik}(t)b'{}_{kj}(t))$.

-

To me it seems more often than not that TeX's error messages are not that useful per se. I often tune out their content and scan the code line with the error in it to see what looks wrong.

But in this case the error message points out the problem exactly:

! Limit controls must follow a math operator.
l.9 hence \$(A(t)B(t))'_{i,j}=\sum(\limits
_{k=1}^{n}a_{ik}(t)b_{kj}(t))'=\su...


You can't put \limits on a ( delimiter; they have to go on a math operator. You probably meant to put them on the \sum. So just delete the ( between \sum and \limits in both snippets.

-
Thanks! this fixed the problem, I wrote '(' in the wrong scope – Belgi Jun 13 '12 at 12:18

I do not get an error with your code. However, this looks wrong:

\sum(\limits_{k=1}^{n}


it should be

\sum\limits_{k=1}^{n}(


or better

\sum\limits_{k=1}^{n}\left( ... \right)

-
I get "! Limit controls must follow a math operator." – Belgi Jun 13 '12 at 12:08
Why do you need \limits at all? It works without it, doesn't it? I see this when I see documents that were written using Scientific Word but never understood the reason for it... – Vivi Jun 13 '12 at 13:11
@Belgi: you have another character or math symbol before \limits – Herbert Jun 13 '12 at 14:04
@Vivi: In display math mode usually \limits is implied, so _ puts things under the operator and ^ puts things over. But in regular (inline) math mode the default is super/subscripts. Try $$\lim_{x\to 0} \frac{\sin x}{x}=1$$ and see what you get. – Matthew Leingang Jun 13 '12 at 19:12
@MatthewLeingang Interesting, I didn't know that. I always use \displaystyle to solve this issue. I think that Scientific Workplace puts \limits even in normal equation environments, though.... – Vivi Jun 13 '12 at 22:52