# Simplifications and error in matrix integral operator

I defined the matrix integral operator

\[ScriptCapitalD]11[w_] := (1/2)*D[w[x], x] -
r[x]*Integrate[q[x]*w[x], x]
\[ScriptCapitalD]12[w_] := r[x]*Integrate[r[x]*w[x], x]
\[ScriptCapitalD]21[w_] := (-q[x])*Integrate[q[x]*w[x], x]
\[ScriptCapitalD]22[w_] := (-2^(-1))*D[w[x], x] +
q[x]*Integrate[r[x]*w[x], x]
m = {{\[ScriptCapitalD]11, \[ScriptCapitalD]12}, {\[ScriptCapitalD]21, \[ScriptCapitalD]22}};


and defined how it acts in a column vector

operate[matrix_, column_] :=
Table[Inner[#1[#2] & , \[Mu], column, Plus],
{\[Mu], matrix}]


Code result is

result = operate[m, {r[x], q[x]}];
MatrixForm[FullSimplify[result]]


How can I further simplify the vanishing integrals? (see image below). What I am doing wrong that I obtain the correct result up to a factor of $$2$$?

• Note how you get nonsense things like q[x][x] in your integrals. Try operate[m, {r, q}] instead. Commented Oct 13, 2020 at 17:44
• That solution worked, but don't know why. Sorry the trivial question, but what if, instead of your suggestion, I put an explicit function to operate? Commented Oct 13, 2020 at 17:50
• I'm not sure I understand your question. r is a function. r[x] is not a function, but a function called with an argument. If you want to be super explicit about calling operate with functions, you could use operate[m, {Function[x, r[x]], Function[x, q[x]]}]. Commented Oct 13, 2020 at 18:03