1
$\begingroup$

This question already has an answer here:

I type in my equations using ctrl+- to make it look nice and my answer outputs in "Subscript^(0,1)[a,b]" form? What is going on? In the answer some bits are displayed with the actual subscripts and some are displayed in the above form, even for the same variable.

Edit: more specifics I am taking the partial derivative of a function H wrt to b. H is a function of many variables one of which is a_b. Is it possible that Mathematica is trying to take the derivative of the subscript because there is a b in there?

H=d k2 + c^2 k4 + k5 s^2 + k1 U + 
 k3 \[Theta] + (g (1 - d - U - \[Theta]) \[Theta] - 
    U (1 + s Subscript[e, s])) Subscript[\[Lambda], 
  1] + (-c d + s U Subscript[e, s]) Subscript[\[Lambda], 2] + 
 U Subscript[\[Lambda], 3]

and

DHds = Simplify[D[H, s]]
$\endgroup$

marked as duplicate by István Zachar, MarcoB, dr.blochwave, C. E., m_goldberg Dec 1 '15 at 2:26

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.

  • $\begingroup$ How about a real example... $\endgroup$ – ciao Feb 7 '14 at 2:43
  • 1
    $\begingroup$ It looks like you might be taking partial derivatives of subscripted variables. The most useful answer is: Don't use Ctrl- to make it "look nice"... that's the problem right there! They only look nice, but are a pain in the butt when you want to do other things with them (also depends on what you want to do). $\endgroup$ – rm -rf Feb 7 '14 at 2:58
  • 1
    $\begingroup$ You can select the cell contained your code and press Ctrl+Shift+I to change it into InputForm before you paste your code here. $\endgroup$ – xzczd Feb 7 '14 at 3:39
  • 2
    $\begingroup$ As rm-rf said, generally a PITA to use in the way you seem to want, but if you insist on "prettiness", you can just enclose the subscripts in your original definitions in double-quotes... $\endgroup$ – ciao Feb 7 '14 at 3:48
  • 3
    $\begingroup$ Try this: use es instead of Subscript[e, s], λ1 instead of Subscript[λ, 1], etc. and do the computations. Finally, to "prettify" the output, do DHds /. {es -> Subscript[e, s], λ1 -> Subscript[λ, 1], λ2 -> Subscript[λ, 2]} $\endgroup$ – rm -rf Feb 7 '14 at 4:40