TransWikia.com

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

Mathematica Asked by Uwe.Schneider on June 25, 2021

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]

leading to

((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)?

One Answer

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.

Answered by Daniel Huber on June 25, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP