# Commutators of differential and integral operators

**URL:** <https://community.wolfram.com/t/commutators-of-differential-and-integral-operators/22330>\
**Category:** Questions\
**Tags:** calculus\
**Created:** [July 6, 2023, 11:48am UTC](https://community.wolfram.com/t/commutators-of-differential-and-integral-operators/22330 "2023-07-06T11:48:29Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![billlionheart](https://avatars.discourse-cdn.com/v4/letter/b/e56c9b/32.png) [@billlionheart](https://community.wolfram.com/u/billlionheart)\
**Post date:** [July 6, 2023, 11:48am UTC](https://community.wolfram.com/t/commutators-of-differential-and-integral-operators/22330/1 "2023-07-06T11:48:29Z")

</div>

I would like to be able to explore if certain variable coefficient differential operator commute with integral operators.

As a toy example Grünbaum  
(Grünbaum, F. Alberto. “A remark on Hilbert’s matrix.” Linear Algebra and its Applications 43 (1982): 119-124.)  
mentions that on L^2[0.1] the integral operator K with kernel 1/(x+y) commutes with the differential operator P where Pu (t) = ((1-t^2)t^2 u’)’ -2 t^2 u

I wanted to make a pure function for the operators for example

```
K = Function[f, Function[t, Integrate[f[s]/(t + s), {s, 0, 1}]]]

```

and similarly P and then to be able to evaluate the commutator with something like

K@\*P - P@\*K

By hand it is fairly easy and uses integration by parts, but obviously I want to do much more complicated cases! The difficulties I have are that Mathematica will not simplify the composition of operators, unless applied to a function, and then only a specific function. And it does not understand subtraction of operators.  
Am I going about this the wrong way? Is it something Mathematica can do.

So far I verified in on a Fourier basis in L^2 with Mathematica, it generates two pages of output but FullSimplify gets it to zero.

---

<div class="post-metadata">

**Author:** ![gianlucagorni](https://avatars.discourse-cdn.com/v4/letter/g/ec9cab/32.png) [@gianlucagorni](https://community.wolfram.com/u/gianlucagorni)\
**Post date:** [July 6, 2023, 2:24pm UTC](https://community.wolfram.com/t/commutators-of-differential-and-integral-operators/22330/2 "2023-07-06T14:24:50Z")

</div>

Mathematica does not do this kind of calculations automatically, but we can mimic what we would do by hand.

```
opK = Function[f, Function[t, Integrate[f[s]/(t + s), {s, 0, 1}]]];
opP = Function[u, 
   Function[t, D[((1 - t^2) t^2 u'[t]), t] - 2 t^2 u[t]]];
commutator = Simplify[opK[opP[f]][t] - opP[opK[f]][t]]

```

We can introduce some rules to bring the commutator into a desired form:

```
integralDistribute = 
  Integrate[func_, extrema_] /; Head[Expand[func]] == Plus :> 
   Map[Integrate[#, extrema] &, Expand[func]];
integralByParts[func_] = 
  Integrate[
    smthg_*Derivative[1][func][s], {s, a_, 
     b_}] :> (smthg func[s] /. s -> b) - (smthg func[s] /. s -> a) - 
    Integrate[func[s] Together[D[smthg, s]], {s, a, b}];
bringFactorsInside = 
  HoldPattern[fact_*Integrate[func_, extrema_]] :> 
   Integrate[fact*func, extrema];
integralCollect = 
  Integrate[func1_, extrema_] + Integrate[func2_, extrema_] :> 
   Integrate[func1 + func2, extrema];

```

Finally:

```
commutator /. integralDistribute /. integralByParts[f] /. 
      integralByParts[f'] /. integralByParts[f] /. 
    integralDistribute /. bringFactorsInside //. 
  integralCollect // Simplify

```

---

<div class="post-metadata">

**Author:** ![billlionheart](https://avatars.discourse-cdn.com/v4/letter/b/e56c9b/32.png) [@billlionheart](https://community.wolfram.com/u/billlionheart)\
**Post date:** [July 6, 2023, 5:29pm UTC](https://community.wolfram.com/t/commutators-of-differential-and-integral-operators/22330/3 "2023-07-06T17:29:09Z")

</div>

Wow Thank you Gianluca so much. And equals zero!

Can I just check the extrema takes the range of integration from opK, has it made any assumption about t to avoid t+s==0? I had to put lots of “Assuming” to simplify explicit cases.

---

<div class="post-metadata">

**Author:** ![gianlucagorni](https://avatars.discourse-cdn.com/v4/letter/g/ec9cab/32.png) [@gianlucagorni](https://community.wolfram.com/u/gianlucagorni)\
**Post date:** [July 6, 2023, 5:53pm UTC](https://community.wolfram.com/t/commutators-of-differential-and-integral-operators/22330/4 "2023-07-06T17:53:15Z")

</div>

It seems that with generic symbolic functions no convergence check is attempted.

---

<div class="post-metadata">

**Author:** ![billlionheart](https://avatars.discourse-cdn.com/v4/letter/b/e56c9b/32.png) [@billlionheart](https://community.wolfram.com/u/billlionheart)\
**Post date:** [July 3, 2026, 10:09am UTC](https://community.wolfram.com/t/commutators-of-differential-and-integral-operators/22330/5 "2026-07-03T10:09:24Z")

</div>

I would just like to thank Gianluca Gorni again as I have come back to these commutator problems.

As an example of a recent success,

```
opK = Function[f, Function[t, Integrate[f[s]/(1 - t s), {s, 0, 1}]]];
opP = Function[u, Function[t, D[t (1 - t)^2 u'[t], t] + t u[t]]];

commutator = Simplify[opK[opP[f]][t] - opP[opK[f]][t]];
SimplifyByParts[commutator]

```

gives zero. The calculation is quite long by hand. The problem is related to Hilbert matrices, finite hilbert transforms on adjacent intervals , moment problems, and the linearized Calderon problem on the disk
