# Evaluating a scalar product of a vector and a differential operator vector

I created a scalar product of a vector $$\in \mathbb{R}^2$$ and of a vector consisting of a differential operators

op[t_] = (D[#, {t, 2}] - 3 D[#, t] + 2 #) &;   (1)
delop = {op[t], op[z]}; X = {1, -2};


I would like to apply this scalar product to a function and tried the following (not working solutions)

(X.delop)@Sin[t+z]    (2)
(X.delop) Sin[t+z]


((D[#1, {t, 2}] - 3 D[#1, t] + 2 #1 & ) - 2 (D[#1, {z, 2}] - 3 D[#1, z] + 2 #1 & ))[Sin[t + z]]
((D[#1, {t, 2}] - 3 D[#1, t] + 2 #1 & ) - 2 (D[#1, {z, 2}] - 3 D[#1, z] + 2 #1 & )) Sin[t + z]


How can I evaluate those expressions or directly obtain an evaluated expression in formula (2)?

I would define "delop" as a function and do the scalar product after applying the function:

Clear["Globals*"]
op[t_] = (D[#, {t, 2}] - 3 D[#, t] + 2 #) &;
delop[t_, z_] = {op[t][#], op[z][#]} &;
X = {1, -2};
X.(delop[t, z]@Sin[t + z])

(* -3 Cos[t + z] + Sin[t + z] - 2 (-3 Cos[t + z] + Sin[t + z]) *)


Note, the brackets are not necessary, due to preferences. I put them in to make the preference clear.

• I get the error Set::write: Tag List in delop[t_, z_].... is Protected.. May 14, 2021 at 8:32
• I think you already have somehow defined "delop" . I added "Clear["Globals*"]" to prevent this. Or try a new kernel. May 14, 2021 at 8:38
• Ok, that seems to be a great solution as long as I have X.(delop[t, z]@Sin[t + z])and not delop[t, z].X@Sin[t + z]. Do you have a solution for the second scalar product as well to allow full flexibility in coding? May 14, 2021 at 8:51
• @Uwe.Schneider what you attempt in the second case is not proper syntax, which is why it does not work. It isn’t clear why you want to do that, or what you want to get. I suggest editing your question with such an alternative request, what the ideal outcome or intended goal is, and not what occurs when you try that syntax. May 15, 2021 at 16:00