1
$\begingroup$

Suppose that an output is

Mathematica graphics

which could be obtained from, for example,

D[f[x, y, z], x] / D[h[x, y, z], x]

I'm looking for a way to show it without the square brackets.

Currently I do that by copying the output to a text editor and removing, in this case, [x, y, z] with the Replace command, then copying the expression back to Mathematica. How to do this in Mathematica itself automatically?

$\endgroup$
  • $\begingroup$ Please post your code in a readable form (e.g. InputForm). $\endgroup$ – Yves Klett Jan 23 '15 at 14:29
  • $\begingroup$ A more readable form added. $\endgroup$ – Taiki Jan 23 '15 at 14:34
  • $\begingroup$ Not sure what the downvote is for... $\endgroup$ – Yves Klett Jan 23 '15 at 17:17
2
$\begingroup$

Select the cell containing your output, then choose TraditionaForm from the Convert To submenu of the Cell menu. The cell will then show

formula

Update

Perhaps this is what you are looking for:

(f^(1,0,0))[x, y, z]/(h^(1,0,0))[x, y, z] /. h_[x, y, z] -> h

head-only

$\endgroup$
  • $\begingroup$ Thank you. I have a very large expression and adding /. h_[...] -> h really helps. Now I feel stupid for asking the question in the first place. :-D $\endgroup$ – Taiki Jan 23 '15 at 15:02
2
$\begingroup$

A look at the FullForm motivates e.g. this:

der = Derivative[1, 0, 0][f][x, y, z]/Derivative[1, 0, 0][h][x, y, z];

der /. Derivative[a___][b___][c___] :> Derivative[a][b]

Mathematica graphics

$\endgroup$
  • $\begingroup$ This is quite elegant, but it does change the meaning of the actual expression and not just its appearance. For instance, Derivative[1][Sin][x] yields Cos[x], whereas Derivative[1][Sin] yields Cos[#1] &. Whether this matters depends on the use that the author of the question intends. $\endgroup$ – bbgodfrey Jan 23 '15 at 15:00
  • $\begingroup$ @bbgodfrey agreed on the non-equivalence of the expressions and the not-yet clear intention of the OP. $\endgroup$ – Yves Klett Jan 23 '15 at 15:09
  • $\begingroup$ What's not clear about my intention? $\endgroup$ – Taiki Jan 23 '15 at 15:11
  • $\begingroup$ @Taiki I was not sure if you just wanted the typeset expression or something related to the original expression, but the formulation of your goal is clear :D $\endgroup$ – Yves Klett Jan 23 '15 at 17:16

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.