Welcome to Cadabra Q&A, where you can ask questions and receive answers from other members of the community.
0 votes

I want to implement the following integration by parts

\nabla{#}::Derivative.
{A,B,C}::Depends(\nabla{#}).
tr{#}::Trace.
ex:=\int{\tr{A}\tr{B\nabla{C}}};
integrate_by_parts(_,$C$);

I have a try

substitute(_,$\tr{A??}\tr{B?? \nabla{C??}}->-\tr{\nabla{A??}}\tr{B?? C??}-\tr{A??}\tr{\nabla{B??} C??}$);

Is there is any simpler way to implement it?

in General questions by (2.2k points)

For now you will have to do this 'by hand' like you did with the substitute. Once you allow for derivative operators to be taken out of traces like this, there are potentially many edge cases which you have to be aware of, and integrate_by_parts therefore does not do this.

If I substitute 'tr' into '\int', for example,

\nabla{#}::Derivative.
{A,B,C}::Depends(\nabla{#}).
tr{#}::Trace.
ex:=tr{A} tr{B\nabla{C}};
substitute(_,$tr{A??}->\int{A??}$);

Is there possible to find a more direct solution of this question? As you know, sometimes it is very tedious to do this all "by hand" with the substitute, because the actual situation may be very complicated.

Please log in or register to answer this question.

...