Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

This question already has an answer here:

I need to have time differentials to look like the 'textbook'. My code is

Dt[x y^2] /. {Dt[x] -> dx/dt, Dt[y] -> dy/dt} 

which gives the output

(2 dy x y)/dt + (dx y^2)/dt. 

This is very hard to follow.

My question is how can the output be made to look like

2 x y dy/dt + y^2  dx/dt 

(only with dy/dt and dx/dt vertical).

Thanks.

share|improve this question

marked as duplicate by Jens, Artes, Kuba, Sjoerd C. de Vries, Szabolcs Sep 3 '13 at 21:58

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

    
Strange. #[x] /. {#[x_] -> h} & /@ {Dt, g} == {Dt[x], h} –  ssch Sep 3 '13 at 19:46
1  
Welcome to Mathematica.SE! Could you please change your username to something recognizable, instead of "user9292"? Then you can remove the signature from the post itself. This will comply with the site etiquette. –  Szabolcs Sep 3 '13 at 19:49
    
Nevermind my strangeness above, the pattern got differentiated. HoldPattern made everything better –  ssch Sep 3 '13 at 19:57
    
Have you asked this question Basins of Attraction? If this is the case the both accounts should be merged. –  Artes Sep 3 '13 at 20:52
add comment

1 Answer 1

I recommend using TraditionalForm for readability, but I do not recommend altering the looks of the output too much.

To look at the output in TraditionalForm, either use Dt[x y^2] // TraditionalForm as the input or select the output cell and press ctrl-shift-T. In the preferences you can set TraditionalForm as the default output.

I do not recommend trying to change the looks of the output too much because Mathematica is a programming language, and thus requires a precise, unambiguous syntax. TraditionalForm is already pushing this, as it is not entirely unambiguous (you'll get a warning popup when you try to use it as input). This is not as big a problem in practice as the warning would let you think. Most of the time everything will be fine. If you use output that Mathematica generated, then you can be confident that it'll be interpreted correctly when you use it as input.

So, to sum up: computers just follow instructions blindly, so you need to make sure those instructions are very precise. This places constraints on what notations are practical.

Mathematical notation used in textbooks is typically ambiguous and relies on context and the expectations of the target audience.

share|improve this answer
add comment

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