I am new to MMA and have a basic question. I am trying to separate the derivatives of an expression for simplification. E.g. on doing

D[OverBar[u][x, y, z, t], x] + a*D[OverBar[u][x, y, z, t], {x, 2}]


$a \bar{u}^{(2,0,0,0)}(x,y,z,t)+\bar{u}^{(1,0,0,0)}(x,y,z,t)$

And when I do

D[OverBar[u][x, y, z, t] + a*D[OverBar[u][x, y, z, t], x], x]

it again outputs the same - i.e. it combines the two separate instances of D.

$a \bar{u}^{(2,0,0,0)}(x,y,z,t)+\bar{u}^{(1,0,0,0)}(x,y,z,t)$

I would like to prevent that since in my work I can replace OverBar[u][x, y, z, t] + a*D[OverBar[u][x, y, z, t], x] with say A and simplify to D[A, x].

What function would be used for that? Expand?

The goal is ----

when I have an expression in the form of

$a \bar{u}^{(2,0,0,0)}(x,y,z,t)+\bar{u}^{(1,0,0,0)}(x,y,z,t)$

Can I separate the derivatives? Say using Collect or some MMA function? that would give me an output of the form

$D[a \bar{u}^{(1,0,0,0)}(x,y,z,t)+\bar{u}(x,y,z,t),x]$

because by assuming $A = a \bar{u}^{(1,0,0,0)}(x,y,z,t)+\bar{u}(x,y,z,t)$

I can get simplified expression as D[A,x]


  • 1
    $\begingroup$ Welcome to Mma.SE. Start by taking the tour now and learning about asking and what's on-topic. Always edit if improvable, show due diligence, give brief context, include minimal working example of code and data in formatted form. By doing all this you help us to help you and likely you will inspire great answers. The site depends on participation, as you receive give back: vote and answer questions, keep the site useful, be kind, correct mistakes and share what you have learned. $\endgroup$ – rhermans Jul 29 '18 at 18:04
  • $\begingroup$ Thanks, I will check out the tour and how to write in formatted form. $\endgroup$ – DuaneAllman Jul 29 '18 at 18:15
  • 1
    $\begingroup$ Thanks for the tip. I don't have blank in my inputs, it came up when I copied the output from MMA to posting the question. But I will get rid of OverBar in my future codes. Here the issue is not that though, I just tried running without OverBar and I still run into same issue. $\endgroup$ – DuaneAllman Jul 29 '18 at 18:27
  • $\begingroup$ I do not understand what you are trying to accomplish. The title of your question, for instance, is "Collect/Expand with D", but you are using neither Collect nor Expand in your code. And, what is it specifically that you wish to prevent? $\endgroup$ – bbgodfrey Jul 29 '18 at 20:10
  • $\begingroup$ What I'm trying to accomplish is in the last 5 lines of my question (also written in the 2nd line) which can be said as the part 2. I added part 1 (first 8-10 lines) since it was related to my problem. I do not have to use Collect or Expand if there is a better function in MMA. I am new to MMA so based on what I learnt, I thought Collect or Expand might be used. $\endgroup$ – DuaneAllman Jul 29 '18 at 20:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.