# Verify that a PDE is satisfied by a matrix consisting of functions satisfying a different PDE

My problem is as follows: I have two matrices $$P$$ and $$Q$$ which are made up of algebraic expressions of a function $$q(x,t)$$ which solves a somewhat complicated pde, and its derivatives, for example, the lower left coordinate of $$P$$ is given by $$z^2+\frac12zq-\frac18q_{xx}+\frac38q^2$$ where $$z$$ is a complex parameter.

All I want to do is verify that $$P$$ and $$Q$$ solve the following PDE,

$$P_x-Q_t+QP-PQ=0$$

Given that $$q$$ satisfies the second PDE.

Any help is greatly appreciated, I have very little experience with mathematica.

• Look up D. For further details, we to see the precise definition of P and Q in copyable Mathematica code. – Henrik Schumacher Apr 28 at 18:10
• @HenrikSchumacher that's fair, I didn't want to just post my problem with the expectation that others do it. Do you have any tips on how to use the "Assume" function to let Mathematica know $q$ solves a differential equation? thank you for your response. I know how to compute with $D$ if that helps – qbert Apr 28 at 18:13
• Hm. You could try to replace D[q,x,x] by minus the rest of the PDE. Then the remaining terms may cancel out. – Henrik Schumacher Apr 28 at 18:16
• @HenrikSchumacher ah, that is a nice idea but unfortunately the pde is 5th order in space and all the terms in $P$ and $Q$ are lower order in space. I can add details – qbert Apr 28 at 18:20
• You're welcome. I hope it works out for you. – Henrik Schumacher Apr 28 at 18:34

## 1 Answer

Turning my comments into an answer.

You could try something along the lines of

Expand[
D[P, x] - D[Q, t] + Q.P - P.Q
/.
{"one term of the PDE for q" -> -"rest of the PDE for q"}
]


where the strings have to be replaced by appropriate expressions.

For that, is is important that the dependencies of q on x and t are explicit, i.e., you have to write

z^2 + 1/2 z q[x,t] - 1/8 D[q[x,t],x,x] +3/8 q[x,t]^2

and so on.